Igo*_*isk 2 rspec rspec-rails rspec3
这个问题与此不同:rspec Bisect Runs Indefinitely
\n\n我的测试套件需要 \xc2\xb1 10 分钟才能运行。\n当我运行时bundle exec rspec --bisect=verbose,它卡住了 1 个多小时(这是我等待的最长时间):
bundle exec rspec --bisect=verbose\nAssetSync: using /home/belasis/dev/deploy_webapp/config/initializers/asset_sync.rb\nBisect started using options: "" and bisect runner: :fork\nRunning suite to find failures...\nRun Code Online (Sandbox Code Playgroud)\n\n我点击后Ctrl C,出现此消息:
\n\nBisect aborted!\n\nThe most minimal reproduction command discovered so far is:\n (Not yet enough information to provide any repro command)\nRun Code Online (Sandbox Code Playgroud)\n\n因此,问题在于它没有运行任何内容并且没有给出错误消息。这怎么可能?
\n我遇到了这个问题,我通过 3 个操作解决了它。我认为这是最后一个有帮助的,但其他的在某些情况下也可能很重要:
rspec-core至3.9.1版本DISABLE_SPRING=trueenv 变量运行二等分shellbisect_runner 而不是默认fork的最后的更改是通过创建一个具有如下配置的本地文件来实现的:
RSpec.configure do |config|
config.bisect_runner = :shell
end
Run Code Online (Sandbox Code Playgroud)
我们称其为罚款rsp_shell.rb并将其保存在项目根目录中。
然后你必须像这样运行 bisect :
bundle exec rspec --require './rsp_shell' --bisect=verbose ...other arguments...
Run Code Online (Sandbox Code Playgroud)
此外,将 require 参数放在命令中的 bisect 参数之前似乎也很重要。
rspec 输出中的以下字符串表明应用了最后一个设置:
and bisect runner: :shell
Run Code Online (Sandbox Code Playgroud)