Repository navigation
[TEST] Add RWrapper_test covering graceful handling when Rscript is absent (#9460) - #9538
Conversation
…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]>
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@timosachsenberg The following names might be missing from the
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 |
What
Adds the missing
RWrapper_test(and registers it inexecutables.cmake).RWrapperis theboost::process-basedRscriptdriver from theQProcess → boost::processmigration; 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::processprocess_erroris 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'sFileNotFoundis swallowed into a cleanfalse);Rscriptis on PATH, a missing script still returnsfalse— skipped whereRscriptis 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):I read the implementation to assert the exact behavior:
findR/runScriptcatchboost::process::process_errorandfindScript's exception and returnfalse; onlyfindScriptpropagatesFileNotFound. 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 onfindR()like other tool-gated OpenMS tests.Test plan
Tests only — no production code changed. Verified locally (Rscript not installed):
-fsyntax-onlyclean, CMake reconfigure to register the new target, full build green, test runs PASSED — every graceful-absence path returnsfalse/FileNotFoundwith 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