praekeltfoundation / puppet-marathon

A Puppet module for managing Marathon
BSD 3-Clause "New" or "Revised" License
4 stars 6 forks source link

add provider support #27

Closed woosley closed 6 years ago

woosley commented 8 years ago

marathon packed by mesosphere uses upstart on centos, by default it is init causing puppet failure, so need a way to override provider.

woosley commented 8 years ago

the build failed but it does not seem to be the code's problem

JayH5 commented 8 years ago

@woosley thanks for the PR. I'll get the build working again in a separate PR so we can move forward. (Puppet tooling breaks all the time)

JayH5 commented 8 years ago

@woosley develop should now be building successfully. Please merge develop into your branch (you can rebase too, if you'd like).

woosley commented 8 years ago

@JayH5 rebased.

JayH5 commented 8 years ago

Again, thanks for the PR. This will need a couple of simple tests, though.

woosley commented 8 years ago

yeah, you are right on the if, will fix.

Personally I never write tests for puppet, any guide I can refer to?

JayH5 commented 8 years ago

@woosley probably a decent place to start is just the rspec-puppet tutorial: http://rspec-puppet.com/tutorial/

I can tell you we need 4 things, though:

  1. Add a line to this assertion that the marathon class with default parameters passes a nil value for force_provider to the marathon::service class.
  2. Add a test to the tests for the marathon class that when the force_provider parameter is set it is passed to the marathon::service class.
  3. Add a line to this assertion that the marathon::service class with default parameters passes a nil value for provider to the service resource.
  4. Add a test to the tests for the marathon::service class that when the force_provider parameter is set it is passed to the service resource as the provider parameter.

That may sound like a lot but it's all pretty straightforward and only a few lines of code.