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

Make docker::machine::url configurable #569

Conversation

baurmatt
Copy link
Contributor

@baurmatt baurmatt commented Jan 9, 2020

As docker machine is now in maintanence mode 1 there are forks of it
where people might want to download the binary from.

As docker machine is now in maintanence mode [1] there are forks of it
where people might want to download the binary from.

[1]: docker/machine#4537
@baurmatt baurmatt requested a review from a team as a code owner January 9, 2020 15:58
@codecov-io
Copy link

codecov-io commented Jan 9, 2020

Codecov Report

Merging #569 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #569   +/-   ##
=======================================
  Coverage   28.02%   28.02%           
=======================================
  Files          19       19           
  Lines         685      685           
=======================================
  Hits          192      192           
  Misses        493      493
Impacted Files Coverage Δ
lib/puppet/provider/docker_compose/ruby.rb 20.63% <0%> (ø) ⬆️
lib/puppet/provider/docker_stack/ruby.rb 24% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f41f16c...5774031. Read the comment docs.

@sheenaajay
Copy link
Contributor

Thank you @baurmatt for submitting the PR.Looks good.Could you please add acceptance test to verify the same.Thank you.

@baurmatt baurmatt force-pushed the feature/machine-docker_machine_url-configurable branch from 70c01e4 to fa7695c Compare January 16, 2020 08:28
@baurmatt
Copy link
Contributor Author

Hey @sheenaajay, thanks for taking a look! :) I've added some acceptance tests but can't current test them because your acceptance jobs just return 'ok' for every run. See latest job in master --> https://travis-ci.org/puppetlabs/puppetlabs-docker/jobs/634742568

Happy to take another look at this after you fixed the CI! :)

@sheenaajay
Copy link
Contributor

@baurmatt Thanks for incorporating the changes. Our Travis doesn't run acceptance tests for this module. Will run the Adhoc jobs on Jenkins and will update you with the results. Thank you.

@sheenaajay
Copy link
Contributor

Please find the test results.Could you please fix the failures.Thank you @baurmatt
11:44:49 Failures: 11:44:49 11:44:49 1) docker::machine with default parameters File "/usr/local/bin/docker-machine-0.16.1" mode 11:44:49 Failure/Error: its('mode') { is_expected.to cmp '0755' } 11:44:49 NoMethodError: 11:44:49 undefined method cmp' for #RSpec::ExampleGroups::DockerMachine::WithDefaultParameters::FileUsrLocalBinDockerMachine0161::Mode:0x000055cb762c0028
11:44:49
11:44:49 # ./spec/acceptance/machine_spec.rb:19:in block (4 levels) in <top (required)>' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in block in run'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in loop' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in run'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in run_with_retry' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in block (2 levels) in setup'
11:44:49
11:44:49 2) docker::machine with default parameters File "/usr/local/bin/docker-machine" link_path
11:44:49 Failure/Error: its('link_path') { is_expected.to eq '/usr/local/bin/docker-machine-0.16.1' }
11:44:49 NoMethodError:
11:44:49 undefined method link_path' for File "/usr/local/bin/docker-machine":Serverspec::Type::File 11:44:49 Did you mean? link_target 11:44:49 11:44:49 # ./spec/acceptance/machine_spec.rb:24:in block (4 levels) in <top (required)>'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in block in run' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in loop'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in run' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in run_with_retry'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in block (2 levels) in setup' 11:44:49 11:44:49 3) docker::machine with url => https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine File "/usr/local/bin/docker-machine-0.16.2-gitlab.3" mode 11:44:49 Failure/Error: its('mode') { is_expected.to cmp '0755' } 11:44:49 NoMethodError: 11:44:49 undefined method cmp' for #RSpec::ExampleGroups::DockerMachine::WithUrlHttpsGitlabDockerMachineDownloadsS3AmazonawsComV0162Gitlab3DockerMachine::FileUsrLocalBinDockerMachine0162Gitlab3::Mode:0x000055cb7606df50
11:44:49
11:44:49 # ./spec/acceptance/machine_spec.rb:51:in block (4 levels) in <top (required)>' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in block in run'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in loop' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in run'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in run_with_retry' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in block (2 levels) in setup'
11:44:49
11:44:49 4) docker::machine with url => https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine File "/usr/local/bin/docker-machine" link_path
11:44:49 Failure/Error: its('link_path') { is_expected.to eq '/usr/local/bin/docker-machine-0.16.2-gitlab.3' }
11:44:49 NoMethodError:
11:44:49 undefined method link_path' for File "/usr/local/bin/docker-machine":Serverspec::Type::File 11:44:49 Did you mean? link_target 11:44:49 11:44:49 # ./spec/acceptance/machine_spec.rb:56:in block (4 levels) in <top (required)>'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in block in run' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in loop'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in run' 11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in run_with_retry'
11:44:49 # ./.bundle/gems/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in block (2 levels) in setup' 11:44:49 11:44:49 Finished in 17 minutes 26 seconds (files took 41.55 seconds to load) 11:44:49 102 examples, 4 failures, 5 pending

@baurmatt
Copy link
Contributor Author

Hey @sheenaajay, is there a way for me to test this locally? Because without the possibility (local/Travis/...) to run those tests on my own, this will take ages. I'm afraid, I wont't have the time to add those acceptance tests.

describe file('/usr/local/bin/docker-machine-0.16.1') do
its('owner') { is_expected.to eq 'root' }
its('mode') { is_expected.to cmp '0755' }
it { is_expected.to be_file }
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please try updating the tests with the similar changes given below https://rspec-puppet.com/tutorial/
is_expected.to contain_file('/etc/logrotate.d/nginx').with({
'ensure' => 'present',
'owner' => 'root',
'group' => 'root',
'mode' => '0444',
})

Please let me know if it doesn't work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @sheenaajay, sorry but I won't play Github comment ping pong for failing tests. If I'm not able to run the tests locally/on Travis without your intervention I won't build them because it just takes way to much time.

Copy link
Contributor

Choose a reason for hiding this comment

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

@baurmatt Yeah, Let me make the changes and run on our Jenkins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! :)

@sheenaajay
Copy link
Contributor

Screen Shot 2020-02-17 at 11 25 00

@carabasdaniel
Copy link
Contributor

👍 LGTM

@carabasdaniel carabasdaniel merged commit f6810ce into puppetlabs:master Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants