You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2024/02/12 23:22:44 UTC
(airflow) 08/23: Make PRs changing pyproject.toml neutral for breeze tests (#37314)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 14d3ea5e2a6f9b89165ddf622c0b9ab69bde47b9
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sat Feb 10 20:53:02 2024 +0100
Make PRs changing pyproject.toml neutral for breeze tests (#37314)
The #37305 optimized CI jobs to limit tests run when pyproject.toml
is changed without impacting dependencies, optional_dependencies and
build-system. However it impacts results of other unit tests as they
were using `HEAD` as commit in selective checks,
Instead of using HEAD, we are using neutral commit (one only changing
INTHEWILD) for all such tests, so that we do not introduce side effects
coming from the incoming PR.
(cherry picked from commit 08e655ac37a214371b65a321d6e8e0694faa455d)
---
dev/breeze/tests/test_selective_checks.py | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/dev/breeze/tests/test_selective_checks.py b/dev/breeze/tests/test_selective_checks.py
index d1b47b6a34..b5a89a2ba4 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -38,6 +38,9 @@ ANSI_COLORS_MATCHER = re.compile(r"(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]")
ALL_DOCS_SELECTED_FOR_BUILD = ""
ALL_PROVIDERS_AFFECTED = ""
+# commit that is neutral - allows to keep pyproject.toml-changing PRS neutral for unit tests
+NEUTRAL_COMMIT = "938f0c1f3cc4cbe867123ee8aa9f290f9f18100a"
+
def escape_ansi_colors(line):
return ANSI_COLORS_MATCHER.sub("", line)
@@ -587,7 +590,7 @@ def test_expected_output_pull_request_main(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=(),
default_branch="main",
@@ -687,7 +690,7 @@ def test_full_test_needed_when_scripts_changes(files: tuple[str, ...], expected_
stderr = SelectiveChecks(
files=files,
github_event=GithubEvents.PULL_REQUEST,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
default_branch="main",
)
assert_outputs_are_printed(expected_outputs, str(stderr))
@@ -819,7 +822,7 @@ def test_expected_output_full_tests_needed(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=pr_labels,
default_branch=default_branch,
@@ -942,7 +945,7 @@ def test_expected_output_pull_request_v2_7(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=(),
default_branch="v2-7-stable",
@@ -1110,7 +1113,7 @@ def test_expected_output_pull_request_target(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST_TARGET,
pr_labels=(),
default_branch="main",
@@ -1199,7 +1202,7 @@ def test_expected_output_push(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PUSH,
pr_labels=pr_labels,
default_branch=default_branch,
@@ -1436,7 +1439,7 @@ def test_upgrade_to_newer_dependencies(
def test_docs_filter(files: tuple[str, ...], expected_outputs: dict[str, str]):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=(),
default_branch="main",
@@ -1461,7 +1464,7 @@ def test_docs_filter(files: tuple[str, ...], expected_outputs: dict[str, str]):
def test_helm_tests_trigger_ci_build(files: tuple[str, ...], expected_outputs: dict[str, str]):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=(),
default_branch="main",
@@ -1708,7 +1711,7 @@ def test_has_migrations(files: tuple[str, ...], has_migrations: bool):
stderr = str(
SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
default_branch="main",
)
@@ -1742,7 +1745,7 @@ def test_has_migrations(files: tuple[str, ...], has_migrations: bool):
def test_provider_compatibility_checks(labels: tuple[str, ...], expected_outputs: dict[str, str]):
stderr = SelectiveChecks(
files=(),
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=labels,
default_branch="main",
@@ -1830,7 +1833,7 @@ def test_mypy_matches(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
default_branch=default_branch,
github_event=GithubEvents.PULL_REQUEST,
pr_labels=pr_labels,
@@ -1878,7 +1881,7 @@ def test_pr_labels(
):
stderr = SelectiveChecks(
files=files,
- commit_ref="HEAD",
+ commit_ref=NEUTRAL_COMMIT,
default_branch="main",
github_actor=github_actor,
github_event=GithubEvents.PULL_REQUEST,