-
Notifications
You must be signed in to change notification settings - Fork 567
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
[puppet-jenkins#366] Replace -toolLocations with --toolLocation #367
Conversation
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
c097225
to
7a99cde
Compare
@@ -49,7 +49,7 @@ | |||
# Not required. Single string of whitespace-separated list of labels to be assigned for this slave. | |||
# | |||
# [*tool_locations*] | |||
# Not required. Single string of whitespace-separated list of tool locations to be defined on this slave. A tool location is specified as 'toolName:location'. | |||
# Not required. Array list of tool locations to be defined on this slave. A tool location is specified as 'toolName:location'. |
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 does change an API which concerns me, it would be better to take an Array or the single String for the parameter and then prepare the appropriate data for the template
7a99cde
to
24a3258
Compare
Updated. |
24a3258
to
914a43d
Compare
Without some rspec-puppet tests this will have to wait until I have a chance to write some, which will likely be in the next couple weekends |
60dd474
to
6da207b
Compare
I went ahead to write one. Also, from the docs,
Not sure if we have to go with
How do you intend to test which works? |
I have not used the The string splitting logic introduced into |
A hash might be better than an array if it's worth the effort to support multiple types. Would there ever be a use case to build up a list of a tool paths from hiera? |
6da207b
to
617aefc
Compare
Resolves this warning: WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Instead consider providing a specific error class or message. This message can be supressed by setting: `RSpec::Expectations.configuration.warn_about_potential_false_positives = false`.
I tested for the right syntax, updated the diff for this as well.
I'm not sure about hiera, haven't used it myself. |
|
||
describe 'with multiple tool locations' do | ||
let(:params) { { :tool_locations => 'Python-2.7:/usr/bin/python2.7 Java-1.8:/usr/bin/java' } } | ||
it { should contain_file(slave_runtime_file).with_content(/--toolLocation Python-2.7=\/usr\/bin\/python2.7|--toolLocation Java-1.8=\/usr\/bin\/java/) } |
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 doesn't test that both option string are present. How about something along these lines?
it do
should contain_file(slave_runtime_file).
with_content(/--toolLocation Python-2.7=\/usr\/bin\/python2.7/).
with_content(/--toolLocation Java-1.8=\/usr\/bin\/java/)
end
617aefc
to
94fcf3a
Compare
Thanks for the feedback. |
<% if @tool_locations %> | ||
TOOL_LOCATIONS_ARG="" | ||
<% @tool_locations.split.each do |tool_location| %> | ||
TOOL_LOCATIONS_ARG='$TOOL_LOCATIONS_ARG --toolLocation <%= tool_location.split(':').first -%>=<%= tool_location.split(':').last -%>' |
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.
What if the string is already in the Python-2.7=/usr/bin/python2.7
format? If there are any existing users of the tool_location
param, wouldn't they have to be using that form?
@rtyler was concerned about breaking the API. I could go either way really. |
It looks like version 2.0 intentionally made a breaking change to the I'd vote for supporting the current plugin version since, as-is, user's will experience breakage when upgrading swarm |
Great catch @jhoblitt! I can buy that, we'll just have to document it thoroughly, sorry for putting this through such scrutiny @patcadelina |
A validation regex should be able to catch the old format with a useful warn/fail message. |
No worries. |
@patcadelina - I'd like to echo @rtyler and thank you for your persistence in enduring such a long review process. |
[puppet-jenkins#366] Replace -toolLocations with --toolLocation
Should fix issue #366