Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are unit tests disabled? Any plans to return them back? #597

Open
KIVagant opened this issue Oct 1, 2021 · 1 comment
Open

Why are unit tests disabled? Any plans to return them back? #597

KIVagant opened this issue Oct 1, 2021 · 1 comment

Comments

@KIVagant
Copy link

KIVagant commented Oct 1, 2021

🗣️ 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?

👻 Brief Description

No tests in the repo

🥞 Cookbook version

latest

👩‍🍳 Chef-Infra Version

14.7.17

🎩 Platform details

Steps To Reproduce

Run tests

🚓 Expected behavior

100% covered and builds are green :)

➕ Additional context

Maybe someone also could help me to understand why I get the undefined method new_resource'from all tests inchefdk:3.5.13? It used to work in chefdk: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)>'

Appreciate any help!

@damacus
Copy link
Member

damacus commented Apr 4, 2023

I suspect because they're currently failing. If you're able to fix them, please feel free to enable and fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants