标签: autotest

具有捆绑器的自动测试的平台特定宝石

在我正在研究的rails项目中,我使用此Gemfile插入了对rspec,黄瓜和自动测试的支持(部分)

gem 'rspec-rails'
gem 'cucumber-rails'
gem 'autotest-standalone'
gem 'autotest-rails-pure'
gem 'zentest-without-autotest'
Run Code Online (Sandbox Code Playgroud)

但是为了使用自动测试运行测试,我需要执行,bundle exec autotest否则它将失败并显示此消息

$ autotest 
loading autotest/cucumber_rails_rspec_rspec2
Error loading Autotest style autotest/cucumber_rails_rspec_rspec2 (no such file to load -- autotest/cucumber_rails_rspec_rspec2). Aborting.
Run Code Online (Sandbox Code Playgroud)

现在我正在使用Mac进行开发,我想启用autotest-growl和autotest-fsevents gem,但是如果我将这些行插入我的 ~/.autotest

require 'autotest/growl'
require 'autotest/fsevent'
Run Code Online (Sandbox Code Playgroud)

然后我需要在Gemfile中插入相应的gems,一切正常,但它会破坏我的CI服务器上的构建(在Linux上)

如何在不为本地和CI环境维护不同的Gemfile的情况下解决这个问题?

编辑:

目前我在Gemfile中用这些行解决了

if RUBY_PLATFORM.downcase.include?("darwin") # I'm on Mac
  gem 'autotest-fsevent'
  gem 'autotest-growl'
end
Run Code Online (Sandbox Code Playgroud)

它既可以在本地也可以在CI服务器上运行,我不知道它是否会弄乱一些东西,目前它似乎完美无缺.

任何更干净的方式仍然是受欢迎的.

EDIT2:

我切换到群组解决方案.虽然之前的monkeypatch在开发和持续集成方面都运行良好,但如果您使用capistrano bundler任务进行部署或使用bundle install --deployment选项(在生产中建议),它将在生产中出现错误

使用该if RUBY_PLATFORM.downcase.include?("darwin")行时,您将在部署时收到此错误.

# bundle install --deployment --without development test
You are trying to install …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails autotest bundler gemfile

7
推荐指数
1
解决办法
2250
查看次数

如何设置自动测试以仅重新运行失败的rspec示例

我对自动测试如何工作的印象(基于黄瓜github wiki和其他在线内容)是它应该重新运行红色示例,直到它们通过.我的问题是它重新运行spec文件中找到失败示例的所有示例,包括传递的示例.在修复失败的例子时,我宁愿不浪费时间重新运行示例.是否可以配置自动测试,以便只运行失败的示例?

ruby rspec autotest

7
推荐指数
1
解决办法
685
查看次数

是否有类似autotest-fsevent for windows的实现?

基本上它是自动测试的扩展,它监听来自操作系统的通知,并允许自动测试永久不扫描文件更改,同时仅测试必要的更改.它节省了CPU和磁盘的使用.

ruby windows autotest

6
推荐指数
1
解决办法
701
查看次数

Scipy autotest完成了一个错误

在Ubuntu 14.04下我安​​装了python 2.76.那么如图SciPy的位置,即通过

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

python -c "import numpy; numpy.test()"没有错误的测试完成,但python -c "import scipy; scipy.test()"结果是:

======================================================================
Run Code Online (Sandbox Code Playgroud)

错误:test_fitpack.TestSplder.test_kink

回溯(最近调用最后一次):文件"/usr/lib/python2.7/dist-packages/nose/case.py",第197行,在runTest中自我.test(*self.arg)文件"/ usr/lib /python2.7/dist-packages/scipy/interpolate/tests/test_fitpack.py",第333行,在test_kink splder中(spl2,1)#应该工作文件"/usr/lib/python2.7/dist-packages/scipy /interpolate/fitpack.py",第1186行,在splder中"并且不可微分%d次")%n)ValueError:样条有内部重复结并且不可微分1次


跑8936测试在77.338s

失败(KNOWNFAIL = 115,SKIP = 191,错误= 1)

我该怎么办?

autotest scipy python-2.7

6
推荐指数
0
解决办法
979
查看次数

从自动测试中排除文件夹

我刚刚在我的项目中安装了ZenTest来使用自动测试.我使用rspec并在其中有一个integration文件夹.因为我不想每次都运行我的集成测试,所以我开始使用autospec,所以我想以某种方式限制autospec在该文件夹中运行测试.

如何从/ aut中排除/ spec中选择的文件夹?

rspec ruby-on-rails autotest restriction

5
推荐指数
1
解决办法
692
查看次数

Autotest,Shoulda,Ruby - 设置?

我试图让整个设置与Mac上的Autotest/Growl/Shoulda一起测试我正在为Authlogic工作的宝石.我过去曾经使用过RSpec,但是想切换到Shoulda.

这个gem将与Rails一起使用,但是我制作的其他宝石只是普通的旧ruby库,不依赖于Rails模块.测试rubygems的推荐方法是什么?

ZenTest似乎主要集中在Rails上,因为我还没有找到一个宝石,因此autotest无论我是使用Rails,Sinatra还是制作宝石,我都可以自动调用所有TestUnit测试.

问题是,您正在构建的宝石运行测试的设置/工作流程是什么?你有什么资源可以帮助我吗?

