Skip to content

[TEST] Add RWrapper_test covering graceful handling when Rscript is absent (#9460) - #9538

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-rwrapper-test
Jun 17, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/9460-rwrapper-test

Conversation

@timosachsenberg

Copy link
Copy Markdown
Contributor

What

Adds the missing RWrapper_test (and registers it in executables.cmake). RWrapper is the boost::process-based Rscript driver from the QProcess → boost::process migration; it had no class test.

The test pins the graceful-degradation contract callers depend on — a missing interpreter or missing script must surface as false / FileNotFound, never an uncaught exception or crash:

  • findR("<bogus>") → false, no throw (boost::process process_error is caught internally);
  • findR("Rscript") → a clean bool either way — the "is R available?" probe used to skip optional R steps;
  • findScript("<missing>.R") → Exception::FileNotFound (the only RWrapper method that throws);
  • runScript(find_R=true, "<bogus R>") → false (R not found);
  • runScript("<missing script>") → false (findScript's FileNotFound is swallowed into a clean false);
  • guarded R-present block: when Rscript is on PATH, a missing script still returns false — skipped where Rscript is absent (the "skip if Rscript absent" behavior).

Why

Closes the §1 (Qt removal: QProcess → boost::process) [AUTO] task in the OpenMS 3.6.0 pre-release testing plan (#9460):

Add RWrapper_test.cpp (findR/runScript), skipped if Rscript absent. Pass: R found → script runs; R absent → test skips cleanly.

I read the implementation to assert the exact behavior: findR/runScript catch boost::process::process_error and findScript's exception and return false; only findScript propagates FileNotFound. The non-guarded paths are deterministic and need no R installed, so the "R absent → skips cleanly" criterion is verified directly; the R-present path is gated on findR() like other tool-gated OpenMS tests.

Test plan

Tests only — no production code changed. Verified locally (Rscript not installed): -fsyntax-only clean, CMake reconfigure to register the new target, full build green, test runs PASSED — every graceful-absence path returns false/FileNotFound with no escaping exception; the R-present block is skipped.

Part of #9460. Follows #9524, #9525, #9526, #9528, #9530, #9531, #9532, #9533, #9534, #9535, #9536, #9537.

🤖 Generated with Claude Code

…bsent (OpenMS#9460)

RWrapper (the boost::process-based 'Rscript' driver, part of the QProcess ->
boost::process migration) had no class test. Adds one pinning the
graceful-degradation contract -- a missing interpreter or missing script must be
reported as false / FileNotFound, never an uncaught exception or crash:

- findR("<bogus>")            -> false, no throw (process_error caught internally)
- findR("Rscript")           -> clean bool either way (the "is R available?" probe)
- findScript("<missing>.R")  -> throws Exception::FileNotFound (the only throwing method)
- runScript(find_R, "<bogus R>")    -> false (R not found)
- runScript("<missing script>")     -> false (findScript's FileNotFound swallowed)
- if Rscript present: a missing script still returns false (guarded block, skipped
  when Rscript is absent -- the "skip if Rscript absent" behavior)

All non-guarded paths are deterministic and need no R installed. Registered in
executables.cmake (system_executables_list).

Verified: builds clean and the test runs PASSED (R-absent path; R-present block
skipped where Rscript is not installed).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@timosachsenberg, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 48 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc2d17fe-f0ca-4b7d-a311-aa3ac0f3e93b

📥 Commits

Reviewing files that changed from the base of the PR and between aacd941 and 7d0cc6f.

📒 Files selected for processing (2)
  • src/tests/class_tests/openms/executables.cmake
  • src/tests/class_tests/openms/source/RWrapper_test.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Timo Sachsenberg

Please consider applying the following patch:

--- AUTHORS	2026-06-15 16:57:27.677444877 +0000
+++ AUTHORS.new	2026-06-15 16:57:32.881373355 +0000
@@ -23,8 +23,8 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

@timosachsenberg
timosachsenberg merged commit 680210d into OpenMS:develop Jun 17, 2026
41 checks passed
@timosachsenberg timosachsenberg mentioned this pull request Jun 17, 2026
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.

1 participant