-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathRakefile
34 lines (27 loc) · 848 Bytes
/
Rakefile
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
require 'rake'
require 'parallel'
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:single) do |task|
ENV['CONFIG_NAME'] ||= 'single'
task.cucumber_opts = ['--format=pretty', 'features/single.feature']
end
task default: :single
Cucumber::Rake::Task.new(:local) do |task|
task.cucumber_opts = ['--format=pretty', 'features/local.feature', 'CONFIG_NAME=local']
end
task :parallel do |_t, _args|
@num_parallel = 4
Parallel.map([*1..@num_parallel], in_processes: @num_parallel) do |task_id|
ENV['TASK_ID'] = (task_id - 1).to_s
ENV['name'] = 'parallel_test'
ENV['CONFIG_NAME'] = 'parallel'
Rake::Task['single'].invoke
Rake::Task['single'].reenable
end
end
task :test do |_t, _args|
Rake::Task['single'].invoke
Rake::Task['single'].reenable
Rake::Task['local'].invoke
Rake::Task['parallel'].invoke
end