2

我已经安装了以下 gem 进行测试:

gem 'rspec-rails'
gem 'spork'
gem "factory_girl_rails"
gem "capybara"
gem "guard-rspec"
gem 'cucumber-rails'
gem 'database_cleaner'

我所有的测试都需要很长时间才能运行——用 Cucumber 测试一个功能需要两分钟,而这是在 Spork 几乎所有东西都在 prefork 中运行的情况下。

测试本身最后一次运行耗时0.544s,但好像是在运行cron.rake、rakefile,不知道还有什么。我检查了这两个文件,它们似乎没有任何重要的事情发生。您对我如何改善这种情况有什么建议吗?

读数:

San-iMac:app san$ rake cucumber features/user_sessions.feature
WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3
Running cron.rake
begin Rakefile
/Users/san/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S bundle exec cucumber  --profile default
Using the default profile...
WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3
Feature: User Sessions
...
4

2 回答 2

1

我怀疑 Rake 是问题所在。尝试直接运行 cucumber,如果您使用的是 Bundler,则使用“bundle exec cucumber”,或者只是“cucumber”。

于 2011-08-28T01:09:26.410 回答
0

Are you using windows? We've noticed it takes much longer to spin up cucumber on windows than linux or mac.

I appreciate it might not be that easy to switch, but it'll typically save a couple of minutes per spin up.

于 2011-09-30T06:06:39.433 回答