-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
98 lines (86 loc) · 2.49 KB
/
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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
task "p:d" do
system %(git push; OPEN=false cap production deploy)
end
# task :t => :test_all
desc "test_all"
task :test_all do
system <<~EOT
# k -x "Google Chrome"
# k -x "chromedriver"
# k -x "shogi-extend"
tmux kill-window -t start
tmux new-window -n start
tmux send-keys -t start "start" C-m
tmux kill-window -t test
tmux new-window -n test
tmux send-keys -t test "sleep 180; rake; rspec --only-failures; sleep 120; rspec --only-failures; sleep 120; rspec --only-failures" C-m
EOT
end
desc "test:retry"
task "test:retry" do
system <<~EOT
sleep 120; rake
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
EOT
end
desc "test:retry2"
task "test:retry2" do
system <<~EOT
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
sleep 120; rspec --only-failures
EOT
end
if defined? RSpec
end
# require "rspec/core/rake_task"
#
# desc "すべてのテスト"
# RSpec::Core::RakeTask.new(:test) do |t|
# end
# desc "alias to test"
# task :default => :test
#
# desc "alias to test:core"
# task :c => "test:core"
#
# namespace :test do
# desc "重要なところだけのテスト"
# RSpec::Core::RakeTask.new(:core) do |t|
# # t.exclude_pattern = "spec/**/{animation,image}*_spec.rb"
# # t.rspec_opts = "-f d -t ~animation --fail-fast"
# t.rspec_opts = "-f d -t ~screen_image -t ~animation -t ~tactic -t ~transform"
# end
#
# desc "戦法判定"
# RSpec::Core::RakeTask.new(:tactic) do |t|
# t.rspec_opts = "-f d --fail-fast -t tactic"
# end
#
# desc "棋譜変換のテスト(TRANSFORM_OUTPUT=1 で expected を生成)"
# RSpec::Core::RakeTask.new(:transform) do |t|
# t.rspec_opts = "-f d -t transform"
# end
#
# desc "画像変換のテスト"
# RSpec::Core::RakeTask.new(:screen_image) do |t|
# # t.pattern = "spec/**/{screen_image,image}*_spec.rb"
# t.rspec_opts = "-f d --fail-fast -t screen_image"
# end
#
# desc "動画変換のテスト"
# RSpec::Core::RakeTask.new(:animation) do |t|
# # t.pattern = "spec/**/{animation,image}*_spec.rb"
# t.rspec_opts = "-f d --fail-fast -t animation"
# end
# end