-
Notifications
You must be signed in to change notification settings - Fork 105
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
(PDK-385) Support package testing on OSX #225
Conversation
build_yaml = open("http://#{ENV['BUILD_SERVER']}/pdk/#{ENV['SHA']}/repos/#{ENV['SHA']}.yaml").read | ||
build_yaml = YAML.load(build_yaml) | ||
artifact = build_yaml[:platform_data][workstation['platform']][:artifact][1..-1] | ||
pkg = "http://#{ENV['BUILD_SERVER']}/pdk/#{ENV['SHA']}/repos#{artifact}" |
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 Jenkins provides the required build string here as SUITE_VERSION.
If I use that then I can remove this yaml and string slicing code.
That would mean one more ENV for a local user to have to manage; but that's better than having to rely on this code...
Vanagon now helpfully writes a |
|
||
if workstation['platform'] =~ %r{windows} | ||
pkg ||= "http://#{ENV['BUILD_SERVER']}/pdk/#{ENV['SHA']}/repos/windows/pdk-x64.msi" | ||
full_version = build_info['version'] |
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.
We could do all this in the Rakefile
and actually set SUITE_VERSION
only if unset. Would that be better?
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.
It might be most helpful to use SUITE_VERSION if it's already set; and fall back to build_metadata.json if it's not set.
I'm unsure if I prefer the code being here or in the Rakefile. It might be better in the Rakefile in order to ensure we have all the essential data before executing beaker and allocating VMs
Oh and here is where the version-less MSI is getting created: https://github.com/puppetlabs/packaging/blob/master/tasks/ship.rake#L619-L642 |
test_name 'Install pdk package on workstation host' do | ||
workstation = find_at_most_one('workstation') | ||
|
||
step 'Install pdk package' do | ||
if ENV['LOCAL_PKG'] | ||
pkg = File.basename(ENV['LOCAL_PKG']) | ||
scp_to(workstation, ENV['LOCAL_PKG'], pkg) | ||
end | ||
else |
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 else
looks wrong - if you're using LOCAL_PKG
then you still need the build version string for generic_install_dmg to get the pkg name inside the dmg
@scotje I pushed a commit that moves the determination of SUITE_VERSION to Rakefile instead of doing it in the test code. Let me know what you think - at least some of the commits on this PR can be squashed, but only if the current code is what we want to go with. |
Add package install for OSX (beaker does not have a helper for this, yet. See https://tickets.puppetlabs.com/browse/BKR-1109 for having a single helper for all platforms implemented).
I'm unhappy with the amount of code here when beaker and vanagon should provide a 2-liner method to get a .dmg from the build server and install it on the workstation host.
Tested against a number of builds (including per-commit builds and tag builds). Also tested that this works with the LOCAL_PKG option to point to a local .dmg file instead of one on the build server