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
🏗 Add support for gulp serve --coverage
coverage collection endpoint
#30099
Conversation
@@ -65,6 +65,9 @@ app.use('/amp4test', require('./amp4test').app); | |||
app.use('/analytics', require('./routes/analytics')); | |||
app.use('/list/', require('./routes/list')); | |||
app.use('/test', require('./routes/test')); | |||
if (argv.coverage) { | |||
app.use('/coverage', require('istanbul-middleware').createHandler()); |
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.
Curious: Does this work with the various gulp serve
flags like --esm
or --compiled
or --sxg
?
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.
--compiled
yes. As for --esm
and --sxg
, I haven't tried those yet, but I suspect they will be slightly more complicated based on some of the related code paths I saw. I'm going to work on --esm
next week to make sure that's usable and the sourcemaps function properly. As for SxG, I don't have a deep enough understanding to know whether it would have any impact, and whether SxG would be any different from a coverage perspective
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.
Based on my understanding, this PR should have a similar effect on --esm
and --sxg
. So my guess is that if one of them works with the coverage middleware, both should. We can confirm once the initial code lands.
a881d19
to
91b7a03
Compare
I have #30247 to fix it. Also
happy to skip the test if it's blocking.
…On Thu, Sep 17, 2020 at 10:02 AM Ryan Cebulko ***@***.***> wrote:
@ampproject/build-cop <https://github.com/orgs/ampproject/teams/build-cop>
This failing test has been blocking this PR for almost two weeks now. Can
it be skipped?
[image: image]
<https://user-images.githubusercontent.com/6694512/93503400-0481bf80-f8e6-11ea-9b92-4793c354b8ca.png>
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#30099 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJLHAB6G4GPQLGDF2F4YELSGI6LDANCNFSM4QTWNL7Q>
.
|
Let's skip it for now to unblock new PRs. @rcebulko can you file a PR to skip until we figure it out? |
91b7a03
to
f85dd7a
Compare
ampproject#30099) * add istanbul-middleware dependency * Add coverage collection endpoint to gulp serve * Switch middleware to devDependency
When
gulp serve
is called with the--coverage
flag, a new/coverage
endpoint will be available. Coverage data can be reported to that endpoint, and it provides a simple UI to browse coverage data throughout the codebase.Sample of interface after loading and reporting from
examples/everything.amp.html
:Note that currently the coverage data is still reported manually; doing so automatically, either within
gulp serve
or forgulp e2e
, will be addressed separately. This PR just adds the flag and collection endpoint.