Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 321
[scripts] Adding run_tests.sh script#953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ed3236a99646dd1dc7cc4ae1deba94e362f421ca99e777b66e0c8856b3c761a275009cb034f63141881d8b5ae536c32a0b08330134dd2fac846c5c7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| import os | ||
| import pytest | ||
| def pytest_collection_modifyitems(config, items): | ||
| cuda_home = os.environ.get("CUDA_HOME") | ||
| for item in items: | ||
| nodeid = item.nodeid.replace("\\", "/") | ||
| # Package markers by path | ||
| if ( | ||
| nodeid.startswith("cuda_pathfinder/tests/") | ||
| or "/cuda_pathfinder/tests/" in nodeid | ||
| ): | ||
| item.add_marker(pytest.mark.pathfinder) | ||
| if ( | ||
| nodeid.startswith("cuda_bindings/tests/") | ||
| or "/cuda_bindings/tests/" in nodeid | ||
| ): | ||
| item.add_marker(pytest.mark.bindings) | ||
| if nodeid.startswith("cuda_core/tests/") or "/cuda_core/tests/" in nodeid: | ||
| item.add_marker(pytest.mark.core) | ||
| # Smoke tests | ||
| if nodeid.startswith("tests/integration/") or "/tests/integration/" in nodeid: | ||
| item.add_marker(pytest.mark.smoke) | ||
| # Cython tests (any tests/cython subtree) | ||
| if ( | ||
| "/tests/cython/" in nodeid | ||
| or nodeid.endswith("/tests/cython") | ||
| or ("/cython/" in nodeid and "/tests/" in nodeid) | ||
| ): | ||
| item.add_marker(pytest.mark.cython) | ||
| # Gate core cython tests on CUDA_HOME | ||
| if "core" in item.keywords and not cuda_home: | ||
| item.add_marker( | ||
| pytest.mark.skip( | ||
| reason="CUDA_HOME not set; skipping core cython tests" | ||
| ) | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -16,6 +16,12 @@ To run these tests: | ||
| * `python -m pytest tests/` with editable installations | ||
| * `pytest tests/` with installed packages | ||
| Alternatively, from the repository root you can use a simple script: | ||
rparolin marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| * `./scripts/run_tests.sh core` to run only `cuda_core` tests | ||
| * `./scripts/run_tests.sh` to run all package tests (pathfinder → bindings → core) | ||
| * `./scripts/run_tests.sh smoke` to run meta-level smoke tests under `tests/integration` | ||
| ### Cython Unit Tests | ||
| Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [those of cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,13 +9,6 @@ def pytest_configure(config): | ||
| config.custom_info = [] | ||
| def pytest_terminal_summary(terminalreporter, exitstatus, config): # noqa: ARG001 | ||
rparolin marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if config.custom_info: | ||
| terminalreporter.write_sep("=", "INFO summary") | ||
| for msg in config.custom_info: | ||
| terminalreporter.line(f"INFO {msg}") | ||
| @pytest.fixture | ||
| def info_summary_append(request): | ||
| def _append(message): | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| [pytest] | ||
| testpaths = | ||
| cuda_pathfinder/tests | ||
| cuda_bindings/tests | ||
| cuda_core/tests | ||
| tests/integration | ||
| markers = | ||
| pathfinder: tests for cuda_pathfinder | ||
| bindings: tests for cuda_bindings | ||
| core: tests for cuda_core | ||
| cython: cython tests | ||
| smoke: meta-level smoke tests |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.