Skip to content

[rocprofiler-compute] Enable running tests from installation only for TheRock setup#2067

Merged
vedithal-amd merged 5 commits intodevelopfrom
users/vedithal/rocprofiler-compute-cmake
Dec 4, 2025
Merged

[rocprofiler-compute] Enable running tests from installation only for TheRock setup#2067
vedithal-amd merged 5 commits intodevelopfrom
users/vedithal/rocprofiler-compute-cmake

Conversation

@vedithal-amd
Copy link
Copy Markdown
Contributor

@vedithal-amd vedithal-amd commented Nov 27, 2025

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

    • 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

  • 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

* 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_INSTALL CMake 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.

Comment thread projects/rocprofiler-compute/CMakeLists.txt
Comment thread projects/rocprofiler-compute/tests/conftest.py
Comment thread projects/rocprofiler-compute/tests/conftest.py
* 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
Copy link
Copy Markdown
Collaborator

@jbonnell-amd jbonnell-amd left a comment

Choose a reason for hiding this comment

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

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.

@vedithal-amd vedithal-amd merged commit 7a2df64 into develop Dec 4, 2025
29 of 30 checks passed
@vedithal-amd vedithal-amd deleted the users/vedithal/rocprofiler-compute-cmake branch December 4, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants