简体   繁体   English

自动测试:“无法运行测试”。 但是日志中什么也没有

[英]Autotest: “Could not run tests”. But nothing in the log

Autotest broke with rspec-rails 2.2.1 update. 自动测试因rspec-rails 2.2.1更新而中断。 Now I can't get it working again.. .even after rolling back to rspec-rais 2.2.0 . 现在,即使回滚到rspec-rais 2.2.0我也无法使其正常工作。

Only info I'm able to find is a Growl popup saying " App: Could not run tests ". 我只能找到的信息是Growl弹出窗口,上面显示“ App:无法运行测试 ”。 Nothing is being written to log/test.log . 什么都没有写到log/test.log

this is output in console: 这是在控制台中输出的:

/Users/meltemi/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| require f }" | unit_diff -u
Loaded suite -e
Started

Finished in 0.003428 seconds.


0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

Test run options: --seed 38767

Any ideas where to start troubleshooting this? 任何想法从哪里开始对此进行故障排除? I'd look in an autotest.log ...if i could find one!?! 我会寻找一个autotest.log ...如果我能找到一个!

Edit: tried running autotest with autotest -v and get a looong list of " No tests matched... " in the console (20± examples below): 编辑:尝试使用autotest -v运行autotest并在控制台中获得“ 没有匹配的测试... ”的完整列表(以下20±个示例):

...
No tests matched .git/objects/fe/41f5cc24d667635c46a533fd09bf7bb514e032
No tests matched .git/objects/fe/4577696b2811818fe7439990be0d2f65a892c5
No tests matched .git/objects/fe/e16b09c5e782035a347ed9b257ff9b2b3fa173
No tests matched .git/refs/heads/MenuModel
No tests matched .git/refs/heads/master
No tests matched .git/refs/remotes/origin/master
No tests matched .git/refs/tags/v0.0.1
No tests matched .git/refs/tags/v0.0.1.1
No tests matched .gitignore
No tests matched .rspec
No tests matched Capfile
No tests matched Gemfile
No tests matched Gemfile.lock
No tests matched README
No tests matched Rakefile
No tests matched app/helpers/application_helper.rb
No tests matched autotest/discover.rb
No tests matched config/application.rb
No tests matched config/boot.rb
No tests matched config/database.yml
No tests matched config/deploy.rb
No tests matched config/environment.rb
...

here's the config ( ~/.autotest ): 这是配置( ~/.autotest ):

# ~/.autotest
# Include plugins
require 'autotest/fsevent'
require 'autotest/growl'

# ./.autotest
# exceptions (files to ignore) 
# mappings (which files to specifically monitor for changes)
Autotest.add_hook(:initialize) {|at|
  at.add_exception %r{^\.git}  # ignore Version Control System
  at.add_exception %r{^./tmp}  # ignore temp files, lest autotest will run again, and again...
  #  at.clear_mappings         # take out the default (test/test*rb)
  at.add_mapping(%r{^lib/.*\.rb$}) {|f, _|
    Dir['spec/**/*.rb']
  }
  nil
}

autotest -s rspec2 tells autotest to use the "rspec2" style, which will make it look for spec files and run the examples therein. autotest -s rspec2告诉autotest使用“ rspec2”样式,这将使其查找规范文件并在其中运行示例。

This is just a workaround though. 不过,这只是一种解决方法。 Autotest is supposed to discover the specs based on the entries in your project's ./autotest/discover.rb . 自动测试应该根据项目的./autotest/discover.rb的条目来发现规格。 And as you found, a recent code update broke the autodiscovery. 正如您所发现的,最近的代码更新破坏了自动发现。 I ran into this myself and was unable to track down the source. 我自己遇到了这个问题,无法找到源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM