# Coverage

Measure FalkorDB code coverage with LLVM source-based instrumentation across Rust unit...

- Repository: https://github.com/FalkorDB/FalkorDB (10505 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add FalkorDB/FalkorDB --skill coverage -g -a claude-code -y`
Codex: `npx skills add FalkorDB/FalkorDB --skill coverage -g -a codex -y`
Cursor: `npx skills add FalkorDB/FalkorDB --skill coverage -g -a cursor -y`
Gemini CLI: `npx skills add FalkorDB/FalkorDB --skill coverage -g -a gemini-cli -y`

## Description

Measure FalkorDB code coverage with LLVM source-based instrumentation across Rust unit tests, Python e2e/MVCC/concurrency tests, flow tests, and TCK - producing an lcov report. Use when asked to measure/report test coverage or reproduce the CI coverage job locally.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Coverage

LLVM source-based coverage (`-C instrument-coverage`) over the same suites CI
runs. `llvm-profdata`/`llvm-cov` must match the LLVM that built the binary, the devcontainer ships `llvm-profdata-22`/`llvm-cov-22`; locally use whatever
suffix matches your LLVM (drop the suffix if you only have one). Also needs
`lcov` (`brew install lcov` / `apt install lcov`).

## Full coverage (Rust unit + Python + flow + TCK)

```bash
# clean stale coverage data first
find . -name "*.profraw" -delete
rm -f cov.profdata codecov.txt codecov.txt.all

# build + Rust unit tests, instrumented.
# The link-arg is required on Linux/CI so the embedded RediSearch static libs
# link without duplicate-symbol errors; drop it with macOS's linker. RUSTDOCFLAGS
# instruments doctests too, matching CI.
COV_RUSTFLAGS="-C instrument-coverage -C link-arg=-Wl,--allow-multiple-definition"
RUSTFLAGS="$COV_RUSTFLAGS" RUSTDOCFLAGS="$COV_RUSTFLAGS" cargo build
RUSTFLAGS="$COV_RUSTFLAGS" RUSTDOCFLAGS="$COV_RUSTFLAGS" cargo test -p graph

# instrumented Python + flow + TCK suites (module already built above)
source venv/bin/activate 2>/dev/null || source /data/venv/bin/activate
pytest tests/test_e2e.py tests/test_functions.py tests/test_mvcc.py tests/test_concurrency.py -vv
./flow.sh
TCK_DONE=tck_done.txt pytest tests/tck/test_tck.py -s

# pass each unit-test binary as an extra -object so llvm-cov also credits
# coverage recorded by test-only code paths (CI does this; without it those
# lines under-report)
TEST_OBJECTS=""
for bin in $(RUSTFLAGS="$COV_RUSTFLAGS" cargo test -p graph --no-run 2>&1 \
    | grep -w Executable | grep -oE 'target/debug/deps/[^)]+'); do
  TEST_OBJECTS="$TEST_OBJECTS -object $bin"
done

The rest: https://github.com/FalkorDB/FalkorDB/blob/HEAD/.claude/skills/coverage/SKILL.md
