summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-03-04 15:50:34 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-03-04 16:59:24 +0100
commit7bb2f466e91282335ae18a5290c70562020e2f6e (patch)
tree1eee37e2e0a099d956e9cc1f1e5b64ba88262e2b
parenta4d29661e978d28c4772db149014ca97d61507b4 (diff)
downloadbundler-7bb2f466e91282335ae18a5290c70562020e2f6e.tar.gz
Fix environment for "sudo specs"
Previously, sudo specs were running against system ruby, not against RVM ruby. We need to make sure `sudo` is always configured to preserve the path the `ruby`. This was previously done only for ruby 2.3, but needs to be done everywhere to ensure that the specs run against the correct ruby. Together with this change, I added a bare test to make sure that "sudo specs" run against the correct ruby.
-rw-r--r--.travis.yml6
1 files changed, 2 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 697b7bf2dd..3ea5cd76a2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,7 @@ language: ruby
dist: bionic
script:
- bin/parallel_rspec spec
+ - test "$(ruby -v)" = "$(sudo -E ruby -v)"
- sudo -E bin/rake spec:sudo
- sudo chown -R $(whoami) tmp
- BUNDLER_SPEC_PRE_RECORDED=1 bin/rake spec:realworld
@@ -13,10 +14,7 @@ before_script:
then
travis_retry sudo apt-get install graphviz -y;
fi
- - if [ "$TRAVIS_RUBY_VERSION" = "2.3.8" ];
- then
- sudo sed -i '/secure_path/d' /etc/sudoers;
- fi
+ sudo sed -i '/secure_path/d' /etc/sudoers;
branches:
only: