New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 717195 link

Starred by 61 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Feature



Sign in to add a comment

Ability to export code coverage results for use by analysis tools

Reported by bed...@technicalpursuit.com, May 1 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30

Steps to reproduce the problem:
This is an enhancement

What is the expected behavior?
This is an enhancement

What went wrong?
This is an enhancement

Did this work before? N/A 

Chrome version: Version 60.0.3086.0 (Official Build) canary (64-bit)  Channel: n/a
OS Version: OS X 10.12.4
Flash Version: 

The ability to export code coverage profiles in some sort of format (possibly JSON) for use by external tooling (e.g. command line tools) would be most welcome for those of us who have Web application authoring frameworks. We have existing command line tools that currently just do minification but that could be run against this coverage data to produce an application package 'stripped' of unused code.
 
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback
Could you please describe clearly about the issue with manual reproducible steps and expected behavior to triage the issue from TE end.

Thanks.
There is no bug here. This is an enhancement to existing functionality. Therefore, there are no manual reproducible steps.

Insofar as what "expected behavior" might be, I would expect to be able to save the code coverage profile to my development machine's filesystem for use by my CLI tools.

Thanks.

Cheers,

- Bill
Project Member

Comment 3 by sheriffbot@chromium.org, May 2 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sureshkumari@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Type-Bug -Pri-2 Pri-3 Type-Feature
Owner: kozyatinskiy@chromium.org
Status: Untriaged (was: Unconfirmed)
Considering this as feature request and marking it as Untriaged to get more inputs from dev team.

Thanks.
Owner: caseq@chromium.org
Status: Assigned (was: Untriaged)

Comment 7 by kayce@google.com, Oct 25 2017

There's a Stack Overflow question with 12 upvotes requesting this feature: https://stackoverflow.com/questions/45106841

Comment 8 by crooz...@gmail.com, Dec 6 2017

Would be pretty useful feature. 

Comment 9 by dzeto...@gmail.com, Jan 24 2018

Agreed, i want this. Now i have to go write my own parser because this doesn't exist ANYwhere.  Some tools grab all css inline + external and plop into one window... not useful.  Even the old firefox dust-me tool does not actually have this feature in spite of some reports otherwise. I verified it
Would also like to see this feature. Currently at my place of work, we are including far more JavaScript files per page than we would like.

For example, some files we include are only using about 10% of the contents of a JS file. It's enough to warrant including the entire file, but since 90% is being is not used, it would be really useful to export only the JS actually use and including that on the page instead to reduce the amount of unnecessary JavaScript from being included.

Plenty of tools exist out there for doing this with CSS, but there are none for JS. I would find tremendous benefit out of this feature.
Any news on this?
Issue 887041 has been merged into this issue.
Cc: binghamj@google.com
Owner: ----
Status: Available (was: Assigned)
Any update on the implementation of described feature?
Owner: jarhar@chromium.org
Status: Assigned (was: Available)
Cc: caseq@chromium.org
 Issue 755953  has been merged into this issue.
I would like to see this feature so that the built in Chrome coverage can be used to collect coverage for compiled Dart code when running tests. So between sourcemaps and chrome coverage it will give me coverage of my original source language. This could apply to Dart, typescript, or any other compile to JS language.
Owner: pfeldman@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 20 by bugdroid1@chromium.org, Dec 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/384dfbd0667873ec84d922bfc7b657045a66a524

commit 384dfbd0667873ec84d922bfc7b657045a66a524
Author: Pavel Feldman <pfeldman@chromium.org>
Date: Tue Dec 11 22:26:02 2018

DevTools: allow exporting code coverage data.

Bug:  717195 
Change-Id: I0360d0dea935d2da11179dd7380f36bf52b85ced
Reviewed-on: https://chromium-review.googlesource.com/c/1370862
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615693}
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/renderer/devtools/front_end/coverage/CoverageModel.js
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/renderer/devtools/front_end/coverage/CoverageView.js
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/renderer/devtools/front_end/coverage_test_runner/CoverageTestRunner.js
[add] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/web_tests/http/tests/devtools/coverage/coverage-export-expected.txt
[add] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/web_tests/http/tests/devtools/coverage/coverage-export.js
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/web_tests/http/tests/devtools/coverage/coverage-view-expected.txt
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/web_tests/http/tests/devtools/coverage/coverage-view-filter-expected.txt
[modify] https://crrev.com/384dfbd0667873ec84d922bfc7b657045a66a524/third_party/blink/web_tests/http/tests/devtools/coverage/resources/basic-coverage.html

Status: Fixed (was: Started)
Excellent thanks! I saw it show up in Canary.
I don't understand why is this closed... please explain how does this allow us to export only the used (green) css on the coverage tab.

I'm on Version 73.0.3639.0 (Official Build) canary (64-bit) and I see no option to export used CSS anywhere.

How do I extract the used css only?
http://prntscr.com/luq610


 
This doesn't seem to export with the sourcemaps applied. Is that intentional? If not, is there another issue for getting sourcemapped coverage?

I dug around and found a relevant issue and comment on it. https://crbug.com/818806

Sign in to add a comment