-
Notifications
You must be signed in to change notification settings - Fork 66
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
(maint) Update beaker to support pupppet5 style installation #18
(maint) Update beaker to support pupppet5 style installation #18
Conversation
Can one of the admins verify this patch? |
rspec tests are broken, but I still plan on updating the tests |
e872003
to
e07c7f9
Compare
rspec tests are fixed and working, I'd just like to add a few new tests for the new code I've added |
These changes are only needed to access the public repos, users shouldn't have to do anything special yet to access the packages on builds.delivery.puppetlabs.net. |
@johnduarte Do you have time to also review this pr? |
I'd still like to update the tests, I haven't had time to do that yet. |
e07c7f9
to
6203444
Compare
|
||
subject.install_puppet_agent_from_msi_on( host, opts.merge({:puppet_collection => 'puppet'}) ) | ||
expect(subject).to receive(:link_exists?).with("#{opts[:win_download_url]}/puppet/puppet-agent-VERSION-x64.msi").and_return( true ) | ||
end |
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'm having issues with these tests. How do I get it to not execute all the things? This is the error I get with the current iteration. If I move line 845 up after 841, it gets to the cygwin check, but it looks like I should just be able to only check the thing getting passed into :link_exists?
, and end there. What am I missing?
1) ClassMixedWithDSLInstallUtils#install_puppet_agent_from_msi_on returns the right link when puppet collection is set
Failure/Error: raise "Puppet MSI at #{link} does not exist!"
RuntimeError:
Puppet MSI at http://downloads.puppetlabs.com/windows/puppet/puppet-agent-VERSION-x64.msi does not exist!
# ./lib/beaker-puppet/install_utils/foss_utils.rb:603:in `block in install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:596:in `install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:590:in `block in install_puppet_agent_from_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:576:in `install_puppet_agent_from_msi_on'
# ./spec/beaker-puppet/install_utils/foss_utils_spec.rb:844:in `block (3 levels) in <top (required)>'
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.
For example, I added in a second test in the other way I can think to do this below. Results are:
1) ClassMixedWithDSLInstallUtils#install_puppet_agent_from_msi_on returns the right link when puppet collection is set
Failure/Error: raise "Puppet MSI at #{link} does not exist!"
RuntimeError:
Puppet MSI at http://downloads.puppetlabs.com/windows/puppet/puppet-agent-VERSION-x64.msi does not exist!
# ./lib/beaker-puppet/install_utils/foss_utils.rb:603:in `block in install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:596:in `install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:590:in `block in install_puppet_agent_from_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:576:in `install_puppet_agent_from_msi_on'
# ./spec/beaker-puppet/install_utils/foss_utils_spec.rb:844:in `block (3 levels) in <top (required)>'
2) ClassMixedWithDSLInstallUtils#install_puppet_agent_from_msi_on returns the right link when puppet collection is not set
Failure/Error: if host.is_cygwin?
NoMethodError:
undefined method `is_cygwin?' for #<Hash:0x007f40ba102668>
# ./lib/beaker-puppet/install_utils/foss_utils.rb:609:in `block in install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:596:in `install_a_puppet_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:590:in `block in install_puppet_agent_from_msi_on'
# ./lib/beaker-puppet/install_utils/foss_utils.rb:576:in `install_puppet_agent_from_msi_on'
# ./spec/beaker-puppet/install_utils/foss_utils_spec.rb:853:in `block (3 levels) in <top (required)>'
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.
@melissa it looks like the method :install_a_puppet_msi_on
doesn't have any spec tests; if you wanted to continue adding tests from the method :install_puppet_agent_from_msi_on
you would need to mock out the rest of the method.
I would suggest adding a new describe
block that tests :install_a_puppet_msi_on
, with your code that tests it removed to a new method that :install_a_puppet_msi_on
calls. Maybe call it something like build_msi_path
?
The code that I would move to that method is:
if opts[:puppet_collection] && opts[:puppet_collection].match(/puppet\d*/)
link = "#{opts[:win_download_url]}/#{opts[:puppet_collection]}/#{host['dist']}.msi"
else
link = "#{opts[:win_download_url]}/#{host['dist']}.msi"
end
if not link_exists?( link )
raise "Puppet MSI at #{link} does not exist!"
end
9cd8982
to
02580e0
Compare
Tests have been updated, thank you @tvpartytonight ! |
02580e0
to
1d37dd3
Compare
@johnduarte @kevpl @tvpartytonight I'd love to get some eyes on this. It sounds like folks are ready to start using this code. |
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.
👍 This looks great.
Confirmed this does not inhibit installation on EC2 instances.
@kevpl @tvpartytonight any additional things that need to happen before this can be merged? |
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.
Everything seems in order here. We just need to get through the automated tests & give @tvpartytonight a last chance to approve of the last changes requested.
👍 |
@kevpl I don't see any jenkins bot testing comments...I assume I can just kick one off, for safety's sake? |
@puppetlabs-jenkins test this please |
From what I can tell, there are no automated tests that get kicked off on beaker-puppet PRs |
They ran when @tvpartytonight kicked them, but I don't think they put comments in the conversation anymore, just a status on the commit itself. |
No description provided.