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

Issue 821840 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocked on:
issue 821849
issue 838279
issue 838281
issue 845231
issue 845298

Blocking:
issue 759794
issue 790747
issue 825362



Sign in to add a comment

Establish testing for code coverage tools on the "main bots"

Project Member Reported by mmoroz@chromium.org, Mar 14 2018

Issue description

This is continuation of the discussion from https://chromium-review.googlesource.com/c/chromium/src/+/688221

It feels like now we've reached the point where we must have tests for the coverage tools we've previously integrated. We've been getting feedback from multiple users of the coverage script [1] and even seen a couple of documents on how different teams plan to use it.

Dirk, Nico, Hans, could you please point us to any existing tests serving the same purpose, i.e. testing integration of clang / llvm tools? That would be very helpful, as I have no idea where to start.



[1] https://cs.chromium.org/chromium/src/tools/code_coverage/coverage.py
 

Comment 1 by mmoroz@chromium.org, Mar 14 2018

Description: Show this description

Comment 2 by h...@chromium.org, Mar 14 2018

Can you point to any doc about how the current tool works?

Without knowing exactly how it works, I'd imagine we'd need a buildbot on the main waterfall that builds with the necessary configuration to generate coverage, runs some tests, and verifies that the generated coverage data is sane.

Once that's reliably green, we'd mirror that configuration on a bot on the chromium.clang waterfall, using tip-of-tree instead of pinned Clang to catch any regressions from upstream.

Comment 3 by mmoroz@chromium.org, Mar 14 2018

Blockedon: 809150
We support coverage an all Chrome platforms (except Windows, needs testing atm), so the integration tests must be cross-platform as well.

Comment 4 by mmoroz@chromium.org, Mar 14 2018

Hans, thanks for the answer. We've started writing a doc on current workflow, we'll update this issue once it's ready!

Comment 5 by h...@chromium.org, Mar 14 2018

Great! We should try to make it replace https://www.chromium.org/developers/code-coverage as the top search hit for "Chromium code coverage" :-)

Comment 6 by mmoroz@chromium.org, Mar 14 2018

There is a doc from a high level user perspective written by mus+ash Team: https://docs.google.com/document/d/1oF-_5XQ-hoOLFGyVPqgnowJtQYJj6Kd4rlXcPpCg-dU/edit

But I assume you're looking for a more detailed one, which explains what kind of tools we download and run through the script.
Blockedon: 821849
Re #5, thanks for the feedback! I think we should replace it with a clang_code_coverage.md.

Comment 9 by mmoroz@chromium.org, Mar 14 2018

Wow, I haven't heard about that page! We sure must update it :)
Re #2

I've wrote a doc to explain how code coverage works with Chrome: https://docs.google.com/document/d/1WylZsi6U6UOeekDrmPTYbH2ToFC7TOk_jXXfTmrtnCY/edit#heading=h.jfxzlxz5xk85.

hans@, can you take a look and please let me know if you have any questions.

Comment 11 by h...@chromium.org, Mar 21 2018

Thanks! That's a great doc. Is the plan to work that into https://chromium.googlesource.com/chromium/src/+/master/docs/code_coverage.md to help Chromium devs get started?

As for testing this, I suppose what you want is a buildbot that builds with use_clang_coverage=true, runs the coverage tool on some target/s and sanity checks the output.

Once there's such a bot on the main waterfall we can use the same config but with tip-of-tree Clang to make sure it doesn't break in the next Clang roll.
Blocking: 825362
Filed a separate issue for implementing report generation on Chrome Infra bots:  issue 825362 

This issue is for establishing test coverage for the code coverage tools integrated in Chromium.


Owner: liaoyuke@chromium.org
1) ensure that clang roll script tests llvm-tools-llvm-cov

2) set up any basic test for the coverage script (i.e. integration test)
Labels: Coverage-v1-Blocker
Clang roll script already tests llvm-tools-llvm-cov as it runs "ninja check-all": https://chromium.googlesource.com/chromium/src/+/master/tools/clang/scripts/update.py#550
Status: Started (was: Available)
An update here, we need a Mac bot as well. Bots should test code coverage script on a unittest target and on a fuzz target.
Blocking: 835854
Blocking: -835854
Blocking: 790747
Yuke has raised a good question: whether we should test component or non-component build or both. I think we should test component build. That should be enough to cover non-component case as well.

I mentioned in c#18 that we need to test both tests and fuzzers. That's still true, but when we get around building fuzz targets on Mac, we'll have to revert https://chromium-review.googlesource.com/c/chromium/src/+/1024444
We don't do release component builds in most cases, and I would worry that debug builds would be too slow, so I'd start with release static builds.
Re c#23, I think we should take what Dirk mentioned into consideration when actually generate code coverage reports, but for the purpose of testing the coverage script, I feel like it's better to test component build as it covers non-component build. WDYT?
I don't know if there's a significant different one way or another, so I'd defer that to you.
re c#24: Yes, absolutely. I fully agree with Dirk's c#23 and this is why I decided to use static builds for report generation.

As for testing code coverage, I agree with Yuke, as test case with component build is slightly more complicated than a non-component one, i.e. if the component case works, a non-component case works for sure.
Blockedon: -809150
Blockedon: 838279
Blockedon: 838281
Labels: -Coverage-v1-Blocker Coverage-v2-Blocker
Yuke, what needs to be done to close this?
Almost ready, everything is up for review.
Project Member

Comment 33 by bugdroid1@chromium.org, May 18 2018

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

commit 082e996347bbe484ec2d90dba33e996a1a662bc0
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Fri May 18 15:40:40 2018

Coverage: Add an argument to allow specify coverage tools to use.

This CL adds an argument to allow specify coverage tools to use, and
one use case is for testing the code coverage script against clang
coverage tools tot.

Bug:  821840 
Change-Id: I2ecbd425ed1dcd8494e2e89963bc763505e19a11
Reviewed-on: https://chromium-review.googlesource.com/1064602
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559903}
[modify] https://crrev.com/082e996347bbe484ec2d90dba33e996a1a662bc0/tools/code_coverage/coverage.py

Blockedon: 845231
Blocking: 845298
Blocking: -845298
Blockedon: 845298
Project Member

Comment 39 by bugdroid1@chromium.org, May 22 2018

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

commit 730d28c16612fb8e12522fee0ebda4df3d748bed
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Tue May 22 04:46:53 2018

Coverage: Add mb config for code coverage bots.

This CL adds mb configs for the clang tot coverage bots.

Bug:  821840 

Change-Id: I329f0c90871aaf364ab49d4fa53ddf428167176d
Reviewed-on: https://chromium-review.googlesource.com/1068198
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560485}
[modify] https://crrev.com/730d28c16612fb8e12522fee0ebda4df3d748bed/tools/mb/mb_config.pyl

Status: Fixed (was: Started)
https://ci.chromium.org/buildbot/chromium.clang/ToTMacCoverage/
https://ci.chromium.org/buildbot/chromium.clang/ToTLinuxCoverage/

Both builders are green now, marking this bug as fixed!

Sign in to add a comment