Experimental code coverage installer

From chromium/chromium · View interactive version

Experimental code coverage installer is an AI agent skill from the GitHub repository chromium/chromium. Verifies and initializes the Chromium development environment and dependencies required for running code coverage tools and services.

How to use this skill

Skill file

Code Coverage Installer Skill

This skill guides the verification and initialization of the development

environment.


When to Use This Skill

Use this skill when:

or triage.

repositories.


How to Use This Skill

The primary and recommended method to verify and initialize all code coverage

dependencies automatically is to run the installer script with the required

--infra-dir argument:

python3 tools/code_coverage/code_coverage_installer.py --infra-dir <path_to_infra_dir>

[!IMPORTANT] If the user has not explicitly provided an infra directory path

in their request, you must ask them to specify one before running the

installer or starting manual verification. Do not choose a default directory

or initialize the repository without the user's explicit consent.

If you prefer to perform checks manually, or if you need to troubleshoot

specific components, follow the manual checklist workflow below:

Step 1: Verify Chromium Checkout on Disk

Before performing any code coverage operations, verify that a valid Chromium

source code checkout is available on the local disk.

  1. Locate the Workspace Root: Confirm you are inside or pointing to the root

of a Chromium checkout (typically containing the src/ directory).

  1. Verify Vital Files: Check for the presence of the following critical

files and directories to ensure the checkout is valid:

scripts.

  1. Verdict: If these files/directories are not present, stop and notify the

user. A valid local Chromium checkout is strictly required.

Step 2: Verify LLVM Coverage Tools

Verify that LLVM coverage tools are available in third_party/.

  1. Check for Existing Tooling: Check if the following executables exist:
  1. If Tools are Present: Proceed to the next step.
  2. If Tools are Missing: Prompt the user for confirmation before modifying

.gclient (as it will affect future sync speeds).

during workspace syncs:

1. Open the .gclient configuration file (located in the directory above

src/).

2. Add the following entry to the custom_vars dictionary:

```python

"checkout_clang_coverage_tools": True,

```

3. Run hooks to download the package:

```bash

gclient runhooks

```

required for coverage verification.

  1. Verdict: If the tools are still missing, stop and notify the user.

Step 3: Verify and Setup Code Coverage Recipe Code

Verify that the code coverage recipe codebase is available under the specified

<infra_dir>. This code runs on LUCI builders to generate raw coverage data and

upload it to GCS.

  1. Check for Existing Recipes Checkout: Check if the following directory

exists under your <infra_dir>:

  1. Verify Key Recipe Files: Confirm that the following files exist inside

code_coverage/:

  1. If Recipe Code is Present: Proceed to the next step.
  2. If Recipe Code is Missing: Follow the setup instructions in Step 5.
  3. Verdict: If the recipe repository is missing after setup, stop and notify

the user.

Step 4: Verify and Setup Code Coverage Service Code

Verify that the code coverage service codebase is available under the specified

<infra_dir>. This is the AppEngine service (Findit) that ingests, processes,

and serves the coverage data to Gerrit and the dashboard.

  1. Check for Existing Service Checkout: Check if the following directory

exists under your <infra_dir>:

  1. Verify Key Service Files: Confirm that the following files exist inside

findit/:

  1. If Service Code is Present: The environment setup is complete.
  2. If Service Code is Missing: Follow the setup instructions in Step 5.
  3. Verdict: If the service repository is missing after setup, stop and

notify the user.

Step 5: Setup Chrome Infra Superproject

If either the recipe code or service code is missing, they must be checked out

together using the infra_superproject configuration.

  1. Create the Target Directory: If the <infra_dir> (e.g.,

~/chrome_infra) does not exist, create it.

  1. Initialize Checkout:

```bash

cd <infra_dir>

gclient sync

```

```bash

cd <infra_dir>

fetch infra_superproject

```

Step 6: Verify Global Coverage Agent Rules in `GEMINI.md`

Check that your local //GEMINI.md file imports the global code coverage agent template:

  1. Check if GEMINI.md exists in the repository root.
  2. Verify that it contains:

```markdown

@agents/prompts/templates/code_coverage.md

```

  1. If missing, append @agents/prompts/templates/code_coverage.md so all code coverage agents and subagents automatically inherit infrastructure constraints (e.g., prohibiting web page scraping on LUCI/Swarming).
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.