Skip to content

Commit

Permalink
Don't use test-queue to run tests on JRuby or Windows because they …
Browse files Browse the repository at this point in the history
…don't support `fork`
  • Loading branch information
G-Rath committed Jan 4, 2024
1 parent f47bcbd commit 0822163
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
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

0 comments on commit 0822163

Please sign in to comment.