check-flow-coverage

Identifies C source lines not covered by Python flow tests using gcov and lcov.

6.2k|596|Updated May 5, 2016
One-click install
npx skills add https://github.com/RediSearch/RediSearch --skill check-flow-coverage
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: check-flow-coverage
Source: https://github.com/RediSearch/RediSearch/tree/main/.skills/check-flow-coverage
Command: npx skills add https://github.com/RediSearch/RediSearch --skill check-flow-coverage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When modifying C code in the RediSearch codebase, it is hard to know whether your changes are actually exercised by the end-to-end Python flow tests. This Skill builds the module with coverage instrumentation, runs the full Python test suite, and reports exactly which C source lines remain untested.

Core Features & Use Cases

  • Coverage Gap Detection: Builds with gcov instrumentation, runs the full Python flow test suite, and parses the lcov output to list uncovered line ranges per file.
  • Gap Classification: Distinguishes testable gaps (reachable via FT.* commands) from non-testable code such as disk-only paths, C API-only code, and defensive branches.
  • Structured Reporting: Groups uncovered lines by feature area and suggests which test file would be the natural home for new tests.
  • Use Case: After adding a new query node type in src/query.c, run this Skill to confirm which branches of your new code lack end-to-end test coverage before opening a pull request.

Quick Start

Ask the assistant to check flow coverage for a C source file, for example: run check-flow-coverage on src/module.c and src/query.c.

Frequently Asked Questions about check-flow-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check C code coverage from Python tests?▼

Build the module with coverage instrumentation using ./build.sh COV=1, then run the full Python test suite with ./build.sh RUN_PYTEST COV=1. The resulting lcov info file is parsed to list uncovered lines per source file.

How do I find untested lines in a specific C source file?▼

Pass one or more C file paths as arguments, such as src/module.c or src/query.c. The skill parses bin/flow_standalone.info and reports uncovered line ranges grouped by feature area for each target file.

Does gcov coverage work for Rust code in RediSearch?▼

No, the gcov/lcov pipeline only captures C source coverage under src/ and deps/thpool/. For Rust code under src/redisearch_rs/, use the separate check-rust-coverage skill instead.

Why is my coverage file stale or missing after running tests?▼

This happens when the build lacks coverage instrumentation or the test run did not complete. Rebuild with ./build.sh COV=1 FORCE and rerun the full suite with a timeout of at least 10 minutes, then verify bin/flow_standalone.info is newer than your start marker.

What are the limitations of flow test coverage analysis?▼

Coverage only tracks C code reachable through Redis commands like FT.SEARCH and FT.AGGREGATE. Disk-only paths, C module API-only code, and defensive branches are classified as non-testable and excluded from the report.