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

Don't use test-queue to run tests on JRuby because it doesn't support fork #296

Merged
merged 1 commit into from
Jan 4, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
bundler-cache: true
- name: test
run: bundle exec rake test
env:
ERROR_ON_TEST_FAILURE: "false"
- name: internal_investigation
run: bundle exec rake internal_investigation

Expand Down
17 changes: 13 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@ require 'rubocop/rake_task'
require 'rake/testtask'
require_relative 'lib/rubocop/cop/generator'

desc 'Run tests'
task :test do
error_on_failure = ENV.fetch('ERROR_ON_TEST_FAILURE', 'true') != 'false'
# JRuby and Windows don't support fork, so we can't use minitest-queue.
if RUBY_ENGINE == 'jruby' || RuboCop::Platform.windows?
Rake::TestTask.new do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
end
else
desc 'Run tests'
task :test do
error_on_failure = ENV.fetch('ERROR_ON_TEST_FAILURE', 'true') != 'false'

system("bundle exec minitest-queue #{Dir.glob('test/**/*_test.rb').shelljoin}", exception: error_on_failure)
system("bundle exec minitest-queue #{Dir.glob('test/**/*_test.rb').shelljoin}", exception: error_on_failure)
end
end

desc 'Run RuboCop over itself'
Expand Down