Skip to content

Loading…

make tests pass under travis. #1891

Merged
merged 1 commit into from

5 participants

@echohead

sudo tests were failing under travis because they were not
being run as root. this change runs the root tests as root,
and chowns the tests' "tmp" directory back to the original
user to allow the subsequent 'realworld' tests to pass.

@echohead echohead make tests pass under travis.
sudo tests were failing under travis because they were not
being run as root.  this change runs the root tests as root,
and chowns the tests' "tmp" directory back to the original
user to allow the subsequent 'realworld' tests to pass.
f34f86a
@travisbot

This pull request passes (merged f34f86a into 52abb77).

@joshk

i can say that this was bug hunted for ages, and you seem to have found the solution. @indirect, @hone is this for realz?

@echohead

Key is the "sudo -E", which preserves the vagrant user's environment, as vagrant has rvm sourced into its environment, while root does not.

@hone hone merged commit f34f86a into bundler:master
@indirect
Bundler member

heyyy how about that. that makes me suspect that when sudo chmod did not work, it was because we needed sudo -E chmod. Thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 2, 2012
  1. @echohead

    make tests pass under travis.

    echohead committed
    sudo tests were failing under travis because they were not
    being run as root.  this change runs the root tests as root,
    and chowns the tests' "tmp" directory back to the original
    user to allow the subsequent 'realworld' tests to pass.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 Rakefile
View
7 Rakefile
@@ -12,6 +12,10 @@ rescue
false
end
+def sudo_task(task)
+ system("sudo -E rake #{task}")
+end
+
namespace :spec do
desc "Ensure spec dependencies are installed"
task :deps do
@@ -117,7 +121,8 @@ begin
Rake::Task["spec:rubygems:#{rg}"].reenable
puts "\n\e[1;33m[Travis CI] Running bundler sudo specs against rubygems #{rg}\e[m\n\n"
- sudos = safe_task { Rake::Task["spec:rubygems:#{rg}:sudo"].invoke }
+ sudos = sudo_task "spec:rubygems:#{rg}:sudo"
+ chown = system("sudo chown -R #{ENV['USER']} #{File.join(File.dirname(__FILE__), 'tmp')}")
Rake::Task["spec:rubygems:#{rg}"].reenable
Something went wrong with that request. Please try again.