|
11 | 11 | import pandas as pd |
12 | 12 | from ax.adapter.base import Adapter |
13 | 13 | from ax.adapter.registry import Generators |
| 14 | +from ax.analysis.healthcheck.healthcheck_analysis import ( |
| 15 | + create_healthcheck_analysis_card, |
| 16 | + HealthcheckStatus, |
| 17 | +) |
14 | 18 | from ax.analysis.insights import InsightsAnalysis |
15 | 19 | from ax.analysis.overview import OverviewAnalysis |
16 | 20 | from ax.analysis.plotly.arm_effects import ArmEffectsPlot |
@@ -447,3 +451,47 @@ def test_insights_analysis_single_parameter(self) -> None: |
447 | 451 | # Check that none of the cards are error cards |
448 | 452 | for card in all_cards: |
449 | 453 | self.assertNotIsInstance(card, ErrorAnalysisCard) |
| 454 | + |
| 455 | + def test_info_status_healthcheck_cards_in_overview(self) -> None: |
| 456 | + """Test that healthcheck cards with INFO status are included in overview.""" |
| 457 | + # Create healthcheck cards with different statuses |
| 458 | + pass_card = create_healthcheck_analysis_card( |
| 459 | + name="PassCheck", |
| 460 | + title="Pass Healthcheck", |
| 461 | + subtitle="This check passed", |
| 462 | + df=pd.DataFrame(), |
| 463 | + status=HealthcheckStatus.PASS, |
| 464 | + ) |
| 465 | + info_card = create_healthcheck_analysis_card( |
| 466 | + name="InfoCheck", |
| 467 | + title="Info Healthcheck", |
| 468 | + subtitle="This is informational", |
| 469 | + df=pd.DataFrame(), |
| 470 | + status=HealthcheckStatus.INFO, |
| 471 | + ) |
| 472 | + warning_card = create_healthcheck_analysis_card( |
| 473 | + name="WarningCheck", |
| 474 | + title="Warning Healthcheck", |
| 475 | + subtitle="This is a warning", |
| 476 | + df=pd.DataFrame(), |
| 477 | + status=HealthcheckStatus.WARNING, |
| 478 | + ) |
| 479 | + fail_card = create_healthcheck_analysis_card( |
| 480 | + name="FailCheck", |
| 481 | + title="Fail Healthcheck", |
| 482 | + subtitle="This check failed", |
| 483 | + df=pd.DataFrame(), |
| 484 | + status=HealthcheckStatus.FAIL, |
| 485 | + ) |
| 486 | + |
| 487 | + # INFO cards should be considered passing |
| 488 | + self.assertTrue(info_card.is_passing()) |
| 489 | + self.assertTrue(pass_card.is_passing()) |
| 490 | + self.assertFalse(warning_card.is_passing()) |
| 491 | + self.assertFalse(fail_card.is_passing()) |
| 492 | + |
| 493 | + # Verify INFO status is correctly retrieved |
| 494 | + self.assertEqual(info_card.get_status(), HealthcheckStatus.INFO) |
| 495 | + self.assertEqual(pass_card.get_status(), HealthcheckStatus.PASS) |
| 496 | + self.assertEqual(warning_card.get_status(), HealthcheckStatus.WARNING) |
| 497 | + self.assertEqual(fail_card.get_status(), HealthcheckStatus.FAIL) |
0 commit comments