Fix excluded provider tests crashing pytest#63918
Merged
potiuk merged 1 commit intoapache:mainfrom Mar 19, 2026
Merged
Conversation
When running provider tests (e.g., Providers[google]) on a Python version where the provider is excluded, generate_args_for_pytest removes the test directories but the skip check in _run_test only triggers when its own --ignore filter removes something. Since the directories are already gone, pytest runs with zero test directories and crashes on unrecognized custom arguments like --run-db-tests-only. Add are_all_test_paths_excluded() that explicitly checks whether all test paths for the given test type are in the excluded/suspended provider set, using the same provider.yaml data. Call it early in _run_test to skip before any Docker operations.
Collaborator
Author
|
@wjddn279 Could you please take a look? |
potiuk
approved these changes
Mar 19, 2026
Backport failed to create: v3-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker bc78841 v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
fat-catTW
pushed a commit
to fat-catTW/airflow
that referenced
this pull request
Mar 22, 2026
When running provider tests (e.g., Providers[google]) on a Python version where the provider is excluded, generate_args_for_pytest removes the test directories but the skip check in _run_test only triggers when its own --ignore filter removes something. Since the directories are already gone, pytest runs with zero test directories and crashes on unrecognized custom arguments like --run-db-tests-only. Add are_all_test_paths_excluded() that explicitly checks whether all test paths for the given test type are in the excluded/suspended provider set, using the same provider.yaml data. Call it early in _run_test to skip before any Docker operations.
Suraj-kumar00
pushed a commit
to Suraj-kumar00/airflow
that referenced
this pull request
Apr 7, 2026
When running provider tests (e.g., Providers[google]) on a Python version where the provider is excluded, generate_args_for_pytest removes the test directories but the skip check in _run_test only triggers when its own --ignore filter removes something. Since the directories are already gone, pytest runs with zero test directories and crashes on unrecognized custom arguments like --run-db-tests-only. Add are_all_test_paths_excluded() that explicitly checks whether all test paths for the given test type are in the excluded/suspended provider set, using the same provider.yaml data. Call it early in _run_test to skip before any Docker operations.
abhijeets25012-tech
pushed a commit
to abhijeets25012-tech/airflow
that referenced
this pull request
Apr 9, 2026
When running provider tests (e.g., Providers[google]) on a Python version where the provider is excluded, generate_args_for_pytest removes the test directories but the skip check in _run_test only triggers when its own --ignore filter removes something. Since the directories are already gone, pytest runs with zero test directories and crashes on unrecognized custom arguments like --run-db-tests-only. Add are_all_test_paths_excluded() that explicitly checks whether all test paths for the given test type are in the excluded/suspended provider set, using the same provider.yaml data. Call it early in _run_test to skip before any Docker operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related: #63793, #63870
Summary
test_type="None"so the earlier skip regression does not come back.Details
#63793fixed one failure mode for Python-version-excluded providers by skipping when pytest ended up with no test directories.#63870then reverted that broader filtering because it also skipped validtest_type="None"runs where users passed explicit test paths.This change keeps the skip, but moves the decision earlier and makes it specific to provider exclusion data. A new
are_all_test_paths_excluded()helper checks the test directories implied by the selected provider test type against the excluded and suspended provider sets. When every generated path is excluded for the current Python version,_run_testnow returns a skip result immediately, before any Docker cleanup ordocker compose runcalls.Because the new check only applies to generated provider test paths, explicit pytest path invocations still run normally. The added Breeze tests cover the full-exclusion skip path, the partial-exclusion path, and the
test_type="None"regression case from#63870.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.6 following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.