[rocprofiler-compute] Enable running tests from installation only for TheRock setup#2067
Merged
vedithal-amd merged 5 commits intodevelopfrom Dec 4, 2025
Merged
Conversation
* Use cmake option -DTEST_FROM_INSTALL=ON to enable running tests from installation folder only
* It is not possible to run tests from build folder in this case
* This option prevents changing working directory to source folder
* Fix SourceFileLoader to import rocprof-compute main module correctly
* Install sample executables in the test folder
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables running tests from the installation directory for TheRock setups by introducing a new CMake option TEST_FROM_INSTALL. When enabled, tests can run independently from the installation folder without requiring access to the project source folder.
Key Changes:
- Introduced
TEST_FROM_INSTALLCMake option to control test execution directory - Fixed module loading logic in test configuration to support both source and install paths
- Installed test executable binaries to make them available in the test installation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/rocprofiler-compute/CMakeLists.txt | Added TEST_FROM_INSTALL option, updated test commands to use relative paths with conditional working directory, and installed test executables |
| projects/rocprofiler-compute/tests/conftest.py | Added fallback logic to load rocprof-compute module from both source and install locations |
| projects/rocprofiler-compute/tests/test_gpu_specs.py | Removed unused SourceFileLoader import and rocprof_compute module loading |
| projects/rocprofiler-compute/tests/test_TCP_counters.py | Removed unused SourceFileLoader import and rocprof_compute module loading |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
jbonnell-amd
approved these changes
Dec 3, 2025
Collaborator
jbonnell-amd
left a comment
There was a problem hiding this comment.
This seems to have resolved most of the issues when running tests off a local TheRock build.
test_profile_live_attach_detach still seems a bit flaky for me, but we could disable the test on TheRock if needed.
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
TheRock setup requires ability to run tests from install folder only without any dependence on project source folder.
New cmake option -DTEST_FROM_INSTALL=ON can be provided to support this use case.
NOTE: If this option is provided it will not be possible to run tests from build folder since changing directory to project source will be disabled and the build folder does not contain the source files.
Technical Details
Use cmake option -DTEST_FROM_INSTALL=ON to enable running tests from installation folder only
Fix SourceFileLoader to import rocprof-compute main module correctly
Install sample executables in the test folder
Skip autogen. config. test and add a TODO task for re-design of this test
Add flexible import of source code in test_gpu_specs.py
Update cmake to install tests/workloads folder when INSTALL_TESTS=ON
Reduce workload duration for live attach detach from 10 seconds to 1 second
PR to add rocprofiler-compute tests to TheRock setup Add tests for rocprofiler-compute TheRock#2300
Test Plan
Run tests from installation folder and ensure pass
Test Result
Tests passing
Submission Checklist