-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split long regtests into reusable fixtures and smaller named tests #1426
Conversation
def test_output_is_image_model(output_model): | ||
# DMS280 FIXME comment says 280 | ||
# DMS414 FIXME log message said 414 | ||
# FIXME was not an assert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current code:
romancal/romancal/regtest/test_wfi_16resultants.py
Lines 98 to 102 in e741d19
# DMS280 result is an ImageModel | |
pipeline.log.info( | |
"DMS414 MSG: Testing that result is a Level 2 model......." | |
+ passfail(isinstance(model, rdm.datamodels.ImageModel)) | |
) |
Mentions DMS280 in the comment but DMS414 in the log message and contains no assert. What is the expected DMS requirement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
414 is right. 413 in the ~docstring and 280 are wrong. This is also correct (414) in https://github.com/spacetelescope/romancal/blob/e741d1963e163d8fbbeff714cb6a2acea662ae8a/romancal/tests/dms_requirement_tests.json .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I updated the comments here: 457073d
|
||
@pytest.mark.soctests | ||
def test_has_a_wcs(output_model): | ||
# DMS129 TODO not listed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DMS129 isn't listed in the requirements. Is it satisfied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should mark this as done. I can't figure out why it's not picked up by John's page, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added DMS129 in 4c0ad1d
) | ||
def test_steps_ran(output_model, step_name): | ||
# DMS86 | ||
# also DMS129 for assign_wcs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DMS129 should be marked done (i.e., we should add it to the test_requirements_dms.json file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added DMS129 in 4c0ad1d
@pytest.mark.soctests | ||
@pytest.mark.parametrize("meta_attribute", ("detector", "optical_element")) | ||
def test_instrument_meta(output_model, meta_attribute): | ||
# DMS-136 PSF tests TODO not listed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DMS136 isn't listed in the requirements. Is it satisfied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should go ahead and mark it. I don't understand why it's not tracked on John's "missing requirements" page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added DMS136 in 229b164
|
||
@pytest.mark.soctests | ||
def test_wcs_has_bounding_box(output_model): | ||
# DMS89 WCS tests TODO not listed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DMS89 is not listed in the requirements. Is it satisfied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likewise a requirement that should be added to the requirements.json list; we've delivered this requirement and this was the test that did that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added DMS89 in 03ce0ad
def test_resample_ran(output_model): | ||
# DMS373 test output is resampled to a skycell | ||
# FIXME this doesn't test if the output is a skyceell | ||
assert output_model.meta.cal_step.resample == "COMPLETE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous code:
romancal/romancal/regtest/test_mos_pipeline.py
Lines 151 to 154 in e741d19
pipeline.log.info( | |
"DMS373 MSG: Testing the creation of a Level 3 mosaic image resampled to a skycell" | |
+ passfail(model.meta.cal_step.resample == "COMPLETE") | |
) |
mentions that the requirement is that the output is resampled to a skycell. The test doesn't appear to test that (and was not previously an assert).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the comment is misleading. Let's leave this for now. Perhaps the test should be updated to look for https://github.com/spacetelescope/rad/blob/main/src/rad/resources/schemas/mosaic_basic-1.0.0.yaml#L133 , but I'm not sure that we actually populate that right now. I'll spin that into a separate issue.
I'm going to open this for review to try to get some help on the questions about the DMS requirements. There are a number of inconsistencies and missing requirements (ones mentioned in the code but not in the requirement file, for the ones I investigated they also did not previously have a decorator). |
0e28096
to
308b4fc
Compare
Closes #1325
This PR refactors some large regtests:
passfail
functions and their use (the test results provide information about if the test passed or failed)There are a few items to resolve for this PR:
dms_requirement_tests.json
need parametrization values (and are they supported) for parameterized tests that correspond to dms requirements? (for exampleromancal.regtest.test_mos_pipeline.test_steps_ran
now tests DMS400 but technically only using theskymatch
parametrization) EDIT: @zacharyburnett confirmed the non-parametrized one is the one to use.dms_requirement_tests.json
(and did not previously have a decorator). These log messages aren't in a format that the metrics collector understands. If these were added to verify a requirement those requirements are not being verified. I suspect we want to convert the log messages into entries intodms_requirement_tests.json
and will add comments for those dms requirements.Regression tests all pass: https://github.com/spacetelescope/RegressionTests/actions/runs/11071508240
Tasks
24Q4_B15
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)docs/
pageokify_regtests
to update the truth filesnews fragment change types...
changes/<PR#>.general.rst
: infrastructure or miscellaneous changechanges/<PR#>.docs.rst
changes/<PR#>.stpipe.rst
changes/<PR#>.associations.rst
changes/<PR#>.scripts.rst
changes/<PR#>.mosaic_pipeline.rst
changes/<PR#>.patch_match.rst
steps
changes/<PR#>.dq_init.rst
changes/<PR#>.saturation.rst
changes/<PR#>.refpix.rst
changes/<PR#>.linearity.rst
changes/<PR#>.dark_current.rst
changes/<PR#>.jump_detection.rst
changes/<PR#>.ramp_fitting.rst
changes/<PR#>.assign_wcs.rst
changes/<PR#>.flatfield.rst
changes/<PR#>.photom.rst
changes/<PR#>.flux.rst
changes/<PR#>.source_detection.rst
changes/<PR#>.tweakreg.rst
changes/<PR#>.skymatch.rst
changes/<PR#>.outlier_detection.rst
changes/<PR#>.resample.rst
changes/<PR#>.source_catalog.rst