fitzee commented on code in PR #44465:
URL: https://github.com/apache/superset/pull/44465#discussion_r4066846162
##########
tests/unit_tests/utils/test_report_execution.py:
##########
@@ -44,6 +46,48 @@ def _report_config(**overrides: int) -> dict[str, int |
bool]:
return config
+def test_chart_holder_diagnostics_separate_terminal_errors_from_success() ->
None:
+ diagnostics = ChartHolderDiagnostics.from_holder_states(
+ [
+ {"chartId": "1", "state": "rendered"},
+ {"chartId": "2", "state": "rendered"},
+ {"chartId": "3", "state": "empty"},
+ {"chartId": "4", "state": "error"},
+ {"chartId": "5", "state": "virtualized"},
+ ]
+ )
+
+ assert diagnostics.mounted_holders == 5
+ assert diagnostics.ready_holders == 5
+ assert diagnostics.rendered_holders == 2
+ assert diagnostics.empty_holders == 1
+ assert diagnostics.error_holders == 1
+ assert diagnostics.virtualized_holders == 1
+ assert diagnostics.unready_holders == 0
+ assert diagnostics.semantic_success is False
+
+
+def test_chart_holder_diagnostics_count_unready_holders() -> None:
+ diagnostics = ChartHolderDiagnostics.from_holder_states(
+ [
+ {"chartId": "1", "state": "rendered"},
+ {"chartId": "2", "state": "waiting_on_database"},
+ {"chartId": "3", "state": "nothing_mounted"},
+ ]
+ )
+
+ assert diagnostics.ready_holders == 1
+ assert diagnostics.unready_holders == 2
+ assert diagnostics.semantic_success is False
+
+
+def test_chart_holder_diagnostics_do_not_treat_zero_holders_as_success() ->
None:
+ diagnostics = ChartHolderDiagnostics.from_holder_states([])
+
+ assert diagnostics.mounted_holders == 0
+ assert diagnostics.semantic_success is False
Review Comment:
Fixed in f4ef4cc50fd26c02e4963240c523e285019a4541. Added short
scenario/outcome docstrings to the three holder-diagnostics tests.
##########
tests/unit_tests/utils/test_report_execution.py:
##########
@@ -136,6 +180,23 @@ def test_capture_rejection_is_sticky_for_the_execution()
-> None:
)
+def test_artifact_approval_is_namespaced_by_kind() -> None:
+ context = ReportExecutionContext(
+ execution_id=UUID("084e7ee6-5557-4ecd-9632-b7f39c9ec524"),
+ report_schedule_id=7,
+ deadline=ReportExecutionDeadline(total_seconds=900),
+ )
+ artifact = b"same exact bytes"
Review Comment:
Leaving this unchanged. The bytes literal has an unambiguous inferred type
and passes the repository's MyPy checks. An explicit local annotation would not
improve correctness or readability here; keeping this PR focused rather than
applying a blanket test-local annotation rewrite.
##########
tests/unit_tests/utils/test_screenshot_utils.py:
##########
@@ -90,6 +96,45 @@ def
test_stable_readiness_skips_when_budget_below_polling_margin() -> None:
page.wait_for_function.assert_not_called()
+def test_holder_diagnostics_include_offscreen_errors_for_full_capture() ->
None:
Review Comment:
Fixed in f4ef4cc50fd26c02e4963240c523e285019a4541. Added a docstring
describing the actual distinction: viewport scans mark off-screen holders
virtualized; full-dashboard scans expose their error state. Full-capture
diagnostics should not mark that off-screen error as virtualized.
--
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]