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 private classes private, dont pass params #107

Merged
merged 1 commit into from
Mar 1, 2014

Conversation

jlambert121
Copy link
Contributor

It is very difficult to test at the subclass level to ensure parameters set at the main class are passed correctly to the subclass, especially when the subclass has defaults of it's own. I have made the mistake numerous times of setting a subclass parameter and all of the tests succeed but I forgot to actually pass the value from the main class.

This PR removes parameter passing and pulls all variables directly from the main class.
Spec tests are updated to ensure subclasses behave as they should based on parameters to the main class
OS dependent testing removed from main spec, no OS dependent decisions are made there
Minor bug fixes
Minor lint cleanup

@jenkinsadmin
Copy link

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@@ -1,85 +0,0 @@
GEM
Copy link

Choose a reason for hiding this comment

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

Can you remove the commit that removes this file from the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on how we get complete testing for all versions of puppet then? The Gemfile.lock pins puppet to 3.(something) currently which means traivs can't test 2.7 or the other versions of puppet in the 3 branch.

Copy link

Choose a reason for hiding this comment

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

That can (AFAIK) be accomplished by using multiple Gemfiles and referencing them in the .travis.yml. I included the Gemfile.lock to keep some of our development environments synchronized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll back this commit out. I'm not familiar with what you're suggesting though so I'll leave that one to you. :)

@rtyler
Copy link

rtyler commented Mar 1, 2014

Overall I think I get what you're going for and I'm cool with it. Did your editor automatically futz with a bunch of resources though? Moving the name up a line from:

package {
  'my-package' :
    version => latest;
}

to

package { 'my-package' :
    version => latest;
}

@jlambert121
Copy link
Contributor Author

Nope, the change from

package {
  'my-package':
    version => latest;
}

to

package { 'my-package':
  version => latest;
}

was me standardizing the way we name resources - we have it both ways. The style guid seems to prefer the latter so that's what I went with.

rtyler pushed a commit that referenced this pull request Mar 1, 2014
make private classes private, dont pass params
@rtyler rtyler merged commit d0d50cd into voxpupuli:next Mar 1, 2014
@rtyler
Copy link

rtyler commented Mar 1, 2014

why not

class { 'jenkins::proxy':
host => $proxy_host,
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to document these options. They aren't in the current parameters list at the top of file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants