Repository navigation
fix: isolate Spack setup test from inherited Bash function - #1017
Conversation
|
| Layer / File(s) | Summary |
|---|---|
Clear inherited Spack function scripts/test/test_devcontainer_host.py |
The test runs unset -f spack before sourcing setup definitions. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Priority:
Change: Other
Possibly related issues
- Framework-R-D/phlex#995: This issue concerns test coverage and runtime requirements for the pre-commit hook; this change isolates one test run by removing an inherited
spackfunction.
Possibly related PRs
- Framework-R-D/phlex#975: This PR added the test and its missing-command coverage, which this change isolates from an inherited Bash function.
Suggested reviewers: greenc-fnal
Merge Risk: 
Minimal · previous review 10304
-
The focused test-environment change is ready to merge.
Pre-merge checks: 
4
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1017 +/- ##
==========================================
- Coverage 89.59% 88.87% -0.73%
==========================================
Files 177 189 +12
Lines 5949 7712 +1763
Branches 975 975
==========================================
+ Hits 5330 6854 +1524
- Misses 392 630 +238
- Partials 227 228 +1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
greenc-FNAL
left a comment
There was a problem hiding this comment.
This is OK as-is, but if the need for spack-clean init is inherent to the fixture, then the better-placed solution might be to put unset -f spack at the beginning of the fixture script.
|
@coderabbitai summary |
✅ Action performed
|
Remove the inherited
spack()function from the Spack setup test’s subprocess environment. This ensuresspackis unavailable as intended, even when tests run from a Bash-initialized Spack environment, where restrictingPATHalone is insufficient.Aided by GPT-6.1 Sol
unset -f spackbefore sourcing setup definitions. This prevents an inherited Bashspackfunction from bypassing the test’s restrictedPATHcheck.