Skip to content

Commit

Permalink
Update for new mocks with blocked quanta
Browse files Browse the repository at this point in the history
  • Loading branch information
eigerx committed Aug 3, 2024
1 parent 28e5fcf commit 647861f
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions tests/test_rc2_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from typing import ClassVar

from lsst.ci.middleware.output_repo_tests import OutputRepoTests
from lsst.pipe.base.quantum_provenance_graph import QuantumProvenanceGraph, Summary, TaskSummary, DatasetTypeSummary
from lsst.pipe.base.quantum_provenance_graph import QuantumProvenanceGraph, Summary, TaskSummary, DatasetTypeSummary, UnsuccessfulQuantumSummary

Check failure on line 26 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E501

line too long (144 > 110 characters)
from lsst.pipe.base.tests.mocks import MockDataset, get_mock_name

# (tract, patch, band): {input visits} for coadds produced here.
Expand Down Expand Up @@ -171,7 +171,6 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
for label, task_summary in qg_1_sum.tasks.items():
self.assertEqual(task_summary.n_not_attempted, 0)
self.assertEqual(task_summary.n_wonky, 0)
self.assertEqual(task_summary.n_blocked, 0)
self.assertListEqual(task_summary.wonky_quanta, [])
self.assertListEqual(task_summary.recovered_quanta, [])
match label:
Expand All @@ -182,17 +181,15 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
self.assertEqual(task_summary.n_successful, 0)
self.assertEqual(
task_summary.failed_quanta,
[
{
"data_id": {"skymap": "ci_mw", "tract": 0},
"runs": {"HSC/runs/RC2/step8-attempt1": "failed"},
"messages": [
"Execution of task '_mock_analyzeObjectTableCore' on quantum {skymap: "
"'ci_mw', tract: 0} failed. Exception ValueError: Simulated failure: "
"task=_mock_analyzeObjectTableCore dataId={skymap: 'ci_mw', tract: 0}"
],
}
],
[UnsuccessfulQuantumSummary(
data_id = {"skymap": "ci_mw", "tract": 0},

Check failure on line 185 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals

Check failure on line 185 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals

Check failure on line 185 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E222

multiple spaces after operator
runs = {"HSC/runs/RC2/step8-attempt1": "failed"},

Check failure on line 186 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals

Check failure on line 186 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals
messages = [

Check failure on line 187 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals

Check failure on line 187 in tests/test_rc2_outputs.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E251

unexpected spaces around keyword / parameter equals
"Execution of task '_mock_analyzeObjectTableCore' on quantum {skymap: "
"'ci_mw', tract: 0} failed. Exception ValueError: Simulated failure: "
"task=_mock_analyzeObjectTableCore dataId={skymap: 'ci_mw', tract: 0}"
]
)],
)
self.assertEqual(task_summary.n_blocked, 0)
case _:
Expand All @@ -210,9 +207,13 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
elif label == "_mock_plotPropertyMapTract":
self.assertEqual(task_summary.n_expected, 2)
self.assertEqual(task_summary.n_successful, 2)
elif label in ["_mock_makeMetricTableObjectTableCore", "_mock_objectTableCoreWholeSkyPlot"]:
self.assertEqual(task_summary.n_blocked, 1)
self.assertEqual(task_summary.n_successful, 0)
else:
self.assertEqual(task_summary.n_expected, 1)
self.assertEqual(task_summary.n_successful, 1)
self.assertEqual(task_summary.n_blocked, 0)
# Check on datasets
DatasetTypeSummary.model_validate(qg_1_sum.datasets)
for dataset_type_summary in qg_1_sum.datasets.values():
Expand All @@ -234,6 +235,8 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
dataset_type_summary.unsuccessful_datasets,
[{"skymap": "ci_mw", "tract": 0}],
)
case label if label in ["_mock_makeMetricTableObjectTableCore", "_mock_objectTableCoreWholeSkyPlot"]:
self.assertEqual(dataset_type_summary.n_unsuccessful, 1)
# These are the non-failed tasks:
case _:
self.assertEqual(dataset_type_summary.n_unsuccessful, 0)
Expand Down Expand Up @@ -310,14 +313,20 @@ def check_step8_qpg(self, helper: OutputRepoTests) -> None:
self.assertListEqual(task_summary.failed_quanta, [])
match label:
# Check that the failure was recovered:
case "_mock_analyzeObjectTableCore":
case label if label in ["_mock_analyzeObjectTableCore", "_mock_makeMetricTableObjectTableCore", "_mock_objectTableCoreWholeSkyPlot"]:
self.assertEqual(task_summary.n_expected, 1)
self.assertEqual(task_summary.n_successful, 1)
self.assertEqual(
task_summary.recovered_quanta,
[{"skymap": "ci_mw", "tract": 0}],
)
self.assertEqual(task_summary.n_blocked, 0)
if label == "_mock_analyzeObjectTableCore":
self.assertEqual(
task_summary.recovered_quanta,
[{"skymap": "ci_mw", "tract": 0}],
)
if label in ["_mock_makeMetricTableObjectTableCore", "_mock_objectTableCoreWholeSkyPlot"]:
self.assertEqual(
task_summary.recovered_quanta,
[{"skymap": "ci_mw"}],
)
case _:
self.assertListEqual(task_summary.recovered_quanta, [])

Expand Down

0 comments on commit 647861f

Please sign in to comment.