我使用我的工作站作为gitlab-ci-runner。当我开发并运行chef exec rspec
时,它成功地测试了厨师/食谱。
Mehmets-MacBook-Pro:users mehmetdavut$ chef exec rspec
........
Finished in 1.72 seconds (files took 2.94 seconds to load)
8 examples, 0 failures
但是当我尝试使用gitlab构建测试它时,它给出了我的错误:
gitlab-ci-multi-runner 1.1.3 (a470667)
Using Shell executor...
Running on Mehmets-MacBook-Pro.local...
Fetching changes...
Removing Berksfile.lock
HEAD is now at 73e736b Rspec testleri eklendi, gitlab build kodu yerlesştirildi
From http://git.mdsw.co/cookbooks/users
73e736b..6b7111c master -> origin/master
Checking out 6b7111c2 as master...
Previous HEAD position was 73e736b... Rspec testleri eklendi, gitlab build kodu yerlesştirildi
HEAD is now at 6b7111c... Test build yml file
$ chef exec rspec
Finished in 3.55 seconds (files took 3.12 seconds to load)
0 examples, 0 failures
它找不到rspec文件0 examples, 0 failures
并且也会出错:
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `initialize'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `new'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/json-1.8.3/lib/json/common.rb:155:in `parse'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.5.0/lib/ridley/chef/cookbook/metadata.rb:473:in `from_json'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.5.0/lib/ridley/chef/cookbook/metadata.rb:29:in `from_json'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/ridley-4.5.0/lib/ridley/chef/cookbook.rb:36:in `from_path'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/cached_cookbook.rb:15:in `from_store_path'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/cookbook_store.rb:108:in `block in cookbooks'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/cookbook_store.rb:98:in `collect'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/cookbook_store.rb:98:in `cookbooks'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/resolver/graph.rb:8:in `populate_store'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/resolver.rb:75:in `resolve'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/installer.rb:175:in `install_from_universe'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/installer.rb:39:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/berksfile.rb:421:in `install'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/berksfile.rb:630:in `block in vendor'
from /opt/chefdk/embedded/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/lib/berkshelf/berksfile.rb:628:in `vendor'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.6.1/lib/chefspec/berkshelf.rb:39:in `block in setup!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:20:in `mute'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.6.1/lib/chefspec/berkshelf.rb:35:in `setup!'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chefspec-4.6.1/lib/chefspec/berkshelf.rb:61:in `block (2 levels) in <top (required)>'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:425:in `instance_exec'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:425:in `instance_exec'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/hooks.rb:357:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `block in run_hooks_with'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `each'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1724:in `run_hooks_with'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1679:in `with_suite_hooks'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:118:in `block in run_specs'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:77:in `report'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:117:in `run_specs'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:93:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from /opt/chefdk/embedded/bin/rspec:22:in `load'
from /opt/chefdk/embedded/bin/rspec:22:in `<main>'
ERROR: Build failed: exit status 1