From cc4a59f55607ae18e8fbeea4ebedb59f758f1253 Mon Sep 17 00:00:00 2001 From: Orion Eiger Date: Fri, 14 Jun 2024 18:06:07 -0700 Subject: [PATCH] Show number of expected quanta in pipetask report --- python/lsst/ctrl/mpexec/cli/script/report.py | 12 ++++++++---- tests/test_cliCmdReport.py | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/python/lsst/ctrl/mpexec/cli/script/report.py b/python/lsst/ctrl/mpexec/cli/script/report.py index 7f4c3238..072e674a 100644 --- a/python/lsst/ctrl/mpexec/cli/script/report.py +++ b/python/lsst/ctrl/mpexec/cli/script/report.py @@ -83,16 +83,20 @@ def report( quanta_summary.append( { "Task": task, - "Failed Quanta": len(summary_dict[task]["failed_quanta"]), - "Blocked Quanta": summary_dict[task]["n_quanta_blocked"], + "Failed": len(summary_dict[task]["failed_quanta"]), + "Blocked": summary_dict[task]["n_quanta_blocked"], + "Succeeded": summary_dict[task]["n_succeeded"], + "Expected": summary_dict[task]["n_expected"] } ) else: quanta_summary.append( { "Task": task, - "Failed Quanta": summary_dict[task]["failed_quanta"], - "Blocked Quanta": summary_dict[task]["n_quanta_blocked"], + "Failed": summary_dict[task]["failed_quanta"], + "Blocked": summary_dict[task]["n_quanta_blocked"], + "Succeeded": summary_dict[task]["n_succeeded"], + "Expected": summary_dict[task]["n_expected"] } ) if "errors" in summary_dict[task].keys(): diff --git a/tests/test_cliCmdReport.py b/tests/test_cliCmdReport.py index 8bbfd238..9c1b346a 100644 --- a/tests/test_cliCmdReport.py +++ b/tests/test_cliCmdReport.py @@ -82,6 +82,7 @@ def test_report(self): report_output_dict = yaml.load(f, Loader=SafeLoader) self.assertIsNotNone(report_output_dict["task0"]) self.assertIsNotNone(report_output_dict["task0"]["failed_quanta"]) + self.assertIsInstance(report_output_dict["task0"]["n_expected"], int) result_hr = self.runner.invoke( pipetask_cli, @@ -97,7 +98,10 @@ def test_report(self): # Check that task0 and the failed quanta for task0 exist in the string self.assertIn("task0", result_hr.stdout) - self.assertIn("Failed Quanta", result_hr.stdout) + self.assertIn("Failed", result_hr.stdout) + self.assertIn("Expected", result_hr.stdout) + self.assertIn("Succeeded", result_hr.stdout) + if __name__ == "__main__":