chef/chef-workstation

`chef exec rspec` broken on Chef Workstation 2.2.802

npmeyer opened this issue · 3 comments

Description

Running ChefSpec tests via chef exec rspec spec/ is broken in Chef Workstation 2.2.802.

I get the following error (even on a newly generated cookbook using chef generate cookbook somename -s):

An error occurred in a `before(:suite)` hook.
Failure/Error: Chef::WorkstationConfigLoader.new(nil).load

NameError:
  uninitialized constant Chef::WorkstationConfigLoader
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/chefspec-9.3.2/lib/chefspec/policyfile.rb:30:in `setup!'
# /opt/chef-workstation/embedded/lib/ruby/3.0.0/forwardable.rb:238:in `setup!'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/chefspec-9.3.2/lib/chefspec/policyfile.rb:66:in `block (2 levels) in <top (required)>'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/example.rb:455:in `instance_exec'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/example.rb:455:in `instance_exec'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/hooks.rb:365:in `run'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/configuration.rb:2144:in `block in run_suite_hooks'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/configuration.rb:2142:in `each'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/configuration.rb:2142:in `run_suite_hooks'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/configuration.rb:2066:in `with_suite_hooks'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/runner.rb:116:in `block in run_specs'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/reporter.rb:74:in `report'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/runner.rb:115:in `run_specs'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/runner.rb:89:in `run'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/runner.rb:71:in `run'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/lib/rspec/core/runner.rb:45:in `invoke'
# /opt/chef-workstation/embedded/lib/ruby/gems/3.0.0/gems/rspec-core-3.10.2/exe/rspec:4:in `<top (required)>'
# /opt/chef-workstation/embedded/bin/rspec:25:in `load'
# /opt/chef-workstation/embedded/bin/rspec:25:in `<main>'
#
#   Showing full backtrace because every line was filtered out.
#   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
#   RSpec::Configuration#backtrace_inclusion_patterns for more information.


Finished in 0.03518 seconds (files took 0.72348 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

I don't get this error if I downgrade back to 22.1.778.

Chef Workstation Version

2.2.802

Platform Version

I'm running Chef Workstation on Windows 10 in WSL2 (tested this in both Debian 9 and Ubuntu 20.04 distros).

It seems to work if I upgrade ChefSpec with chef gem install chefspec -v 9.3.3. It's unfortunate that a stable release was cut that breaks this basic workflow. :(

thanks @npmeyer for calling out the regression. we intend to improve our end-to-end test automation coverage so that such issues are caught prior to release.