-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testsuite: don't assume /bin/true and /bin/false #6507
Conversation
Would going with
like Maybe it's just me. |
Problem: tests that hard code /bin/true or /bin/false fail on macos, where those programs are in /usr/bin. When PATH is already being searched, don't specify a fully qualfied path.
Problen: the stats-basic test runs 'flux start true sleep 1'. Drop the 'sleep 1'.
930c327
to
cd2ef59
Compare
Oops, pushed a fix to the ASAN error - I inadvertently changed a string length in the broker runat test without changing another value that was supposed to be its length + 1.
That would probably work although I think it's pretty clear what's going on in these tests. I'd be inclined to not continue to hard code a path - it feels slightly wrong. |
By all means, it certainly livable. Just something I noticed at first glance. |
Maybe we ought to get @grondo's input on that one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach seems fine to me. To be fair, we have some other paths we hard code in the testsuite including /bin/sh
, /bin/bash
, and /bin/echo
. I'm guessing those are ok because they exist in those paths on macos?
One idle thought: Since use of I'm actually fine either way, maybe we won't end up re-introducing these errors. (the larger point being it is slightly preferred to add a check for an issue when fixing that issue so some lame future committer (likely me) doesn't re-break what has already been fixed) |
These are all test changes, so I think the rule of "add a test when you fix something" probably doesn't apply or at least not as strongly. And the person who finally gets macos/bsd to run all the tests may have to fix whatever pops up between now and then, but I think that'll be the least of their worries. If we do it now, then at least they will have a lesser job, and the cut and pasters won't make the problem worse. |
Yeah, the problem is "fails on macos" and I wanted to keep the solution focused on that. I'm seeing thumbs up and this is approved so I'll go ahead and set MWP. Thanks! |
I figured. My point was it went against the "it's wrong to hard code a path" argument made previously in the comments. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6507 +/- ##
===========================================
+ Coverage 53.72% 83.64% +29.91%
===========================================
Files 475 525 +50
Lines 79573 87693 +8120
===========================================
+ Hits 42751 73350 +30599
+ Misses 36822 14343 -22479 |
Problem: tests that hard code
/bin/true
or/bin/false
fail on macos, where those programs are in/usr/bin
.When PATH is already being searched, don't specify a fully qualfied path.