-
Notifications
You must be signed in to change notification settings - Fork 19
/
Rakefile
39 lines (30 loc) · 994 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
35
36
37
38
39
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
Cucumber::Rake::Task.new(:jenkins) do |task|
task.cucumber_opts = ['--format=pretty', 'features/single.feature', 'CONFIG_NAME=jenkins']
end
task :test do |t, args|
Rake::Task["single"].invoke
Rake::Task["single"].reenable
Rake::Task["local"].invoke
Rake::Task["parallel"].invoke
end