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

Fix CI failing and update it with newer Ruby versions #179

Merged
merged 5 commits into from
Nov 17, 2024

Conversation

santiagorodriguez96
Copy link
Contributor

This PR fixes the CI that is currently failing and adds Ruby 3.2 and 3.3 to the CI matrix.

Versions 1.x of `mocha` where raising the following error when loading
the code to run the tests:

```
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/integration/mini_test/adapter.rb:26:in `included': uninitialized constant MiniTest (NameError)
Did you mean?  Minitest
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/integration/mini_test.rb:50:in `include'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/integration/mini_test.rb:50:in `activate'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/integration.rb:7:in `map'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/integration.rb:7:in `activate'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/setup.rb:10:in `activate'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/mocha-1.16.1/lib/mocha/setup.rb:14:in `<top (required)>'
	from /home/runner/work/resque-retry/resque-retry/test/test_helper.rb:20:in `require'
	from /home/runner/work/resque-retry/resque-retry/test/test_helper.rb:20:in `<top (required)>'
	from /home/runner/work/resque-retry/resque-retry/test/exponential_backoff_test.rb:1:in `require'
	from /home/runner/work/resque-retry/resque-retry/test/exponential_backoff_test.rb:1:in `<top (required)>'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `require'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `select'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `<main>'
```

The issue is that such versions of `mocha` are incompatible with
`minitest` v5.19+ – see the related issue freerange/mocha#614.
The tests where failing with the following error:

```
/home/runner/work/resque-retry/resque-retry/test/server_test.rb:7:in `<top (required)>': uninitialized constant MiniTest (NameError)
Did you mean?  Minitest
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `require'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:15:in `block in <main>'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `select'
	from /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/gems/3.0.0/gems/rake-10.5.0/lib/rake/rake_test_loader.rb:4:in `<main>'
```

The issue is that the gem is still using `MiniTest` constant which is
deprecated.

This commit fixes this by using `Minitest` constant instead.
Versions 10.x of Rake where raising errors in using Ruby 3.2 and 3.3
when loading the code to run the tests:

```
NoMethodError: undefined method `=~' for #<Proc:0x00007f0fc5aee530 /opt/hostedtoolcache/Ruby/3.2.6/x64/lib/ruby/gems/3.2.0/gems/rake-10.5.0/lib/rake/application.rb:393 (lambda)>
/opt/hostedtoolcache/Ruby/3.2.6/x64/bin/bundle:25:in `load'
/opt/hostedtoolcache/Ruby/3.2.6/x64/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)
```
@jzaleski
Copy link
Collaborator

Looks good. Thank you.

@jzaleski jzaleski merged commit f75421a into lantins:master Nov 17, 2024
5 checks passed
@santiagorodriguez96 santiagorodriguez96 deleted the sr--fix-ci branch November 18, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants