I was researching an issue I'm getting in tests (undefined methodnew_resource' for ConsulCookbook::Resource::ConsulConfigV0), so I wanted to look at the tests in the repo to find a good example for them. And I see that [all tests are disabled](https://github.com/sous-chefs/consul/pull/564) sinceJun 2, 2020`. Do you plan to enable them back?
:ghost: Brief Description
No tests in the repo
:pancakes: Cookbook version
latest
:woman_cook: Chef-Infra Version
14.7.17
:tophat: Platform details
-
Steps To Reproduce
Run tests
:police_car: Expected behavior
100% covered and builds are green :)
:heavy_plus_sign: Additional context
Maybe someone also could help me to understand why I get the undefined methodnew_resource'from all tests inchefdk:3.5.13? It used to work inchefdk:3.0.36`. 🥺
The receipt is as minimal as possible:
config = consul_config('consul') do |r|
end
The test looks like this:
require 'spec_helper'
describe 'consul_agent::default' do
cached(:chef_run) do
ChefSpec::SoloRunner.new do |node|
node.normal['languages'] = { 'python' => { 'version' => '2.7.1' } }
end.converge(described_recipe)
end
it 'ensures it will boot as an agent' do
expect(chef_run.node['consul']['config']['server']).to eq(false)
end
end
It fails with:
1) consul_agent::default ensures it will boot as an agent
Failure/Error:
ChefSpec::SoloRunner.new do |node|
node.normal['languages'] = { 'python' => { 'version' => '2.7.1' } }
end.converge(described_recipe)
NoMethodError:
undefined method `new_resource' for ConsulCookbook::Resource::ConsulConfigV0
# /tmp/d20211001-196-1l6bw5/cookbooks/poise/files/halite_gem/poise/helpers/lwrp_polyfill.rb:34:in `initialize'
# /tmp/d20211001-196-1l6bw5/cookbooks/poise/files/halite_gem/poise/helpers/resource_name.rb:32:in `initialize'
# /tmp/d20211001-196-1l6bw5/cookbooks/consul_agent/recipes/install.rb:38:in `from_file'
# /tmp/d20211001-196-1l6bw5/cookbooks/consul_agent/recipes/default.rb:7:in `from_file'
# ./spec/unit/recipes/ba_consul_agent_spec.rb:13:in `block (2 levels) in <top (required)>'
# ./spec/unit/recipes/ba_consul_agent_spec.rb:23:in `block (2 levels) in <top (required)>'
:speaking_head: Foreword
I was researching an issue I'm getting in tests (
undefined method
new_resource' for ConsulCookbook::Resource::ConsulConfigV0), so I wanted to look at the tests in the repo to find a good example for them. And I see that [all tests are disabled](https://github.com/sous-chefs/consul/pull/564) since
Jun 2, 2020`. Do you plan to enable them back?:ghost: Brief Description
No tests in the repo
:pancakes: Cookbook version
latest
:woman_cook: Chef-Infra Version
14.7.17
:tophat: Platform details
-
Steps To Reproduce
Run tests
:police_car: Expected behavior
100% covered and builds are green :)
:heavy_plus_sign: Additional context
Maybe someone also could help me to understand why I get the
undefined method
new_resource'from all tests in
chefdk:3.5.13? It used to work in
chefdk:3.0.36`. 🥺The receipt is as minimal as possible:
The test looks like this:
It fails with:
Appreciate any help!