或者更具体,可测试的问题:如何使用自动测试运行Paperclip或Authlogic的测试套件?

到目前为止,我一直在使用这些作为资源:

非常感谢.想要将测试作为我工作流程的核心部分.

ruby testing rubygems shoulda autotest

5
推荐指数
1
解决办法
2277
查看次数

Zentest - 如何在红色时停止自动测试

我正在尝试配置自动测试,以便当我运行我的测试套件并且我有一个失败的测试时,自动测试停止测试并等待我再次测试之前进行更改.使用我当前的配置,当遇到失败的测试时,自动测试会不断地进行测试,这使得处理时有点麻烦(每次我遇到测试失败时都必须键入终端并停止自动测试服务器).

我正在使用RSpec,Zentest和Spork开发rails应用程序.

相关宝石版本:

autotest (4.4.6)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
spork (0.9.0.rc8)
ZenTest (4.5.0)
Run Code Online (Sandbox Code Playgroud)

我的.autotest文件:

module Autotest::Notify
  def self.notify title, msg, img, pri='low', time=3000
    `notify-send -i #{img} -u #{pri} -t #{time} '#{msg}'`
  end

  Autotest.add_hook :ran_command do |autotest|
    results = [autotest.results].flatten.join("\n")
    output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/)
    folder = "~/.autotest_icons/"
    if output  =~ /[1-9]\d*\sfailures?/
      notify "FAIL:", "#{output}", folder+"failed.png", 'critical', 10000
    elsif output  =~ /[1-9]\d*\spending?/
      notify "PENDING:", "#{output}", folder+"pending.png", 'normal', 10000
    else
      notify "PASS:", "#{output}", folder+"passed.png"
    end
  end
end
Run Code Online (Sandbox Code Playgroud)

注意:我的.autotest文件的大部分内容都是让linux中的弹出窗口显示我的测试是通过还是失败. …

ruby-on-rails autotest zentest spork rspec-rails

5
推荐指数
1
解决办法
567
查看次数

如何在 Android 设备中模拟计步器传感器?

我想模拟用户的步行并计算他们的步数以进行自动测试。

我试图搜索解决方案,但只找到了模拟位置

android autotest android-testing

5
推荐指数
1
解决办法
1万
查看次数

无法使用Xcode 4.3安装autotest-fsevent gem

在更新到Xcode 4.3(删除旧版本的Xcode)后,我无法安装autotest-fsevent gem.通过首选项>下载>组件选项卡安装命令行工具.

osx 10.7.3,rvm 1.10.2,ruby 1.9.3-rc1,bundler 1.0.22

$ bundle

Installing autotest-fsevent (0.2.7) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/doc/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb 
extconf.rb:36:in `<main>': Xcode not found - see README for assistance (RuntimeError)


Gem files will remain installed in /Users/doc/.rvm/gems/ruby-1.9.3-rc1@global/gems/autotest-fsevent-0.2.7 for inspection.
Results logged to /Users/doc/.rvm/gems/ruby-1.9.3-rc1@global/gems/autotest-fsevent-0.2.7/ext/fsevent/gem_make.out
An error occured while installing autotest-fsevent (0.2.7), and Bundler cannot continue.
Make sure that `gem install autotest-fsevent -v '0.2.7'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

README只是表示需要Xcode.

我似乎选择了正确的Xcode.app:

$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
Run Code Online (Sandbox Code Playgroud)

其他人有这个问题吗?任何想法如何解决这个问题?

gem bundle autotest fsevents xcode4.3

4
推荐指数
1
解决办法
1680
查看次数

在轨道上的ruby中自动测试出错

我运行了命令autotest,这是我得到的错误.我正在关注Hartl的书,并想知道这场冲突是否正在发生,因为rails现在带有ZenTest或其他东西?我如何解决此错误.我是RoR的新手

Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"]
/Users//.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find ZenTest (>= 0) amongst [abstract-1.0.0, actionmailer-3.2.8, actionmailer-3.2.8.rc1, actionmailer-3.0.1, actionmailer-3.0.0, actionpack-3.2.8, actionpack-3.2.8.rc1, actionpack-3.0.1, actionpack-3.0.0, activemodel-3.2.8, activemodel-3.2.8.rc1, activemodel-3.0.1, activemodel-3.0.0, activerecord-3.2.8, activerecord-3.2.8.rc1, activerecord-3.0.1, activerecord-3.0.0, activeresource-3.2.8, activeresource-3.2.8.rc1, activeresource-3.0.1, activeresource-3.0.0, activesupport-3.2.8, activesupport-3.2.8.rc1, activesupport-3.0.1, activesupport-3.0.0, addressable-2.3.2, arel-3.0.2, arel-1.0.1, autotest-4.4.6, builder-3.0.4, builder-3.0.3, builder-2.1.2, bundler-1.2.1, bundler-1.2.0, bundler-1.0.22, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.4.0, coffee-script-source-1.3.3, diff-lcs-1.1.3, erubis-2.7.0, erubis-2.6.6, excon-0.16.2, execjs-1.4.0, heroku-2.31.2, heroku-api-0.3.5, hike-1.2.1, i18n-0.6.1, i18n-0.4.2, journey-1.0.4, …
Run Code Online (Sandbox Code Playgroud)

rubygems ruby-on-rails autotest ruby-on-rails-3 railstutorial.org

4
推荐指数
1
解决办法
1604
查看次数