Heroku CI 测试应用程序删除 /spec 目录



出于某种无法解释的原因,当 Heroku CI 在测试环境中构建应用程序时,它似乎会删除我的/spec 目录。

下面的错误说,require': cannot load such file -- spec_helper (LoadError)

当我使用 Heroku 调试器heroku ci:debug --pipeline myapp时,我看到没有规范目录。如果我运行rakebundle exec rake它会给我在构建 UI 中看到的相同错误。

为什么可能会删除此目录?

-----> Running test command `rake`...
/app/vendor/ruby-2.3.7/bin/ruby -I/app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib:/app/vendor/bundle/ruby/2.3.0/gems/rspec-support-3.7.1/lib /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/exe/rspec --pattern spec/**{,/*/**}/*_spec.rb
/app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1455:in `require': cannot load such file -- spec_helper (LoadError)
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1455:in `block in requires='
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1455:in `each'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1455:in `requires='
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration_options.rb:111:in `each'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration_options.rb:21:in `configure'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:99:in `setup'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:86:in `run'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
from /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/exe/rspec:4:in `<main>'
/app/vendor/ruby-2.3.7/bin/ruby -I/app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/lib:/app/vendor/bundle/ruby/2.3.0/gems/rspec-support-3.7.1/lib /app/vendor/bundle/ruby/2.3.0/gems/rspec-core-3.7.1/exe/rspec --pattern spec/**{,/*/**}/*_spec.rb failed
-----> test command `rake` failed with exit status 1

在heroku中,有一个叫做.slugignore file的东西。有人将/spec 目录添加到该文件,因此我的 CI 构建无法运行。

不要将您的规范目录添加到 .slugignore!

相关内容

  • 没有找到相关文章

最新更新