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

(PDK-390) Implement spec:coverage rake task #228

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

DavidS
Copy link
Contributor

@DavidS DavidS commented Aug 8, 2017

This rake task will enable coverage tracking, execute the specs, and print a summary at the bottom of the test run.

DavidS added 2 commits August 8, 2017 11:46
This rake task will enable coverage tracking, execute the specs, and
print a summary at the bottom of the test run.
and exclude vendored lib/puppet files.
@DavidS DavidS force-pushed the update-coverage-config branch from 08977ae to aa609f0 Compare August 8, 2017 10:46
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 90.743% when pulling aa609f0 on DavidS:update-coverage-config into 44929d8 on puppetlabs:master.

@DavidS
Copy link
Contributor Author

DavidS commented Aug 8, 2017

Coverage reduction is expected, as it adds the lib/pdk/version.rb file under coverage that was ignored before.

It's a feature, not a bug!

# do not track vendored files
add_filter '/lib/puppet'
add_filter '/vendor'
add_filter '/.vendor'

Choose a reason for hiding this comment

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

I'm suspicious that there is no add_filter '/package-testing' but that folder doesn't show in the Coveralls report - are these add_filter statements redundant, given that track_files is specifying lib/**/*.rb ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

track_files is the lower bar, add_filter excludes things that get used during execution, but should not be tracked. e.g. when running with bundler defaults, gems get installed into vendor, and would show up in reports, when they shouldn't.

Choose a reason for hiding this comment

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

Cool, so package-testing does not need excluded because it will never bring code into coverage scope during execution... 👍

@james-stocks james-stocks merged commit 264f3cc into puppetlabs:master Aug 8, 2017
@DavidS DavidS deleted the update-coverage-config branch August 8, 2017 13:30
@chelnak chelnak added the maintenance Internal maintenance work that shouldn't appear in the changelog label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Internal maintenance work that shouldn't appear in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants