-
Notifications
You must be signed in to change notification settings - Fork 115
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
Explicitly panic (so test actually fails) if we cannot run it #821
Conversation
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
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 was intended; in CI it panics but for local dev it does not so you don't have to run these tests. Basically equivalent to t.Skip
.
Maybe t.Skip
is not the best path here though? WDYT? The intent was to make cargo test
actually just work without requiring hoops
I don't think it's great local UX - without the panic, the following is the result when these tests (which are actually failing for me locally in a branch when run as root) are run "normally":
They fail as root, because they're actually running as root. But it's not clear at all from the output here that they aren't being run at all when I'm not running as root. I'd rather them fail explicitly if they cannot be run. |
Yeah it will at least never pass CI though. If you If we do this should we at least put |
That's fine - if it says Apparently
We are already setting this with the |
Yeah, rust doesn't support this :-(
Sure, but I think its a pretty good property to run |
or at the very least maybe we can explain in the error how to set CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER/equivilent |
I also note that the Do we not add the I'll see if I can fix that, I'm a bit hesitant to auto-sudo test runs without that. |
Ah didn't know that, I have passwordless sudo on my host and don't use the build container. Good catch |
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
Aight I settled on if
I still think we shouldn't have unit tests that run as root and would rather mock OS deps or move these to integ tests, they by definition aren't unit tests if they require root privs IMO - but that's another discussion. |
2de93be
to
c599967
Compare
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
c599967
to
94db661
Compare
Signed-off-by: Benjamin Leggett <benjamin.leggett@solo.io>
#962 just drops the root req, so this is no longer needed |
eprintln
doesn't actually fail the test in localcargo test
runs - resulting in the test "silently" being skipped, which is not great if it would actually fail in the required environment.