-
Notifications
You must be signed in to change notification settings - Fork 26
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
(FM-8225) Convert to litmus testing #134
Conversation
|
Are you abandoning #133 ? Where do you want review for this? |
|
@donoghuc, Just realised we need to open PR against upstream to run the acceptance tests in pipeline. We will keep this PR for the litmus porting. Hope that's ok. |
|
Sounds good. I left some comments on the other PR, should we continue all new review on this one? |
| end | ||
|
|
||
| it 'installs pry', unless: (operating_system_fact == 'windows') do | ||
| result = run_task('package', 'default', 'action' => 'install', 'name' => 'pry', 'provider' => 'puppet_gem') |
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.
Would it make sense to just use the BoltSpec::Run methods directory for all the Rspec tests with the inventory and config setup by litmus?
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.
@donoghuc Let me go through the BoltSpec:: Run methods. Sounds good.
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.
@donoghuc Looks like we use bolt_spec/run' https://github.com/puppetlabs/puppet_litmus/blob/master/lib/puppet_litmus.rb#L6
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.
Yeah, so my suggestion would be to use for example the BoltSpec::Run.run_task method directly in the rspec tests instead of the run_bolt_task method from litmus https://github.com/puppetlabs/puppet_litmus/blob/7c7bcb5e4b5d6202d1e7f10a678e810679a02845/lib/puppet_litmus/serverspec.rb#L142
Specifically, in general when your tests need the "bolt native" structure that is returned by for example https://github.com/puppetlabs/bolt/blob/45056d869f7377e196e6b0aeb177d3515ed3d63f/lib/bolt_spec/run.rb#L27 you should just use the BoltSpec::Run methods directly. When you need to use the litmus method (where you dont necessarily care about the task details, and only that it succeded/failed) then use the litmus run_bolt_task method.
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.
@donoghuc we have updated run_bolt_task to handle result hash too.So we can test all the values returned from hash.
https://github.com/puppetlabs/puppet_litmus/blob/master/lib/puppet_litmus/serverspec.rb#L159
a1e9f5b
to
1d250ad
Compare
@donoghuc Found this page for creating user accounts.Once the account is created we will be able to view the results. Yeah we can use new PR for new comments. I will make sure all comments from old PR is addressed. Thank you. |
62683e7
to
e0061b1
Compare
|
@tphoney @sheenaajay I am still unable to see anything with pipelines due to not having an account. I see that the jenkins testing is disabled as well. From what I can tell the only test targets are in travis https://travis-ci.org/puppetlabs/puppetlabs-package and there are failures there. Following the steps in the distelli manifest config I am seeing legit test failures due to the refactor. What is the plan moving forward for acceptance testing this module? |
|
@donoghuc litmus gem is released and the test case is updated to replace the 'stdout' since 'status' values need to be fetched now from the 'result' hash. |
Request for a review