from __future__ import annotations import unittest from pathlib import Path ROOT = Path(__file__).resolve().parents[1] WORKFLOW = ROOT / ".github" / "workflows" / "integration-test-hubspot.yml" LEGACY_WORKFLOW = ROOT / ".github" / "workflows" / "hubspot-inbound-pressure-matrix.yml" class HubSpotPressureMatrixWorkflowTests(unittest.TestCase): def test_hubspot_integration_workflow_owns_pressure_case_orchestration(self) -> None: workflow = WORKFLOW.read_text(encoding="utf-8") self.assertIn("workflow_dispatch:", workflow) self.assertIn("pressure_worker_count:", workflow) self.assertIn("pressure_event_count:", workflow) self.assertIn("pressure_fixture_manifest:", workflow) self.assertIn("pressure_candidate_id:", workflow) self.assertIn("suite_mode == 'pressure'", workflow) self.assertIn("admin/hubspot/inbound-pressure-w", workflow) self.assertIn( "inputs.suite_mode == 'pressure' && " "'deploy-test-multi-slot-environment-test1'", workflow, ) self.assertIn( "format('deploy-test-multi-slot-environment-{0}', inputs.target_env)", workflow, ) self.assertIn('[[ "${GITHUB_REF}" == "refs/heads/main" ]]', workflow) self.assertIn("check_hubspot_connector_worker_preflight.py", workflow) self.assertNotIn("systemctl restart", workflow) self.assertNotIn("deploy-test-serviceification", workflow) self.assertFalse(LEGACY_WORKFLOW.exists()) if __name__ == "__main__": unittest.main()