Skip to content

Commit

Permalink
Evaluate canary-run condition in run-tests SelectiveChecks (#45387)
Browse files Browse the repository at this point in the history
* evaluate canary run condition in workflow

* Update run tests check to verify canary run
  • Loading branch information
gopidesupavan authored Jan 4, 2025
1 parent a562a85 commit c37d5cf
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,8 @@ def needs_helm_tests(self) -> bool:

@cached_property
def run_tests(self) -> bool:
if self._is_canary_run():
return True
if self.only_new_ui_files:
return False
# we should run all test
Expand Down
36 changes: 36 additions & 0 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,42 @@ def test_no_commit_provided_trigger_full_build_for_any_event_type(github_event):
)


@pytest.mark.parametrize(
"github_event",
[
GithubEvents.PUSH,
GithubEvents.SCHEDULE,
],
)
def test_files_provided_trigger_full_build_for_any_event_type(github_event):
stderr = SelectiveChecks(
files=("airflow/ui/src/pages/Run/Details.tsx", "airflow/ui/src/router.tsx"),
commit_ref="",
github_event=github_event,
pr_labels=(),
default_branch="main",
)
assert_outputs_are_printed(
{
"all-python-versions": "['3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
"run-tests": "true",
"docs-build": "true",
"skip-pre-commits": "identity,mypy-airflow,mypy-dev,mypy-docs,mypy-providers,mypy-task-sdk",
"upgrade-to-newer-dependencies": (
"true" if github_event in [GithubEvents.PUSH, GithubEvents.SCHEDULE] else "false"
),
"core-test-types-list-as-string": ALL_CI_SELECTIVE_TEST_TYPES,
"needs-mypy": "true",
"mypy-checks": "['mypy-airflow', 'mypy-providers', 'mypy-docs', 'mypy-dev', 'mypy-task-sdk']",
},
str(stderr),
)


@pytest.mark.parametrize(
"files, expected_outputs, pr_labels, commit_ref",
[
Expand Down

0 comments on commit c37d5cf

Please sign in to comment.