Skip to content

Commit

Permalink
Make sure that Core and Serialization tests are run for bash changes (#…
Browse files Browse the repository at this point in the history
…37953)

There are a number of tests using Bash Operator in Core and
Serialization test types - so we should force those two test types
if bash or it's tests are modified.
  • Loading branch information
potiuk authored Mar 7, 2024
1 parent 354e633 commit 1f5960a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import sys
from enum import Enum
from functools import cached_property, lru_cache
from pathlib import Path
from typing import Any, Dict, List, TypeVar

from airflow_breeze.branch_defaults import AIRFLOW_BRANCH, DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
Expand Down Expand Up @@ -724,6 +725,11 @@ def _get_test_types_to_run(self) -> list[str]:
get_console().print(f"[warning]Remaining non test/always files: {len(remaining_files)}[/]")
count_remaining_files = len(remaining_files)

for file in self._files:
if file.endswith("bash.py") and Path(file).parent.name == "operators":
candidate_test_types.add("Serialization")
candidate_test_types.add("Core")
break
if count_remaining_files > 0:
get_console().print(
f"[warning]We should run all tests. There are {count_remaining_files} changed "
Expand Down
46 changes: 46 additions & 0 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,52 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
},
id="Only Always and Common.IO tests should run when only common.io and tests/always changed",
),
pytest.param(
("airflow/operators/bash.py",),
{
"affected-providers-list-as-string": None,
"all-python-versions": "['3.8']",
"all-python-versions-list-as-string": "3.8",
"python-versions": "['3.8']",
"python-versions-list-as-string": "3.8",
"ci-image-build": "true",
"prod-image-build": "false",
"needs-helm-tests": "false",
"run-tests": "true",
"run-amazon-tests": "false",
"docs-build": "true",
"run-kubernetes-tests": "false",
"skip-pre-commits": "check-provider-yaml-valid,identity,lint-helm-chart,mypy-core,mypy-dev,mypy-docs,mypy-providers,ts-compile-format-lint-www",
"upgrade-to-newer-dependencies": "false",
"parallel-test-types-list-as-string": "Always Core Operators Serialization",
"needs-mypy": "true",
"mypy-folders": "['airflow']",
},
id="Force Core and Serialization tests to run when airflow bash.py changed",
),
pytest.param(
("tests/operators/bash.py",),
{
"affected-providers-list-as-string": None,
"all-python-versions": "['3.8']",
"all-python-versions-list-as-string": "3.8",
"python-versions": "['3.8']",
"python-versions-list-as-string": "3.8",
"ci-image-build": "true",
"prod-image-build": "false",
"needs-helm-tests": "false",
"run-tests": "true",
"run-amazon-tests": "false",
"docs-build": "false",
"run-kubernetes-tests": "false",
"skip-pre-commits": "check-provider-yaml-valid,identity,lint-helm-chart,mypy-core,mypy-dev,mypy-docs,mypy-providers,ts-compile-format-lint-www",
"upgrade-to-newer-dependencies": "false",
"parallel-test-types-list-as-string": "Always Core Operators Serialization",
"needs-mypy": "true",
"mypy-folders": "['airflow']",
},
id="Force Core and Serialization tests to run when tests bash changed",
),
],
)
def test_expected_output_pull_request_main(
Expand Down

0 comments on commit 1f5960a

Please sign in to comment.