我有一个Rakefile来运行tests/
下的所有最小测试:
require 'rake'
require 'rake/testtask'
task :test do
Rake::TestTask.new do |t|
t.pattern = 'tests/**/*_test.rb'
t.verbose = true
end
end
task default: :test
我在所有测试文件中都需要minitest/autorun
。
当我运行bundle exec rake
时,rake在rake aborted
中间随机中止:
☁ fuel [master] ⚡ bundle exec rake
/Users/leninraj/.rvm/rubies/ruby-2.2.3/bin/ruby -I"lib" -I"/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/**/*_test.rb"
Connecting to test database
Run options: --seed 43993
# Running:
...................F...F.............................................rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/**/*_test.rb" ]
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/ruby_executable_hooks:15:in `eval'
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => test
(See full trace by running task with --trace)
☁ fuel [master] ⚡ bundle show rake
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.4.2
即使使用--trace选项,也没有关于哪个测试中止跑步者的有用信息。
使用--trace option
:
...........................................................F..........................................rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0" "/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/rake_test_loader.rb" "tests/**/*_test.rb" ]
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/testtask.rb:108:in `block (3 levels) in define'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils.rb:57:in `call'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils.rb:57:in `sh'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:37:in `sh'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils.rb:96:in `ruby'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:37:in `ruby'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/testtask.rb:104:in `block (2 levels) in define'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/file_utils_ext.rb:58:in `verbose'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/testtask.rb:100:in `block in define'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:201:in `block in invoke_prerequisites'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:199:in `each'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:199:in `invoke_prerequisites'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:178:in `block in invoke_with_call_chain'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/leninraj/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/rake:23:in `load'
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/rake:23:in `<main>'
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/ruby_executable_hooks:15:in `eval'
/Users/leninraj/.rvm/gems/ruby-2.2.3@fuel-app/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => default => test
可能是什么原因?如何找到哪个测试中止跑步者?