Skip to content

[Tests] Modernize test gating#19777

Merged
tqchen merged 1 commit into
apache:mainfrom
tlopex:modernize-test-gating
Jun 15, 2026
Merged

[Tests] Modernize test gating#19777
tqchen merged 1 commit into
apache:mainfrom
tlopex:modernize-test-gating

Conversation

@tlopex

@tlopex tlopex commented Jun 15, 2026

Copy link
Copy Markdown
Member

This pr modernizes test gating. It replaces the heavy tvm.testing.Feature machinery with a thin tvm.testing.env module of has_*() capability probes, used via standard pytest.mark + skipif. And markers move to pyproject.toml

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the test gating mechanism by replacing the dynamic tvm.testing.Feature class with static pytest markers declared in pyproject.toml and thin capability probes in a new tvm.testing.env module. This change is propagated across the test suite, replacing decorators like @tvm.testing.requires_cuda with standard @pytest.mark.cuda and @pytest.mark.skipif combinations. The review feedback highlights two important robustness improvements in the new env.py module: explicitly checking has_cuda() in has_cuda_compute to prevent incorrect True returns when no CUDA device is present, and casting the build flag value to a string in _build_flag_enabled to avoid potential AttributeErrors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/tvm/testing/env.py
Comment thread python/tvm/testing/env.py Outdated
@tlopex tlopex force-pushed the modernize-test-gating branch from dbe8b4d to 369bad4 Compare June 15, 2026 06:34
@tlopex

tlopex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the test gating mechanism by introducing a new tvm.testing.env module containing memoized capability probes (has_* predicates). It removes the complex Feature class and its decorators from tvm.testing.utils, replacing them with standard pytest markers combined with @pytest.mark.skipif conditions. Numerous test files are updated to adopt this new idiom. Feedback on the changes points out that the GPU-only test scripts (task_python_integration_gpuonly.sh and task_python_unittest_gpuonly.sh) are missing several GPU-related markers (multi_gpu, OpenCLML, and adreno_opencl_real) in their -m filters, which would cause those tests to be incorrectly skipped.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/scripts/task_python_integration_gpuonly.sh Outdated
Comment thread tests/scripts/task_python_unittest_gpuonly.sh Outdated
@tlopex

tlopex commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@tvm-bot rerun

Comment thread pyproject.toml Outdated
@tlopex tlopex force-pushed the modernize-test-gating branch 4 times, most recently from 4ee28de to baaf00e Compare June 15, 2026 19:05
Replace the heavy tvm.testing.Feature machinery with a thin tvm.testing.env module of has_*() capability probes, used via standard @pytest.mark + skipif. Markers move to pyproject.toml. BREAKING: tvm.testing.requires_* / Feature are removed (requires_package kept).
@tlopex tlopex force-pushed the modernize-test-gating branch from baaf00e to e8b7457 Compare June 15, 2026 19:54
@tlopex tlopex requested a review from tqchen June 15, 2026 21:27
@tqchen tqchen merged commit e4da848 into apache:main Jun 15, 2026
9 checks passed
tqchen pushed a commit that referenced this pull request Jun 16, 2026
…9787)

This pr is the Follow-up to #19777. This pr removes the last
`requires_*` decorators so test gating is plain pytest everywhere, with
no custom indirection left.
MasterJH5574 pushed a commit that referenced this pull request Jun 16, 2026
This pr modernizes test gating. It replaces the heavy
`tvm.testing.Feature` machinery with a thin `tvm.testing.env` module of
`has_*()` capability probes, used via standard pytest.mark + skipif. And
markers move to `pyproject.toml`
MasterJH5574 pushed a commit that referenced this pull request Jun 16, 2026
…9787)

This pr is the Follow-up to #19777. This pr removes the last
`requires_*` decorators so test gating is plain pytest everywhere, with
no custom indirection left.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants