|
16 | 16 | GithubCheckConclusion, |
17 | 17 | GithubCheckStatus, |
18 | 18 | ) |
19 | | -from sqlmesh.utils.errors import ConflictingPlanError, PlanError, TestError |
| 19 | +from sqlmesh.utils.errors import ConflictingPlanError, PlanError, TestError, CICDBotError |
20 | 20 |
|
21 | 21 | pytest_plugins = ["tests.integrations.github.cicd.fixtures"] |
22 | 22 | pytestmark = [ |
@@ -461,7 +461,8 @@ def test_run_all_test_failed( |
461 | 461 | github_output_file = tmp_path / "github_output.txt" |
462 | 462 |
|
463 | 463 | with mock.patch.dict(os.environ, {"GITHUB_OUTPUT": str(github_output_file)}): |
464 | | - command._run_all(controller) |
| 464 | + with pytest.raises(CICDBotError): |
| 465 | + command._run_all(controller) |
465 | 466 |
|
466 | 467 | assert "SQLMesh - Run Unit Tests" in controller._check_run_mapping |
467 | 468 | test_checks_runs = controller._check_run_mapping["SQLMesh - Run Unit Tests"].all_kwargs |
@@ -593,7 +594,8 @@ def test_run_all_test_exception( |
593 | 594 | github_output_file = tmp_path / "github_output.txt" |
594 | 595 |
|
595 | 596 | with mock.patch.dict(os.environ, {"GITHUB_OUTPUT": str(github_output_file)}): |
596 | | - command._run_all(controller) |
| 597 | + with pytest.raises(CICDBotError): |
| 598 | + command._run_all(controller) |
597 | 599 |
|
598 | 600 | assert "SQLMesh - Run Unit Tests" in controller._check_run_mapping |
599 | 601 | test_checks_runs = controller._check_run_mapping["SQLMesh - Run Unit Tests"].all_kwargs |
@@ -727,7 +729,8 @@ def raise_on_pr_plan(plan: Plan): |
727 | 729 | github_output_file = tmp_path / "github_output.txt" |
728 | 730 |
|
729 | 731 | with mock.patch.dict(os.environ, {"GITHUB_OUTPUT": str(github_output_file)}): |
730 | | - command._run_all(controller) |
| 732 | + with pytest.raises(CICDBotError): |
| 733 | + command._run_all(controller) |
731 | 734 |
|
732 | 735 | assert "SQLMesh - PR Environment Synced" in controller._check_run_mapping |
733 | 736 | pr_checks_runs = controller._check_run_mapping["SQLMesh - PR Environment Synced"].all_kwargs |
@@ -851,7 +854,8 @@ def raise_on_prod_plan(plan: Plan): |
851 | 854 | github_output_file = tmp_path / "github_output.txt" |
852 | 855 |
|
853 | 856 | with mock.patch.dict(os.environ, {"GITHUB_OUTPUT": str(github_output_file)}): |
854 | | - command._run_all(controller) |
| 857 | + with pytest.raises(CICDBotError): |
| 858 | + command._run_all(controller) |
855 | 859 |
|
856 | 860 | assert "SQLMesh - Prod Plan Preview" in controller._check_run_mapping |
857 | 861 | prod_plan_preview_checks_runs = controller._check_run_mapping[ |
|
0 commit comments