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

puppetlabs_spec_helper: require 4.x and newer #41

Merged
merged 1 commit into from
Dec 18, 2022

Conversation

bastelfreak
Copy link
Member

version 3 defines the beaker rake task. beaker-rspec defines that as well, and that's the one we want to use. We need to ensure that we load puppetlabs_spec_helper in version 4 (which doesn't have the beaker rake task). Otherwise we end up with two tasks. Calling it will run both which in turn will run all tests twice.

version 3 defines the beaker rake task. beaker-rspec defines that as
well, and that's the one we want to use. We need to ensure that we load
puppetlabs_spec_helper in version 4 (which doesn't have the beaker rake
task). Otherwise we end up with two tasks. Calling it will run both
which in turn will run all tests twice.
@bastelfreak bastelfreak added the bug Something isn't working label Dec 18, 2022
@bastelfreak bastelfreak self-assigned this Dec 18, 2022
Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bastelfreak bastelfreak merged commit 993d0d0 into voxpupuli:master Dec 18, 2022
@bastelfreak bastelfreak deleted the puppetlabs_spec_helper2 branch December 18, 2022 21:18
@@ -30,5 +30,5 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'rspec-github', '~> 2.0'
s.add_runtime_dependency 'serverspec'
s.add_runtime_dependency 'winrm'
s.add_development_dependency 'puppetlabs_spec_helper', '>= 1.2.0'
s.add_development_dependency 'puppetlabs_spec_helper', '>= 4.0.0'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl I'm wondering if this should be a runtime dependency, not a development dependency?

@ekohl ekohl removed the bug Something isn't working label Dec 18, 2022
@ekohl
Copy link
Member

ekohl commented Dec 18, 2022

This isn't really a bug. It's just a development dependency that accepts the newest version anyway. At runtime it's a soft dependency:

begin
# Fixtures can be needed because of spec_prep
# spec_prep taks is provided by puppetlabs_spec_helper
require 'puppetlabs_spec_helper/tasks/fixtures'
rescue LoadError
# we only need that during CI, so we rescue the LoadError
end

Ideally the fixture bit would be in a gem and the spec helper would just be calling that, but it's not so here we are.

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

Successfully merging this pull request may close these issues.

3 participants