Simple fix for running specs as root. #2061

Merged
merged 1 commit into from Aug 16, 2012

3 participants

@Flameeyes

This test would fail on default Gentoo installs as the package is
executed as root.

@Flameeyes Flameeyes spec: do not check for /usr/bin not to be writable when running as root.
This test would fail on default Gentoo installs as the package is
executed as root.
433b4bc
@travisbot

This pull request fails (merged 433b4bc into 3a1121a).

@Flameeyes

Uhm I think travisbot is wrong, given that error reported is:

Error: #<NativeException: org.virtualbox_4_1.VBoxException: The function "powerDown" returned an error condition: "The virtual machine is being powered down"  (0x80bb0002)>
@indirect
Bundler member

Um... the tests also fail if they are run outside a git repo. Does gentoo run the package tests from inside a git repo?

@Flameeyes

We have workarounds for those — I didn't want to submit those just yet, but this one seems to be valid anyway: it's just avoiding a non-writeable check, that would then always fail, when running as root.

@indirect
Bundler member

Is the "fix" to just disable all tests that depend on being inside a git repo when the tests run? Either way, I'd be interested in a pull with those changes. A subset of the tests that pass would be an improvement over tests that can't pass from inside an installed gem.

As for this test, it seems okay. I personally would be terrified of running any test suite as root, though. :P

@indirect indirect merged commit d97ada4 into bundler:master Aug 16, 2012
@Flameeyes

Not really a fix, yes I think it's disabling quite a few of the git tests, and I agree, a subset passing is better than not being able to run them. I'll try to put them in shape to be merged (right now they are unconditional).

As for running as root, we're moving toward a default of not doing so but.. a number of packages actually expect root :( Luckily we use a pre-loaded library to sandbox the execution, so it's "safe enough".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment