[rocprofiler-systems] Enhance PyTest and port more tests - #3158
Merged
Conversation
kcossett-amd
commented
Feb 10, 2026
kcossett-amd
commented
Feb 10, 2026
kcossett-amd
force-pushed
the
users/kcossett-amd/pytest-transfer
branch
from
February 10, 2026 20:17
5f6943a to
af00044
Compare
kcossett-amd
marked this pull request as ready for review
February 11, 2026 13:28
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates additional rocprofiler-systems CTest coverage into the PyTest-based harness and expands the PyTest infrastructure to support more modes (e.g., causal, python), richer environment/capability checks, and standalone execution.
Changes:
- Ported multiple existing tests to use the
RocprofsysTestbase class + unifiedrun_test/assertion helpers. - Added new PyTest modules for MPI/UCX/NIC/causal/python/code-coverage/etc. and expanded marker/CI/CTest integration in
conftest.py. - Improved validation + runner plumbing (regex handling, file regex validation, frozen/standalone Python selection, new runner types).
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/rocprofiler-systems/tests/pytest/test_videodecode.py | Refactors test to RocprofsysTest and parametrizes modes/rules. |
| projects/rocprofiler-systems/tests/pytest/test_user_api.py | Adds new user API tests across multiple modes. |
| projects/rocprofiler-systems/tests/pytest/test_units.py | Adds build-mode-only unit test runner. |
| projects/rocprofiler-systems/tests/pytest/test_ucx.py | Adds UCX/MPI transport tests with perfetto validation. |
| projects/rocprofiler-systems/tests/pytest/test_transpose.py | Large refactor to parametrized tests + MPI optional handling + ROCProfiler validation. |
| projects/rocprofiler-systems/tests/pytest/test_time_window.py | Refactors time window tests to shared mode-parametrized implementation. |
| projects/rocprofiler-systems/tests/pytest/test_thread_limit.py | Adds thread-limit stress tests with dynamic thread count selection. |
| projects/rocprofiler-systems/tests/pytest/test_roctx.py | Refactors ROCTx tests to RocprofsysTest and CI-disable markers. |
| projects/rocprofiler-systems/tests/pytest/test_rewrite_caller.py | Adds rewrite caller-include coverage. |
| projects/rocprofiler-systems/tests/pytest/test_rccl.py | Refactors RCCL tests with CI disable + mode parametrization. |
| projects/rocprofiler-systems/tests/pytest/test_python.py | Adds Python profiling tests (external/builtin/source/etc.). |
| projects/rocprofiler-systems/tests/pytest/test_pthread.py | Adds pthread lock/overhead tests across instrumentation modes. |
| projects/rocprofiler-systems/tests/pytest/test_presets.py | Adds preset smoke tests for sample/run binaries. |
| projects/rocprofiler-systems/tests/pytest/test_overflow.py | Adds sampling-overflow tests. |
| projects/rocprofiler-systems/tests/pytest/test_openmp.py | Refactors OpenMP tests and adds duration/no-tmp coverage. |
| projects/rocprofiler-systems/tests/pytest/test_nic_perf.py | Adds NIC counter/perfetto validation test using wget download workload. |
| projects/rocprofiler-systems/tests/pytest/test_mpi.py | Adds MPI + MPIP tests including perfetto merge validation. |
| projects/rocprofiler-systems/tests/pytest/test_lulesh.py | Adds lulesh Kokkos/perfetto/timemory coverage. |
| projects/rocprofiler-systems/tests/pytest/test_jpegdecode.py | Refactors test to RocprofsysTest and parametrizes modes/rules. |
| projects/rocprofiler-systems/tests/pytest/test_hip_stream.py | Adds group-by-queue/stream tests for HIP stream behavior. |
| projects/rocprofiler-systems/tests/pytest/test_gpu_connect.py | Refactors connectivity test and adds conditional skip logic. |
| projects/rocprofiler-systems/tests/pytest/test_fork.py | Adds fork-related tests across modes and GPU conditional target. |
| projects/rocprofiler-systems/tests/pytest/test_config.py | Refactors config failure tests to use config-file helper. |
| projects/rocprofiler-systems/tests/pytest/test_code_coverage.py | Adds code coverage tests + cross-test output reuse. |
| projects/rocprofiler-systems/tests/pytest/test_causal.py | Adds causal tests + end-to-end validation of causal JSON output. |
| projects/rocprofiler-systems/tests/pytest/test_binaries.py | Refactors binary CLI tests to RocprofsysTest and new markers. |
| projects/rocprofiler-systems/tests/pytest/test_attach.py | Adds attach test (CI disabled) using helper script. |
| projects/rocprofiler-systems/tests/pytest/test_annotate.py | Adds annotate-mode tests with PAPI conditional perfetto checks. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/validators.py | Adds file-regex validation + frozen-safe Python selection + JSON arg fix. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/runners.py | Improves runner robustness, adds CausalRunner/PythonRunner, stdin handling. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py | Disables GPU detection when ROCPROFSYS_USE_ROCM=OFF. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/config.py | Adds capabilities + python discovery + better executable discovery. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/capabilities.py | New system capability probing for conditional skips/markers. |
| projects/rocprofiler-systems/tests/pytest/rocprofsys/init.py | Exposes new runners/validators. |
| projects/rocprofiler-systems/tests/pytest/conftest.py | Major harness expansion: modes, markers, CTest integration, helpers, base test class. |
| projects/rocprofiler-systems/tests/pytest/build_standalone.sh | Updates standalone build to PyInstaller + bundled plugins/deps. |
| projects/rocprofiler-systems/tests/pytest/README.md | Documents xdist loadgroup usage + new flags and standalone constraints. |
| projects/rocprofiler-systems/tests/pytest/CMakeLists.txt | Installs pytest package files including new capabilities module and builds standalone exe. |
| projects/rocprofiler-systems/tests/CMakeLists.txt | Builds/installs capability checker binary for PyTest-based system probing. |
| projects/rocprofiler-systems/examples/fork/CMakeLists.txt | Adjusts HIP fork example output directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add option to print config then exit (for CTests) - Add support for ROCPROFSYS_USE_ROCM=OFF - Rename disable marker to ci_disable to make it clear it is for --ci-mode only - Add gpu mark to rccl tests - Fix bug with gpu marker - Remove pytest-order - Fix discovery of python scripts used for tests
- config.py - Add ROCPROFSYS_CI=ON to get_base_python_environment() - Add ROCPROFSYS_CI_TIMEOUT to each base environment - Add get_base_causal_environment - Adjust doc strings - get_base_environment() now uses ROCPROFSYS_LOG_LEVEL="trace" - capabilities.py - Add missing timeouts and adjust them all to 10 - Search stderr for fail regex in ucx_availability() - Add missing OMPI env to ucx_availabilty() - Refactor mpi_implementation() to reduce code duplication - runners.py - All runners now pass in a respective base environment to the BaseRunner class - conftest.py - Remove duplicate MPI label from generic_functional_markers - Add functional markers (python) - Use snake case - Rework collect_output_path() (Added OutputPathStore class) - Remove Optional from cond in add_marker_if() - test_presents.py - Make PRESETS a module level variable to reduce code duplication - test_causal.py - Adjust causal_env() to account for get_base_causal_environment() - test_binaries.py - Fix typo - test_code_coverage.py - Adjust code to account for changes in collect_output_path() - test_lulesh.py, test_rccl.py, test_python.py - Fix module doc string - test_time_window.py, test_thread_limit.py, test_openmp.py - Remove deprecated env vars - test_ucx.py - Adjust PASS and FAIL regexes - Remove deprecated env vars
- Rework ci_disable marker. Now use ci_enable to selet tests in --ci-mode. This can be overrided using ci_disable("all") or ci_disable(<assert name>)
- Only the tests that were already running in CI before this PR will have ci_enable. Future tests will be enabled incrementally so as to not block this PR.
kcossett-amd
force-pushed
the
users/kcossett-amd/pytest-transfer
branch
from
February 19, 2026 12:15
097d0d2 to
f29ec67
Compare
Contributor
Author
|
Verifying PR does not break existing tests on TheRock |
Contributor
Author
|
Enabled tests pass on TheRock: https://github.com/ROCm/TheRock/actions/runs/22230038737/job/64319819866?pr=3537 |
This was referenced Feb 22, 2026
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.
Motivation
Add more logic to pytest to handle CI, extra markers, detection of runtime capabilities and to port more CTests
To build:
To run:
If running with
pytest-xdist(i.e. using-n <nprocs>), you MUST specify--dist=loadgroup.Technical Details
Note: At some point down the line, CTests will eventually call PyTests. This will come in a future PR.
JIRA ID
Test Plan
Tested Locally. RCCL Tests fail but they also fail for CTests.
NOTE!!!!: No new tests will run in
--ci-mode.Test Result
Submission Checklist