rusackas commented on code in PR #41966:
URL: https://github.com/apache/superset/pull/41966#discussion_r3564818820
##########
tests/integration_tests/reports/commands_tests.py:
##########
@@ -772,6 +772,45 @@ def test_email_chart_report_schedule(
assert_log(ReportState.SUCCESS)
[email protected](
+ "load_birth_names_dashboard_with_slices", "create_report_email_chart"
+)
+@patch("superset.reports.notifications.email.send_email_smtp")
+@patch("superset.utils.screenshots.ChartScreenshot.get_screenshot")
+def test_email_chart_report_schedule_single_log_per_execution(
+ screenshot_mock,
+ email_mock,
+ create_report_email_chart,
+):
Review Comment:
These are params on a test function in the integration suite, which we don't
annotate. Typing is green in CI, so leaving as-is. Thanks!
##########
tests/integration_tests/reports/commands_tests.py:
##########
@@ -772,6 +772,45 @@ def test_email_chart_report_schedule(
assert_log(ReportState.SUCCESS)
[email protected](
+ "load_birth_names_dashboard_with_slices", "create_report_email_chart"
+)
+@patch("superset.reports.notifications.email.send_email_smtp")
+@patch("superset.utils.screenshots.ChartScreenshot.get_screenshot")
+def test_email_chart_report_schedule_single_log_per_execution(
+ screenshot_mock,
+ email_mock,
+ create_report_email_chart,
+):
+ """
+ ExecuteReport Command: a single execution should produce a single log row.
+
+ Regression for #29857: the Alerts & Reports execution log shows duplicated
+ entries for a single execution. Each execution transitions through the
+ WORKING state and then a terminal state (SUCCESS/ERROR), and every
+ transition writes a ReportExecutionLog row sharing the same execution
+ ``uuid``. As a result one execution surfaces as two rows in the log view
+ (the "trigger" row and the "result" row). This test asserts that one
+ execution -- identified by its execution uuid -- yields exactly one log
row.
+ """
+ screenshot_mock.return_value = SCREENSHOT_FILE
+
+ with freeze_time("2020-01-01T00:00:00Z"):
+ AsyncExecuteReportScheduleCommand(
+ TEST_ID, create_report_email_chart.id, datetime.utcnow()
+ ).run()
+
+ db.session.commit()
+ logs = (
+ db.session.query(ReportExecutionLog)
+ .filter(ReportExecutionLog.uuid == TEST_ID)
+ .all()
+ )
Review Comment:
Same story, logs is a local in a test. Keeping it unannotated to match the
rest of the file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]