Skip to content

[v3-1-test] Fix test infrastructure for Python-version-excluded providers (#63793)#63834

Draft
github-actions[bot] wants to merge 1 commit intov3-1-testfrom
backport-48ec002-v3-1-test
Draft

[v3-1-test] Fix test infrastructure for Python-version-excluded providers (#63793)#63834
github-actions[bot] wants to merge 1 commit intov3-1-testfrom
backport-48ec002-v3-1-test

Conversation

@github-actions
Copy link

  • Skip provider tests when all test directories are excluded

When running Providers[google] or Providers[amazon] on Python 3.14,
generate_args_for_pytest removes the test folders for excluded
providers, but the skip check in _run_test only triggered when the
--ignore filter itself removed something. Since the folders were
already removed upstream, the guard condition was never met, leaving
pytest with only flags and no test directories — causing it to crash
on unrecognized custom arguments.

Remove the overly strict guard so the skip fires whenever no test
directories remain in the args.

  • Fix PROD image docker tests for Python-version-excluded providers

The docker tests expected all providers from prod_image_installed_providers.txt
to be present, but providers like google and amazon declare
excluded-python-versions in their provider.yaml. On Python 3.14, these
providers are correctly excluded from the PROD image at build time, but
the tests didn't account for this.

Read provider.yaml exclusions and filter expected providers/imports based
on the Docker image's Python version.

  • Skip Python-incompatible provider wheels during PROD image build

get_distribution_specs.py now reads Requires-Python metadata from each
wheel and skips wheels that are incompatible with the running
interpreter. This prevents excluded providers (e.g. amazon on 3.14)
from being passed to pip/uv and installed despite their exclusion.

Also fix the requires-python specifier generation in packages.py:
!=3.14 per PEP 440 only excludes 3.14.0, not 3.14.2. Use !=3.14.*
wildcard to exclude the entire minor version.
(cherry picked from commit 48ec002)

Co-authored-by: Dev-iL 6509619+Dev-iL@users.noreply.github.com

…ders (#63793)

* Skip provider tests when all test directories are excluded

When running Providers[google] or Providers[amazon] on Python 3.14,
generate_args_for_pytest removes the test folders for excluded
providers, but the skip check in _run_test only triggered when the
--ignore filter itself removed something. Since the folders were
already removed upstream, the guard condition was never met, leaving
pytest with only flags and no test directories — causing it to crash
on unrecognized custom arguments.

Remove the overly strict guard so the skip fires whenever no test
directories remain in the args.

* Fix PROD image docker tests for Python-version-excluded providers

The docker tests expected all providers from prod_image_installed_providers.txt
to be present, but providers like google and amazon declare
excluded-python-versions in their provider.yaml. On Python 3.14, these
providers are correctly excluded from the PROD image at build time, but
the tests didn't account for this.

Read provider.yaml exclusions and filter expected providers/imports based
on the Docker image's Python version.

* Skip Python-incompatible provider wheels during PROD image build

get_distribution_specs.py now reads Requires-Python metadata from each
wheel and skips wheels that are incompatible with the running
interpreter. This prevents excluded providers (e.g. amazon on 3.14)
from being passed to pip/uv and installed despite their exclusion.

Also fix the requires-python specifier generation in packages.py:
!=3.14 per PEP 440 only excludes 3.14.0, not 3.14.2. Use !=3.14.*
wildcard to exclude the entire minor version.
(cherry picked from commit 48ec002)

Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
@boring-cyborg boring-cyborg bot added area:dev-tools area:docker-tests area:production-image Production image improvements and fixes backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:docker-tests area:production-image Production image improvements and fixes backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant