forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.rake
75 lines (57 loc) · 2.08 KB
/
test.rake
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
desc "Run the full suite using parallel_tests to run on multiple cores"
task test: [:setup, :spec, :cucumber]
desc "Create a test rails app for the parallel specs to run against if it doesn't exist already"
task setup: :"setup:create"
namespace :setup do
desc "Forcefully create a test rails app for the parallel specs to run against"
task :force, [:rails_env, :template] => [:require, :rm, :run]
desc "Create a test rails app for the parallel specs to run against if it doesn't exist already"
task :create, [:rails_env, :template] => [:require, :run]
desc "Makes test app creation code available"
task :require do
if ENV["COVERAGE"] == "true"
require "simplecov"
SimpleCov.command_name "test app creation"
end
require_relative "test_application"
end
desc "Create a test rails app for the parallel specs to run against"
task :run, [:rails_env, :template] do |_t, opts|
ActiveAdmin::TestApplication.new(opts).soft_generate
end
task :rm, [:rails_env, :template] do |_t, opts|
test_app = ActiveAdmin::TestApplication.new(opts)
FileUtils.rm_rf test_app.app_dir
end
end
task spec: :"spec:all"
namespace :spec do
desc "Run all specs"
task all: [:regular, :filesystem_changes]
desc "Run the standard specs in parallel"
task :regular do
sh("bin/parallel_rspec spec/")
end
desc "Run the specs that change the filesystem sequentially"
task :filesystem_changes do
sh({ "RSPEC_FILESYSTEM_CHANGES" => "true" }, "bin/rspec")
end
end
desc "Run the cucumber scenarios in parallel"
task cucumber: :"cucumber:all"
namespace :cucumber do
desc "Run all cucumber suites"
task all: [:regular, :filesystem_changes, :reloading]
desc "Run the standard cucumber scenarios in parallel"
task :regular do
sh("bin/parallel_cucumber features/")
end
desc "Run the cucumber scenarios that change the filesystem sequentially"
task :filesystem_changes do
sh("bin/cucumber --profile filesystem-changes")
end
desc "Run the cucumber scenarios that test reloading"
task :reloading do
sh("bin/cucumber --profile class-reloading")
end
end