Skip to content

[TEST] Relocation test: close three ways it could pass without checking anything - #10195

Merged
timosachsenberg merged 2 commits into
developfrom
claude/busy-cannon-wuaufh
Sep 19, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/busy-cannon-wuaufh

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #10186 (the relocation test) from a review of it. No behaviour of OpenMS itself changes; this is all test scaffolding. Six findings, in two groups.

Three ways the relocation test could pass while checking nothing

  • The run-time check looked only at libOpenMS, although the configure-time half checks both imported targets. Each library is resolved by the loader in its own right, so an RPATH that sends libOpenSwathAlgo back to the build tree — which CMAKE_INSTALL_RPATH for a macOS build names outright — left the program printing success. It now checks both.
  • The library file names were hardcoded in C++ ("libOpenMS", "OpenMS"). They now come from $<TARGET_FILE_NAME:...> of the imported targets, so a SOVERSION, an OUTPUT_NAME or a debug postfix changes what is looked for along with what is built, instead of failing on Windows only with a message about a module that cannot be found.
  • Reporting no include directories was an empty loop rather than a failure. openms_package_include_dirs() from [FIX][TEST] Resolve the package's include directories before checking them #10192 returns an empty list for a target whose property is unset, and the loop below then checks nothing — which the build would not catch either, since the program includes no OpenSwathAlgo header.

Three in the test driver (_openms_add_installed_consumer_tests), which affect all three consumer chains:

  • An empty or omitted COMPONENTS silently produced a chain that installs nothing and then runs the consumer against whatever a previous run left in the prefix. set_tests_properties() on an empty list is a no-op, so nothing said so. It is rejected like any other bad argument now.
  • The prefix is emptied before every run of every chain, not only the relocating one. cmake --install --component only ever adds files, so a component dropped from COMPONENTS left the files of an earlier run behind — and since OpenMSConfig.cmake reports a layer from the presence of its target file, the consumer kept finding a layer the installation no longer installs.
  • The install steps of all chains take one resource lock. They install from the same build tree, where each cmake --install --component <c> writes install_manifest_<c>.txt, so concurrent installs interleave in that file and contend for throughput rather than gaining from it.

Verification

Built against system dependencies (Arrow 25, Boost 1.83, Xerces, CoinOR, libsvm, Eigen) with OPENMS_TEST_INSTALLED_CONSUMER=ON, on this branch:

  • ctest -L installed_consumer -j6 → 40/40 pass.
  • ctest -L installed_consumer -j6 wall time 18.2 s → 2.2 s with the resource lock, i.e. the lock removes contention rather than adding serialisation cost.

Each fix was also made to fail on purpose, so none of them is decorative:

check how it was made to fire
libOpenSwathAlgo loaded from elsewhere LD_LIBRARY_PATH holding only a build-tree libOpenSwathAlgo.so, libOpenMS still correct → exits 1 naming both paths
no include directories reported the real openms_package_include_dirs() against an imported target with none → FATAL_ERROR
include directory outside the prefix file-set BASE_DIRS repointed in the installed export → FATAL_ERROR
empty COMPONENTS both omitted and COMPONENTS "" → FATAL_ERROR
stale files in a prefix marker files planted in installed-consumer/prefix and prefix-core → gone after the run

One review finding is deliberately not here: the duplicated OPENMS_LIB_DIR/IMPORTED_LOCATION block between relocated/CMakeLists.txt and external/CMakeLists.txt. #10192 has since introduced openms_package_include_dirs.cmake as a shared helper for these projects, which is the natural home for that too, but it is a separate change.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01BbTygAEhdouMboSggp3etK


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Improved installed-consumer test isolation by cleaning installation destinations before each run and serializing shared installation checks.
    • Added validation that installation tests reject empty component configurations.
    • Expanded relocated-installation checks to verify include directories and accurately locate required OpenMS libraries.
    • Added validation that both core libraries are loaded from the expected installation directory.
    • Relocation tests now report the detected OpenMS version on success.

…ng anything

Review findings on #10186.

The run-time check looked only at libOpenMS, although the configure-time half
checks both imported targets. Each library is resolved by the loader in its own
right, so an RPATH that sends libOpenSwathAlgo back to the build tree -- which
the install RPATH of a macOS build names outright -- left the program printing
success. It now checks both, and takes their file names from
$<TARGET_FILE_NAME:...> of the imported targets instead of guessing "libOpenMS"
and "OpenMS" in C++, so a SOVERSION, an OUTPUT_NAME or a debug postfix changes
what is looked for along with what is built rather than failing on Windows only,
with a message about a module that cannot be found.

An unset INTERFACE_INCLUDE_DIRECTORIES was turned into an empty loop, so an
export that drops the install include interface skipped the assertions without a
word -- and the build step would not have caught it either, since the program
includes no OpenSwathAlgo header. It is a hard error now, like the neighbouring
IMPORTED_CONFIGURATIONS check.

In the test driver, an empty or omitted COMPONENTS silently produced a chain
that installs nothing and then runs the consumer against whatever a previous run
left in the prefix; it is rejected like any other bad argument. The prefix is now
emptied before every run of every chain rather than only the relocating one:
`cmake --install --component` only adds files, so a component dropped from
COMPONENTS left the files of an earlier run behind, and since OpenMSConfig.cmake
reports a layer from the presence of its target file, the consumer kept finding a
layer the installation no longer installs. Finally, the install steps of all
chains take one resource lock: they install from the same build tree, where each
`cmake --install --component <c>` writes install_manifest_<c>.txt, so concurrent
installs interleave in that file and contend for throughput instead of gaining
from it -- `ctest -L installed_consumer -j6` drops from 18.2 s to 2.2 s.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbTygAEhdouMboSggp3etK
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5b6fb0f8-92fc-4491-b52c-12138eef9894

📥 Commits

Reviewing files that changed from the base of the PR and between 159a733 and d3cf98b.

📒 Files selected for processing (3)
  • src/tests/CMakeLists.txt
  • src/tests/external/TestExternalCodeRelocated.cpp
  • src/tests/external/relocated/CMakeLists.txt

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Installed Test Validation

Layer / File(s) Summary
Consumer install cleanup and serialization
src/tests/CMakeLists.txt
Installed-consumer tests now clean the install paths before each run, reject empty COMPONENTS, and serialize component installs with a shared resource lock.
Relocated installation module checks
src/tests/external/relocated/CMakeLists.txt, src/tests/external/TestExternalCodeRelocated.cpp
The relocated-install test validates imported include directories and checks both core modules by their target-derived file names and resolved library paths.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to d3cf9

No actionable risk remains in the installed-consumer test changes; the PR is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies a test-only change that strengthens the relocation test by preventing false-positive passes. It accurately reflects the primary change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the paths at night
Two modules load and match just right
Clean fixtures clear the way
Locked installs keep order each day
The relocated test hops bright

Comment @coderabbitai help to get the list of available commands.

@timosachsenberg
timosachsenberg merged commit c67b0e3 into develop Sep 19, 2026
32 checks passed
@timosachsenberg
timosachsenberg deleted the claude/busy-cannon-wuaufh branch September 19, 2026 05:33
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