# Testing signals — redis/redis

> Canonical page: https://codevetter.com/unpack/redis/testing-signals

# Testing signals — redis/redis

Scanned commit c3215f019a4c11c35d438f241114e94730fe39e5 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Testing is a Tcl integration suite: `tests/test_helper.tcl` globs `tests/{unit,unit/type,unit/moduleapi,unit/cluster,integration}/*.tcl` into `::all_tests` and runs them against real spawned `redis-server` processes on ports from 21111. There are no C-level unit test files, but the binary embeds a `REDIS_TEST` mode invoked as `redis-server test <name>|all` for data-structure self-tests. Module API coverage is unusually deep — 48 C test modules under `tests/modules/` paired with 48 `unit/moduleapi/*.tcl` suites. CI runs eight build matrices plus an ASAN build and a commands.def drift check, with lcov/Codecov, CodeQL, Coverity, and a reply-schema linter on separate workflows.
- Test discovery is directory-glob based, not a manifest: `test_helper.tcl` iterates `set test_dirs {unit unit/type unit/moduleapi unit/cluster integration}` and lsorts `*.tcl` into `::all_tests`, so a new `.tcl` file in those dirs is picked up automatically. — [tests/test_helper.tcl#L28-45](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L28-L45)
- The harness is a client/server fan-out: `test_server_main`, `accept_test_clients`, `read_from_test_client` and `signal_idle_client` distribute test files across parallel Tcl clients, with `run_solo` for tests that must not run concurrently. — [tests/test_helper.tcl#L261-290](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L261-L290) [tests/test_helper.tcl#L336-380](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L336-L380) [tests/test_helper.tcl#L465-485](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L465-L485)
- Support libraries sourced by every suite live in `tests/support/`: `server.tcl` (start_server), `util.tcl`, `cluster_util.tcl`, `aofmanifest.tcl`, `redis.tcl` (the Tcl RESP client), `response_transformers.tcl` (RESP2/RESP3 normalisation), and `cli.tcl`. — [tests/test_helper.tcl#L20-26](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/test_helper.tcl#L20-L26) [tests/support/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/support/)
- Module API is the most thoroughly covered subsystem: `runtest-moduleapi` enumerates 48 suites explicitly by `--single`, and `tests/modules/` holds 48 matching C test modules built by `$MAKE -C tests/modules` before the run. — [runtest-moduleapi#L21-70](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/runtest-moduleapi#L21-L70) [tests/modules/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/modules/) [tests/unit/moduleapi/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/unit/moduleapi/)
- The C code carries an embedded self-test harness rather than a separate unit-test binary: `main()` under `#ifdef REDIS_TEST` accepts `redis-server test <name>|all` with flags `--accurate --large-memory --valgrind --verbose`, iterates a `redisTests[]` table, and prints a pass/fail summary. — [src/server.c#L8256-8305](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.c#L8256-L8305)
- Cluster coverage includes 23 dedicated suites under `tests/unit/cluster/`, notably `atomic-slot-migration.tcl`, `internal-secret.tcl`, `packet-validation.tcl`, `tls-peer-impersonation.tcl` and `cluster-bus-port-protected-mode.tcl` — the security-sensitive cluster paths are explicitly exercised. — [tests/unit/cluster/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/unit/cluster/)
- Integration coverage focuses on durability and replication edge cases: `aof-multi-part.tcl`, `aof-race.tcl`, `corrupt-dump-fuzzer.tcl`, `corrupt-dump.tcl`, `psync2*.tcl` (four files), `replication-rdbchannel.tcl`, `replication-iothreads.tcl`, `failover.tcl`, `shutdown.tcl`. — [tests/integration/](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/integration/)
- The primary CI job `test-ubuntu-latest` builds with `make REDIS_CFLAGS='-Werror' BUILD_TLS=yes` and runs `./runtest --verbose --tags -slow --dump-logs` — meaning slow-tagged tests do not gate PRs. — [.github/workflows/ci.yml#L11-28](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L11-L28)
- CI enforces codegen freshness: the `validate commands.def up to date` step touches `src/commands/ping.json`, runs `make commands.def`, and fails if `git diff` is non-empty — a hand-edited commands.def will break the build. — [.github/workflows/ci.yml#L22-28](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L22-L28)
- A dedicated `test-sanitizer-address` job builds `SANITIZER=address REDIS_CFLAGS='-Werror -DDEBUG_ASSERTIONS -DREDIS_TEST' BUILD_TLS=module` and reruns the suite, so debug assertions and the embedded C tests are compiled in on that path only. — [.github/workflows/ci.yml#L30-40](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L30-L40)
- The build matrix covers portability rather than behaviour: `build-debian-old` (debian:buster container), `build-macos-latest`, `build-32bit` (via gcc-multilib), `build-libc-malloc`, `build-centos-jemalloc` (centos:stream9) and `build-old-chain-jemalloc` — all compile-only, no test step. — [.github/workflows/ci.yml#L42-95](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/ci.yml#L42-L95)
- Coverage is reported but non-gating: `codecov.yml` sets both `patch` and `project` statuses to `informational: true`, and the workflow runs `make lcov` and uploads `./src/redis.info`, gated on `github.repository == 'redis/redis'` so forks skip it. — [codecov.yml](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/codecov.yml) [.github/workflows/codecov.yml#L14-40](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/codecov.yml#L14-L40)
- Static analysis runs on separate cadences: CodeQL on every PR plus a weekly `cron: '0 0 * * 0'`, and Coverity daily (`cron: '0 0 * * *'`) with a comment noting the sub-500k-LOC quota of 21 builds/week. — [.github/workflows/codeql-analysis.yml#L1-12](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/codeql-analysis.yml#L1-L12) [.github/workflows/coverity.yml#L1-10](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/coverity.yml#L1-L10)
- Command JSON specs have their own path-filtered lint gate: `reply-schemas-linter.yml` triggers only on changes to `src/commands/*.json` and runs `node ./utils/reply_schema_linter.js` after `npm install ajv`. — [.github/workflows/reply-schemas-linter.yml#L1-25](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/reply-schemas-linter.yml#L1-L25) [utils/reply_schema_linter.js](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/utils/reply_schema_linter.js)
- Heavy/long-running coverage is deferred to `daily.yml`, which runs nightly and on PRs targeting release branches matching `'[0-9].[0-9]'` — so a PR into `unstable` never exercises it. — [.github/workflows/daily.yml#L1-12](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/.github/workflows/daily.yml#L1-L12)
- The GCRA rate-limiter test file is entirely inert: `tests/unit/gcra.tcl` wraps its body in `if 0 { ... }`, matching the fact that `src/gcra.c` is compiled out unless `-DENABLE_GCRA` is passed — so that feature has zero effective coverage. — [tests/unit/gcra.tcl#L1-30](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/tests/unit/gcra.tcl#L1-L30) [src/gcra.c#L9-12](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/gcra.c#L9-L12) [src/server.h#L917-928](https://github.com/redis/redis/blob/c3215f019a4c11c35d438f241114e94730fe39e5/src/server.h#L917-L928)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
