Skip to content
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

Resolve test failure from bundler 2.2.24+ #544

Merged
merged 3 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ jobs:

strategy:
matrix:
java-version: [8, 15]
ruby-version: [jruby-9.2.18.0, jruby-head]
java-version: [8, 11, 15]
ruby-version: [jruby-9.2.21.0, jruby-9.3.13.0, jruby-9.4.5.0, jruby-head]
bundler-version: [1.17.3, 2.3.26, 2.4.21]
task: ['', integration]
exclude:
- ruby-version: jruby-9.2.21.0
bundler-version: 2.4.21

fail-fast: false

Expand All @@ -37,20 +41,17 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler: 1.17.3

- name: Install fixed rubygems version for non-jruby-head
run: gem update --system 2.7.11
if: ${{ matrix.ruby-version != 'jruby-head' }}
- name: Install bundler ${{ matrix.bundler-version }}
run: gem install bundler:${{ matrix.bundler-version }}
if: ${{ matrix.ruby-version == 'jruby-9.2.21.0' }}

# rubygems 2.7.11 is not supported on Ruby 3.1.0 (jruby-head).
# The oldest version supported by this ruby is 3.3.3.
- name: Install fixed rubygems version for jruby-head
run: gem update --system 3.3.3 && gem install bundler:1.17.3
if: ${{ matrix.ruby-version == 'jruby-head' }}
- name: Install latest rubygems version with bundler ${{ matrix.bundler-version }}
run: gem update --system && gem install bundler:${{ matrix.bundler-version }}
if: ${{ matrix.ruby-version != 'jruby-9.2.21.0' }}

- name: Install dependencies
run: bundle _1.17.3_ install --jobs=3 --retry=3
run: bundle _${{ matrix.bundler-version }}_ install --jobs=3 --retry=3

- name: Run tests
run: bundle exec rake ${{ matrix.TASK }}
Expand Down
3 changes: 2 additions & 1 deletion lib/warbler/traits/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def bundler_specs
bundle_without = config.bundle_without.map { |s| s.to_sym }
definition = ::Bundler.definition
all = definition.specs.to_a
requested = definition.specs_for(definition.groups - bundle_without).to_a
requested_groups = definition.groups - bundle_without
requested = requested_groups.empty? ? [] : definition.specs_for(requested_groups).to_a
excluded_git_specs = (all - requested).select { |spec| ::Bundler::Source::Git === spec.source }
excluded_git_specs.each { |spec| spec.groups << :warbler_excluded }
requested + excluded_git_specs
Expand Down
2 changes: 1 addition & 1 deletion spec/warbler/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def use_config(&block)
end

def bundle_install(*args)
`cd #{Dir.pwd} && #{RUBY_EXE} -S bundle install #{args.join(' ')}`
`cd #{Dir.pwd} && #{RUBY_EXE} -S bundle _#{::Bundler::VERSION}_ install #{args.join(' ')}`
end

let(:config) { drbclient.config(@extra_config) }
Expand Down
2 changes: 1 addition & 1 deletion spec/warbler/web_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def self.reset_local_repository

describe Warbler::WebServer::Artifact do

@@_env = ENV.dup
@@_env = ENV.to_h
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should resolve test failures on jruby v9.4+


after(:all) { ENV.clear; ENV.update @@_env }

Expand Down
1 change: 1 addition & 0 deletions warbler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bundle up all of your application files for deployment to a Java environment.}
gem.required_ruby_version = ">= 2.5"

gem.add_runtime_dependency 'rake', ['>= 13.0.3']
gem.add_runtime_dependency 'rexml', '~> 3.0'
gem.add_runtime_dependency 'jruby-jars', ['>= 9.0.0']
gem.add_runtime_dependency 'jruby-rack', ['>= 1.1.1', '< 1.3']
gem.add_runtime_dependency 'rubyzip', '>= 1.0.0'
Expand Down
Loading