forked from grosser/parallel_tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
44 lines (36 loc) · 1.03 KB
/
Rakefile
File metadata and controls
44 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true
require 'bundler/setup'
require 'bump/tasks'
require 'bundler/gem_tasks'
# update all versions so bundling does not fail on CI
Bump.replace_in_default = Dir["spec/fixtures/rails*/Gemfile.lock"]
task default: [:spec, :rubocop]
task :spec do
sh "rspec spec/"
end
desc "Run rubocop"
task :rubocop do
sh "rubocop --parallel"
end
desc "bundle all gemfiles [EXTRA=]"
task :bundle_all do
extra = ENV["EXTRA"] || "install"
gemfiles = (["Gemfile"] + Dir["spec/fixtures/rails*/Gemfile"])
raise if gemfiles.size < 3
gemfiles.each do |gemfile|
Bundler.with_unbundled_env do
sh "GEMFILE=#{gemfile} bundle #{extra}"
end
end
end
desc "render the README option section"
task :readme do
output = `bundle exec ./bin/parallel_test -h`
abort "Command failed: #{output}" unless $?.success?
output.sub!(/.*Options are:/m, "") || raise
file = "README.md"
separator = "<!-- rake readme -->"
parts = File.read(file).split(separator)
parts[1] = output
File.write file, parts.join(separator)
end