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

manifest option doesn't fail when the path doesn't exist #119

Open
bastelfreak opened this issue Jun 18, 2024 · 1 comment
Open

manifest option doesn't fail when the path doesn't exist #119

bastelfreak opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@bastelfreak
Copy link
Collaborator

Describe the Bug

rspec-puppet has an option to set a manifest path: https://github.com/puppetlabs/rspec-puppet/blob/main/lib/rspec-puppet.rb#L39

I can set it to an nonexisting path and then rspec-puppet just continues. I think this is a bug. It's hard to find typos when rspec-puppet doesn't output a warning or error.

Expected Behavior

rspec-puppet should throw an error when a nonexisting path is set.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'

Environment

  • Version [e.g. 1.27.0]
  • Platform [e.g. Ubuntu 18.04]

Additional Context

Add any other context about the problem here.

@ekohl
Copy link

ekohl commented Jun 18, 2024

This is handled here:

if (rspec_manifest = RSpec.configuration.manifest)
manifest = rspec_manifest
else
manifest_paths = Puppet[:environmentpath].split(File::PATH_SEPARATOR).map do |path|
File.join(path, 'fixtures', 'manifests')
end
manifest = manifest_paths.find do |path|
File.exist?(path)
end
manifest ||= Puppet::Node::Environment::NO_MANIFEST
end

As you can see, it's passed straight to Puppet which happily ignores any missing manifest.

The other part now doesn't make a lot of sense to me, because it's just passing a directory?

It'd make sense to me to clean this up.

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

No branches or pull requests

2 participants