-
Notifications
You must be signed in to change notification settings - Fork 14
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
Generic glob patterns for exclusions #26
Conversation
Ok, I will give a try to this configuration. I don't see a single issue in your pull request and I share your point of view. I'm not using meteor-coverage on a real meteor app, so correct me if I'm wrong, but each time there is a new dependency in an app, you need to add that dependency in the I will need to be rewritte the Again @cgalvarez , Thanks for this pull request. I will test it very soon. |
@serut I'm still testing only packages, cannot say anything proven about full meteor app testing, but I think nobody should create a custom The only time you should create that file is when you are testing meteor packages to include the final concatenated and minified (by meteor) version of your package(s) under test (done with readme.mdI can rewrite the
What do you think about? Anything to add/remove? |
I already edited a lot the README yesterday but I didn't published it yet. Thanks for these recommandations I will add them. |
I really like this PR, nice work @cgalvarez and @serut! LGTM! |
@serut Some more suggestions for
And another one that users will only know if they read
|
published with version |
* warn user when invalid .coverage.json * fix details page on html report with package test * two new exclusions for client side * bootstrap in separate file * fix not considered source map path patterns * generic glob patterns for exclusions * publishing workspace - wip * fix coverage verbosity * Update the readme with --settings usage + add some changes to @cgalvarez pull requests #26 #22 + reliability tests for client instrumentation script * Deploy 0.9.6 with - new configuration file - internal behavior fixed - new readme * Improve client errors and improve SourceMap.alterSourceMapPaths * Update README.md * Update README.md * Fix SourceMap sources paths * Remove old check inside coverage-data.js that existed when source maps where not reliable + lint + still a bug with client coverage that is not correcty exported in reports * fix four new source pattern and cover all test-packages perms (location and pkg quantity) * fix four new source pattern and cover all test-packages perms (location and pkg quantity) * new/remap * Edit the configuration file to remove 1 test from coverage + improve readme.md * Remove legacy code used by meteor-coverage to override wrong paths that we had before. more aggressive way than #36 * merge #37 * some es5 to es6, coverage improvement and fix script commands (#38) * some es5 to es6, coverage improvement and fix script commands * remove legacy code and fix readme info * revert handlers export * don't run ghost test * set spacejam as devdep * fix script commands with new spacejam syntax
Description
Improve the default glob patterns for exclusions:
**/.?*/**
: excludes all hidden folders (must have a minimum of 1 character after the dot).**/node_modules/**
: excludes all Node.js dependency modules.**/packages/!(local-test_?*.js)
: excludes all meteor package files except the one related to the current test (starting withlocal-test_....js
).**/+([^:]):+([^:])/**
: excludes other meteor package paths, likelmieulet:meteor-coverage/node_modules/depd/index.js
.**/@(test|tests|spec|specs)/**
: excludes folders containing test files (presumably).**/@(test.?*|?*.test.?*|?*.tests.?*|spec.?*|?*.spec.?*|?*.specs.?*|app-test.?*|?*.app-test.?*|?*.app-tests.?*|app-spec.?*|?*.app-spec.?*|?*.app-specs.?*)
: excludes test files according to the Meteor testing guide.These patterns are applied with
exclude.general
, which is the second filter (afterinclude
) before instrumentation and report generation, so all these files are neither instrumented nor listed in the reports.Meteor package(s) developers that want to tests their package(s) only need to include an item in the
include
array of the file.coverage.json
inside their meteor package(s) with the following syntax:"**/packages/<author>_<package>.js"
. A perfect example can be seen in the.coverage.json
file of this package:These patterns make maintaining the code and developing Meteor code an easier task, because:
node_modules
or.npm
)..coverage/prettify.js
.Because of instrumenter filters apply before instrumentation and before report generation, and their order is
include -> exclude.general -> exclude.{server|client}
, applying all previous patterns inexclude.general
allows filtering both sides (instrumentation/reports) and shaves some loop cycles.Motivation and Context
It's not a required change, but a very desirable one.
Right now each user testing a meteor app should exclude manually all the packages used by its app and meteor itself. This PR does this automatically, and exclude a lot of paths that potentially distort the coverage.
Meteor package(s) developers only need to include an item in the
include
array of the file.coverage.json
inside their meteor package(s) with the following syntax:"**/packages/<author>_<package>.js"
.This PR does not solve any specific problem, but increases the easiness of use of this package and prevents a lot of headaches, while helping to keep the coverage accurate.
How Has This Been Tested?
Tested with
lmieulet:meteor-coverage
and one package of my own. Forlmieulet:meteor-coverage
I saved the verbose stdout of the command before and after applying the PR, like this:Then I did a diff of
output_before.txt
andoutput_after.txt
. The only differences I found were the configuration object (obvious, because it's the change this PR introduces) and thatcoffeescript.js
was being instrumented before but not after (should be this way).Types of changes