Skip to content

Commit

Permalink
added metrics logger decorator to older roman tests, updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Apr 4, 2024
1 parent ebcdb43 commit 7816129
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
11.17.20 (unreleased)
=====================

ROMAN
-----
- Added metrics_logger decorator to Roman tests delivered with older builds [#1033]


11.17.19 (2024-02-22)
=====================

Expand Down
21 changes: 21 additions & 0 deletions test/certify/test_certify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pytest import mark, xfail
import numpy as np
import logging
from metrics_logger.decorators import metrics_logger
from crds.core import utils, log, exceptions
from crds import data_file, certify
from crds.certify import CertifyScript, generic_tpn, validators, mapping_parser
Expand Down Expand Up @@ -744,6 +745,8 @@ def test_certify_AsdfCertify_valid(jwst_serverless_state, jwst_data, caplog):


@mark.certify
@mark.roman
@metrics_logger("DMS4")
def test_certify_roman_valid_asdf(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a valid asdf file is recognized as such.
"""
Expand All @@ -755,6 +758,8 @@ def test_certify_roman_valid_asdf(roman_test_cache_state, roman_data, caplog):


@mark.certify
@mark.roman
@metrics_logger("DMS4")
def test_certify_roman_invalid_asdf_schema(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that an asdf file that does not conform to its schema definition
triggers an error in DataModels.
Expand All @@ -781,6 +786,8 @@ def test_certify_roman_invalid_asdf_schema(roman_test_cache_state, roman_data, c


@mark.certify
@mark.roman
@metrics_logger("DMS4")
def test_certify_roman_invalid_asdf_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that an asdf file that does not conform to its tpn definition
triggers an error in crds. Note: as the tpn often replicates schema implementation, this also
Expand Down Expand Up @@ -810,6 +817,8 @@ def test_certify_roman_invalid_asdf_tpn(roman_test_cache_state, roman_data, capl


@mark.certify
@mark.roman
@metrics_logger("DMS5")
def test_certify_roman_valid_spec_asdf(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a valid spectroscopic asdf file is recognized as such."""
with caplog.at_level(logging.INFO, logger="CRDS"):
Expand All @@ -820,6 +829,8 @@ def test_certify_roman_valid_spec_asdf(roman_test_cache_state, roman_data, caplo


@mark.certify
@mark.roman
@metrics_logger("DMS5")
def test_certify_roman_invalid_spec_asdf_schema(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a spectroscopic asdf file that does not conform to its schema
definition triggers an error in DataModels."""
Expand All @@ -839,6 +850,8 @@ def test_certify_roman_invalid_spec_asdf_schema(roman_test_cache_state, roman_da


@mark.certify
@mark.roman
@metrics_logger("DMS5")
def test_certify_roman_invalid_spec_asdf_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: confirm that a spectroscopic asdf file that does not conform to its tpn
definition triggers an error in crds. Note: as the tpn often replicates schema implementation,
Expand Down Expand Up @@ -906,6 +919,8 @@ def test_certify_rmap_compare(jwst_serverless_state, caplog):


@mark.certify
@mark.roman
@metrics_logger("DMS6")
def test_certify_roman_rmap_compare(roman_test_cache_state, caplog):
"""Required Roman test: confirm that a calibration mapping file properly compares to its context."""
with caplog.at_level(logging.INFO, logger="CRDS"):
Expand Down Expand Up @@ -957,6 +972,8 @@ def test_certify_duplicate_rmap_case_error(hst_serverless_state, hst_data, caplo


@mark.certify
@mark.roman
@metrics_logger("DMS6")
def test_certify_roman_duplicate_rmap_case_error(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: verify that a calibration mapping file containing duplicate match cases
fails."""
Expand Down Expand Up @@ -987,6 +1004,8 @@ def test_checksum_duplicate_rmap_case_error(hst_serverless_state, hst_data, capl


@mark.certify
@mark.roman
@metrics_logger("DMS6")
def test_checksum_roman_duplicate_rmap_case_error(roman_serverless_state, roman_data, caplog):
"""Required Roman test: verify that the crds rmap checksum update tool does not silently drop
duplicate rmap entries when updating the checksum and rewriting the file."""
Expand All @@ -1001,6 +1020,8 @@ def test_checksum_roman_duplicate_rmap_case_error(roman_serverless_state, roman_


@mark.certify
@mark.roman
@metrics_logger("DMS6")
def test_certify_roman_invalid_rmap_tpn(roman_test_cache_state, roman_data, caplog):
"""Required Roman test: verify that a calibration mapping file that violates tpn rules produces an
error."""
Expand Down

0 comments on commit 7816129

Please sign in to comment.