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

add modules param to spec_helper_acceptance.rb.erb #837

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ spec/spec_helper.rb:
mock_with: false
spec/spec_helper_acceptance.rb:
unmanaged: true
configure_beaker:
modules: ':metadata'
CONTRIBUTING.md:
delete: true
.yardopts:
Expand Down
4 changes: 3 additions & 1 deletion moduleroot/spec/spec_helper_acceptance.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker
<%- unless @configs['configure_beaker'].nil? -%>
Copy link
Member

Choose a reason for hiding this comment

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

thinking about it again... if it's set to :fixtures we could automatically add task :beaker => "spec_prep" to the rakefile? But that would then require puppetlabs_spec_helper 🤔

Copy link
Member Author

@jhoblitt jhoblitt Jun 22, 2023

Choose a reason for hiding this comment

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

Yes, the gem would need to be added. Here's a PR I'm currently working on that has .sync.yml changes (rewritten by psych) and adds ./rakelib/beaker.rake. https://github.com/lsst-it/puppet-ccs_software/pull/39/files

Copy link
Member Author

Choose a reason for hiding this comment

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

That PR is also a good example of the pain of .fixtures.yml not having any dep resolution. I don't understand why Puppetfile never became a thing for test fixtures...

Copy link
Member

Choose a reason for hiding this comment

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

Probably because r10k doesn't do dependency resolution either. Does Puppetfile support symlinks?

Copy link
Member

Choose a reason for hiding this comment

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

thinking about it again... if it's set to :fixtures we could automatically add task :beaker => "spec_prep" to the rakefile? But that would then require puppetlabs_spec_helper thinking

Perhaps this bit would be useful in Rakefile: https://github.com/theforeman/foreman-installer-modulesync/blob/5bff8e9a2800ea6e0928aaaa0c2778c60d426bc1/moduleroot/Rakefile.erb#L21-L22

configure_beaker(modules: <%= @configs['configure_beaker']['modules'] || ':metadata' %>)

<%- end -%>
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }