meel-ayush commented on code in PR #77119:
URL: https://github.com/apache/airflow/pull/77119#discussion_r4581975298
##########
dev/breeze/tests/test_selective_checks.py:
##########
@@ -6426,3 +6426,83 @@ def
test_provider_compatibility_tests_skip_only_changes_hidden_from_them(
)
assert checks.skip_providers_tests is False
assert checks.run_providers_compatibility_tests is expected
+
+
[email protected](
+ ("files", "pr_labels", "expected"),
+ [
+ pytest.param(
+ ("airflow-core/src/airflow/models/dag.py",),
+ (),
+ False,
+ id="unit-test-only-skips-system-tests",
+ ),
+ pytest.param(
+ ("airflow-core/tests/system/example_dag.py",),
+ (),
+ True,
+ id="core-system-test-runs-system-tests",
+ ),
+ pytest.param(
+ ("providers/standard/tests/system/example_standard.py",),
+ (),
+ True,
+ id="provider-system-test-runs-system-tests",
+ ),
+ pytest.param(
+ ("airflow-core/src/airflow/models/dag.py",),
+ ("full tests needed",),
+ True,
+ id="full-tests-runs-system-tests",
+ ),
+ ],
+)
+def test_run_system_tests_gating(files: tuple[str, ...], pr_labels: tuple[str,
...], expected: bool):
+ checks = SelectiveChecks(
+ files=files,
+ commit_ref=NEUTRAL_COMMIT,
+ github_event=GithubEvents.PULL_REQUEST,
+ pr_labels=pr_labels,
+ default_branch="main",
+ )
+ assert checks.run_system_tests is expected
+
+
[email protected](
+ ("files", "expected"),
+ [
+ pytest.param(
+ ("README.md",),
+ False,
+ id="markdown-only-skips-generic-basic-tests",
+ ),
+ pytest.param(
+ ("docs/apache-airflow/index.rst",),
+ False,
+ id="docs-only-skips-generic-basic-tests",
+ ),
+ pytest.param(
+ ("airflow-core/src/airflow/models/dag.py",),
+ True,
+ id="core-code-runs-generic-basic-tests",
+ ),
+ ],
+)
+def test_run_generic_basic_tests_gating(files: tuple[str, ...], expected:
bool):
+ checks = SelectiveChecks(
+ files=files,
+ commit_ref=NEUTRAL_COMMIT,
+ github_event=GithubEvents.PULL_REQUEST,
+ default_branch="main",
+ )
+ assert checks.run_generic_basic_tests is expected
+
+
+def test_has_added_or_renamed_files_neutral_commit():
Review Comment:
Added all parametrized test cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]