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

时间:2018-05-08 20:49:20

标签: ruby-on-rails heroku ruby-on-rails-5.1 heroku-ci

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

以下错误表示require': cannot load such file -- spec_helper (LoadError)

当我使用Heroku调试器heroku ci:debug --pipeline myapp时,我发现没有spec目录。如果我运行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

1 个答案:

答案 0 :(得分:0)

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

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