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

(MODULES-4418) Add bypass_proxy to chocolateysource #132

Merged
merged 1 commit into from
Jan 24, 2019
Merged

(MODULES-4418) Add bypass_proxy to chocolateysource #132

merged 1 commit into from
Jan 24, 2019

Conversation

michaeltlombardi
Copy link

Prior to this commit the chocolateysource type and provider did
not support the option to specify the --bypass-proxy flag when
managing a source. This option causes Chocolatey to ignore any
system proxies and was introduced in Chocolatey 0.10.4.

This commit adds the bypass_proxy property to the type and
provider of chocolateysource to ensure that this property
can be configured on versions which support it.

This commit also updates the README documentation and CHANGELOG,
as well as providing new unit and acceptance tests and updating
any unit and acceptance tests which should include the new
setting.

As new features are added which depend on particular versions of
Chocolatey, it may be useful to refactor the tests and provider
to manage the addition of such features with less duplicated
code, but that is considered out-of-scope for this improvement.

@michaeltlombardi michaeltlombardi changed the title (MODULES-4418) Add bypass_proxy to chocolateysource WIP: (MODULES-4418) Add bypass_proxy to chocolateysource Jan 24, 2019
@michaeltlombardi
Copy link
Author

michaeltlombardi commented Jan 24, 2019

Working on the acceptance tests, will remove WIP when they pass.

Don't have a new enough version of Chocolatey in the CI artifactory to test, rectifying.

@michaeltlombardi michaeltlombardi changed the title WIP: (MODULES-4418) Add bypass_proxy to chocolateysource (MODULES-4418) Add bypass_proxy to chocolateysource Jan 24, 2019
@michaeltlombardi
Copy link
Author

Adhoc has passed (after we added a newer version of Chocolatey to artifactory)!

feels-good-man.gif

@@ -66,6 +99,7 @@
assert_match(/bob/, get_xml_value("//sources/source[@id='test']/@user", result.output).to_s, 'User did not match')
assert_match(/.+/, get_xml_value("//sources/source[@id='test']/@password", result.output).to_s, 'Password was not saved')
assert_match(/false/, get_xml_value("//sources/source[@id='test']/@disabled", result.output).to_s, 'Disabled did not match')
assert_match(/true/, get_xml_value("//sources/source[@id='test']/@bypassProxy", result.output).to_s, 'Bypass Proxy did not match')
end

Choose a reason for hiding this comment

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

The more recent idiom is to use rspec's expect(some_var).to match(/true/) although with all the other assert_matchs continuing in that way is fine.

end
end

it 'Should apply a manifest to change the priority' do

Choose a reason for hiding this comment

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

*Should apply manifest to set bypass_proxy to false

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -444,6 +489,26 @@
resource.flush
end

it "should set bypass_proxy when present" do

Choose a reason for hiding this comment

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

What's the difference between this test and the one starting at line 596?

Copy link
Author

Choose a reason for hiding this comment

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

Functionally none, I don't think, this is an artifact of copying the tests over.

Prior to this commit the `chocolateysource` type and provider did
not support the option to specify the `--bypass-proxy` flag when
managing a source. This option causes Chocolatey to ignore any
system proxies and was introduced in Chocolatey `0.10.4`.

This commit adds the `bypass_proxy` property to the type and
provider of `chocolateysource` to ensure that this property
can be configured on versions which support it.

This commit also updates the README documentation and CHANGELOG,
as well as providing new unit and acceptance tests and updating
any unit and acceptance tests which should include the new
setting.

As new features are added which depend on particular versions of
Chocolatey, it may be useful to refactor the tests and provider
to manage the addition of such features with less duplicated
code, but that is considered out-of-scope for this improvement.
@ThoughtCrhyme ThoughtCrhyme merged commit 2cc84d5 into puppetlabs:master Jan 24, 2019
@michaeltlombardi michaeltlombardi deleted the ticket/master/MODULES-4418 branch August 16, 2019 17:05
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.

3 participants