-
Notifications
You must be signed in to change notification settings - Fork 71
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
Use voxpupuli-test #612
Use voxpupuli-test #612
Conversation
@@ -7,37 +7,6 @@ begin | |||
rescue LoadError | |||
end | |||
|
|||
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' | |||
|
|||
desc 'Auto-correct puppet-lint offenses' |
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.
I've entirely dropped this since the puppetlabs_spec_helper task lint_fix
should be sufficient.
Rake::Task[:lint_fix].invoke | ||
end | ||
|
||
desc 'Run acceptance tests' |
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.
We normally use the beaker
job and I'd like to standardize on that.
t.pattern = 'spec/acceptance' | ||
end | ||
|
||
desc 'Run tests' |
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.
Also a customization that I've dropped for now.
desc 'Run tests' | ||
task test: [:release_checks] | ||
|
||
namespace :check do |
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.
Moved to the gem
Puppet::Util::Log.level = :debug | ||
Puppet::Util::Log.newdestination(:console) | ||
end | ||
require 'voxpupuli/test/spec_helper' | ||
|
||
if File.exist?(File.join(__dir__, 'default_module_facts.yml')) |
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.
I think that we can actually get rid of this since most have a small set. Once it's easy to unmanage the file, we should convert those to directly use add_custom_fact
in those modules.
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.
we should test this on a module, but it looks fine to me.
d71d17c
to
2d7e3e4
Compare
5b7e39c
to
121e3df
Compare
@ekohl I tested this with the master branch of voxpupuli-test and it seems to work fine. Do you still consider this WIP or should we release voxpupuli-test and afterwards merge this PR? |
IMHO voxpupuli/voxpupuli-test#4 should be merged and released. Also note I pushed another update after you did, but didn't test it so far. Other than that, I think this is ready for review. |
@@ -141,7 +118,7 @@ spec/acceptance/nodesets/windows-2012-serverstandard-x64.yml: | |||
spec/acceptance/nodesets/windows-2012R2-serverstandard-x64.yml: | |||
delete: true | |||
spec/spec_helper.rb: | |||
mock_with: ':rspec' | |||
mock_with: false |
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.
Should we leave this out or keep it in as a reference on what to document?
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.
I think more documentation is always a good approach
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.
I'm a bit behind on this, why set mock_with
to false?
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.
Because voxpupupli-test defaults to :rspec
so there's no need to set it in the spec helper. This still allows an override but most modules shouldn't use it. This is in line with keeping the spec helper as minimal as possible. Ideally we'd standardize all our modules on rspec mocking and remove the need altogether, but we lack the resources to do so.
Is it worth creating a few test PRs across some of our modules? |
@alexjfisher I'm currently releasing 0.2.0 of voxpupuli-test: voxpupuli/voxpupuli-test#6 |
This week I won't have that much time to work on this, but a few test PRs are certainly a good idea. Especially modules that use lib and do coverage |
I tested this at voxpupuli/puppet-ferm#94 and pushed one rubocop fix to this PR |
0a33abe
to
103cd14
Compare
I rebased this again and tested it on a few modules. I'm fine with merging it. |
version: '~> 1.15.0' | ||
- gem: mocha | ||
version: '~> 1.4.0' | ||
- gem: voxpupuli-test |
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 are people's thoughts on pinning this? Should we release a 1.0.0 and stick to semver?
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.
since I didn't discover any further issues I'm 👍 for a 1.0.0 release + pinning to >= 1.0.0
This gem has most of the duplication that used to be modulesynced. By moving it to a gem, the need for modulesyncing is greatly reduced.
Since I'm the author of the PR, GH won't allow me to approve it. However, I think it's ready to merge. |
This gem has most of the duplication that used to be modulesynced. By moving it to a gem, the need for modulesyncing is greatly reduced.
Currently a draft since we should do some bikeshedding and the gem should live in the Voxpupuli org.
Ideally we'd end up with by default a single line in
spec_helper.rb
that isrequire 'voxpupuli/test/spec_helper'
. Whenever a module then needs overrides, it can be done by unmanaging the file rather than the complex .sync.yml dance that's done now.