-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
build(coverage): enable dev js code coverage #137
Conversation
@@ -11,6 +11,8 @@ | |||
"build": "ng build", | |||
"dartanalyzer": "cd dist/dart && pub install && cd ../.. && ts-node scripts/ci/dart_analyzer", | |||
"demo-app": "cd src && ng serve", | |||
"postinstall": "typings install --ambient && npm prune", | |||
"reinstall": "npm cache clean && rimraf coverage dist typings && rimraf node_modules && npm install", |
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.
@hansl I think you had some opinions on postinstall
scripts?
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 cannot have any postinstall
/reinstall
scripts as we still don't have a publishing story. So I would remove postinstall
and reinstall
until we know if we can use them. Or @jelbourn maybe it's okay for now since nobody can npm install material2
(yet).
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.
And instead of running rimraf
, just do a git clean -dfx
.
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.
After discussing, keep the postinstall
/reinstall
scripts. When we do the publishing process we'll revisit this decision.
Replace rimraf
(and remove the dependency) by git clean -dfx
. This will remove everything that's not part of the git repository, even cached files for everything. This is okay for a reinstall
, which is the same as rebuilding everything anyway. Alternatively, we could do a git clean -dfx -e '.*'
(single quotes important) to keep dotfiles around (such as .idea
and .pub
).
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.
Resolved in c7c2799
Adds the following npm devDependencies - karma-coverage - rimraf Adds the following npm scripts both convienence items - postinstall: installs typings & runs npm prune - reinstall: cleans cache, generated content node_modules & runs reinstall Enables JavaScript coverage reporting with multiple outputs - Reports code coverage at the commandline - Generates an HTML coverage report - Generates a coverage.json for future coverage history
preprocessors: { | ||
'dist/**/!(*spec).js': ['coverage'] | ||
} | ||
reporters: ['dots', 'coverage'], |
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 we force --reporters=dots
on the command line in build-and-test.sh
.
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.
build-and-test.sh is only run in CI. The coverage currently is not.
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.
Just something to keep in mind.
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.
It was something I was going to work out with you before I PR the typescript coverage, one of the two will have to change.
Switches from rimraf to git to clean project - this still respects dot files
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Phase 1 of #128 - JavaScript coverage for local development
Adds the following npm devDependencies
- karma-coverage
- rimraf
Adds the following npm scripts both convienence items
- postinstall: installs typings & runs npm prune
- reinstall: cleans cache, generated content, node_modules & runs reinstall
Enables JavaScript coverage reporting with multiple outputs
- Reports code coverage at the commandline
- Generates an HTML coverage report
- Generates a coverage.json for future coverage history