Skip to content

Commit

Permalink
Upgrade rubygems in CI
Browse files Browse the repository at this point in the history
We want to use rubygems versions that keep requirements as originally
specified instead of sorting them, since it's the behavior of the most
recent rubygems. So we revert commit
5efae43 that first changed the
expectation to "sorted requirements".

Because of the revert, we need to make sure we test against rubygems
versions that don't sort requirements. That means either versions higher
than 3.1.0.pre1, because they include [the change where sorting was
reverted](rubygems/rubygems@f2d9517),
or versions lower than 2.7.8, because they don't include [the change
where the sorting was first
introduced](rubygems/rubygems@8ce0598).

So, since the latest rubygems doesn't support old rubies, install 2.7.7
in the case of ruby 2.0.0, and the latest rubygems otherwise.
  • Loading branch information
deivid-rodriguez committed May 21, 2020
1 parent 28da1b7 commit d42b00a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ env:
- LANG="en_US.UTF-8"

install:
- gem update --system 2.7.10
- if [ "$TRAVIS_RUBY_VERSION" = "2.0.0" ]; then
gem update --system 2.7.7;
else
gem update --system 3.1.3;
fi

- gem install bundler -v "~> 1.17"
- rake bootstrap

Expand Down
4 changes: 2 additions & 2 deletions spec/resolver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def self.save!(path, name, index, requirements, resolved)
Unable to satisfy the following requirements:
- `json (>= 1.7.7)` required by `berkshelf (2.0.7)`
- `json (>= 1.4.4, <= 1.7.7)` required by `chef (10.26)`
- `json (<= 1.7.7, >= 1.4.4)` required by `chef (10.26)`
EOS
expect(conflict.message_with_trees(:version_for_spec => lambda(&:version))).to eq <<-EOS.strip
Molinillo could not find compatible versions for possibility named "json":
Expand All @@ -193,7 +193,7 @@ def self.save!(path, name, index, requirements, resolved)
chef_app_error (>= 0) was resolved to 1.0.0, which depends on
chef (~> 10.26) was resolved to 10.26, which depends on
json (>= 1.4.4, <= 1.7.7)
json (<= 1.7.7, >= 1.4.4)
EOS
end
end
Expand Down

0 comments on commit d42b00a

Please sign in to comment.