-
Notifications
You must be signed in to change notification settings - Fork 286
Add classes to manage supported SCM packages #586
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
Conversation
vcsrepo::manage::bzr is a classthat may have no external impact to Forge modules. vcsrepo::manage::cvs is a classthat may have no external impact to Forge modules. vcsrepo::manage::git is a classthat may have no external impact to Forge modules. vcsrepo::manage::hg is a classthat may have no external impact to Forge modules. vcsrepo::manage::p4 is a classthat may have no external impact to Forge modules. vcsrepo::manage::svn is a classthat may have no external impact to Forge modules. This module is declared in 111 of 580 indexed public
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a good chance of conflicts so perhaps ensure_packages()
from stdlib is a good idea? And I'd like an acceptance test that just includes all classes.
I was concerned about adding a dependency for this module. In practice, I'd expect |
Is there an example somewhere I can look at for that... I fear I create my test files via |
Ah, fair point. I don't have access on this module so I'll let the maintainers speak.
I never use pdk, but it should be fairly straight forward. Something like # frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'vcsrepo::manage::git' do
let(:pp) { 'include vcsrepo::manage::git' }
it 'applies idempotently' do
idempotent_apply(pp)
end
it 'installs git' do
expect(package('git')).to be_installed
end
end You could also opt for a one-for-all-spec, but individual files works just as well and gives a bit more control in case you want to skip certain platforms. |
In theory I've got the acceptance tests up. On the |
@ekohl Is ensure_packages a standard that we use in other modules? In theory I'm fine with this as it makes sense but part of me worries about people that rely on specific versions of stdlib.. including the latest version as a dep here (also sensible) might create problems for them. |
For the integration tests, I think the Red Hat nodes need EPEL for For |
Rebased off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't have access here so I can't merge, but looks good to me.
Any way to re-trigger the workflows? |
It seems I don't have |
Any suggestions on how to get these tests to pass? |
I think it should be done in the setup, where there actually already is a lot: puppetlabs-vcsrepo/spec/spec_helper_acceptance_local.rb Lines 29 to 62 in b82414b
I would actually suggest to rewrite tests to include your new class instead of doing it in a setup phase, though the git config may be a bit tricky then. Now what I'd personally do is copy the pattern that we have in voxpupuli-acceptance. That's use RSpec.configure do |c|
c.before :suite do
LitmusHelper.instance.apply_manifest(File.read(File.join(__dir__, 'setup_acceptance_node.pp')))
end
end Then ensure |
I've taken a stab at the suggested include method... the more ruby I write the less I think I understand this language... |
Does this look workable? |
Anything else needed from me? |
Rebased off head |
this looks good. But it looks like some of the new Rubocop checks that were introduced with the Puppet 8 support work are complaining. Looks like it's mostly spec stuff it's complaining about. Shouldn't be too tough to fix |
Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
There are a dozen or so trivial classes on the forge that just install
git
or similar so folks can usevcsrepo
. This is an attempt to help standardize the process of loading these packages, but in an optional way for folks that have more complex needs (such as custom configs).It is a sort of "meet in the middle" attempt to avoid building a separate class just to load a package resource.