Rspec 在CircleCI环境中选择文件会导致;未初始化的常数差“;错误
我在本地运行这些东西:Rspec 在CircleCI环境中选择文件会导致;未初始化的常数差“;错误,rspec,continuous-integration,glob,circleci,Rspec,Continuous Integration,Glob,Circleci,我在本地运行这些东西: ruby: 2.5 bundler: 2.0.1 rspec: 3.8 我正在尝试使用CircleCI对许多文件运行测试,但是没有一种文档化的方法可以运行 TESTFILES=$(circleci tests glob "spec/**/*.rb" | circleci tests split --split-by=timings) bundle exec rspec -- ${TESTFILES} 给出: An error occurred while loadin
ruby: 2.5
bundler: 2.0.1
rspec: 3.8
我正在尝试使用CircleCI对许多文件运行测试,但是没有一种文档化的方法可以运行
TESTFILES=$(circleci tests glob "spec/**/*.rb" | circleci tests split --split-by=timings)
bundle exec rspec -- ${TESTFILES}
给出:
An error occurred while loading ./vendor/bundle/gems/diff-lcs-1.3/spec/change_spec.rb.
Failure/Error:
describe Diff::LCS::Change do
describe "an add" do
subject { described_class.new('+', 0, 'element') }
it { should_not be_deleting }
it { should be_adding }
it { should_not be_unchanged }
it { should_not be_changed }
it { should_not be_finished_a }
it { should_not be_finished_b }
end
NameError:
uninitialized constant Diff
# ./vendor/bundle/gems/diff-lcs-1.3/spec/change_spec.rb:5:in `<top (required)>'
但这也会产生同样的错误
所以我换了
TESTFILES=$(circleci tests glob "**/*spec*.rb") # | circleci tests split --split-by=timings)
bundle exec rspec -- ${TESTFILES}
但这给了
/bin/bash: line 1: glob: command not found
然后我试着用find
TESTFILES=$(find . -name "*_spec.rb")
但这可以追溯到同样的原始信息:
An error occurred while loading ./vendor/bundle/gems/diff-lcs-1.3/spec/lcs_spec.rb.
Failure/Error:
describe Diff::LCS::Internals, ".lcs" do
include Diff::LCS::SpecHelper::Matchers
唯一有效的办法似乎是不要试图准备文件名列表,而只是简单地拥有它
bundle exec rspec
在我的
这很有效。虽然它实际上并没有选择顶级目录中的*\u spec.rb
文件,但只选择rspec/
目录中的文件-这有点奇怪,因为find命令同时包含当前目录和子目录,但在这里使用它只能找到1个文件
然后我设法通过使用
bundle exec rspec . # Note the dot at the end
虽然我现在可以运行所有测试,但问题仍然存在——如何选择文件列表?当我目前尝试CircleCI时,所有的方法似乎都在几个方面被打破了
.circleci/config file in a `run:` `command:` section
bundle exec rspec . # Note the dot at the end