# Testing signals — openai/codex

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

# Testing signals — openai/codex

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

Rust tests use `cargo nextest` through `just test -p <crate>`, not raw `cargo test`. Core favors integration tests in `codex-rs/core/tests` (and `core/suite`) built on `core_test_support::responses`, which mounts SSE fixtures with `wiremock` and drives a `TestCodex`. The TUI uses `insta` snapshot tests. App-server tests speak the public JSON-RPC API via `TestAppServer`. CI is Bazel-first (`blocking-ci.yml`, `bazel.yml`) plus `cargo-deny`, codespell, and CLA checks. Python tooling under `scripts/` has its own pytest setup. Large areas — real OS sandbox integration, live provider calls, and Seatbelt-under-Seatbelt — are intentionally skipped when `CODEX_SANDBOX` or `CODEX_SANDBOX_NETWORK_DISABLED` is set.
- Core integration tests construct a mock HTTPS Responses server. The canonical pattern is `responses::mount_sse_once` + `ev_response_created` / `ev_function_call` / `ev_completed`, then `codex.submit(Op::UserTurn)` and assertions on `ResponseMock::single_request()`. — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md) [codex-rs/core/tests/suite](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/tests/suite)
- `TestCodexBuilder::build_with_auto_env()` is the default constructor so tests work when the app-server and exec OS differ. `wait_for_event` is preferred over timeout variants; `mount_sse_once` is preferred over match/sequence helpers. — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md) [codex-rs/core/tests](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/tests)
- TUI tests are snapshot-based with `insta`. UI changes must update snapshots via `just test -p codex-tui`, then `cargo insta pending-snapshots -p codex-tui` and `cargo insta accept -p codex-tui`. Helpers live beside views; `vt100` tests are feature-gated (`vt100-tests`). — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md) [codex-rs/tui/src/snapshots](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/tui/src/snapshots) [codex-rs/Cargo.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/Cargo.toml)
- New test modules must be sibling files included with `#[cfg(test)] #[path = "..._tests.rs"] mod tests;`, not inline modules. Assertions should use `pretty_assertions::assert_eq` on whole objects. Tests must not mutate process environment. — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md)
- Sandbox and network tests early-exit when `CODEX_SANDBOX=seatbelt` or `CODEX_SANDBOX_NETWORK_DISABLED=1`. Agents running under the Codex sandbox are expected to skip those tests rather than weaken the checks. The env-var names are centralized and must not be edited casually. — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md) [codex-rs/core/src/sandboxing/mod.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/src/sandboxing/mod.rs)
- CI blocking path is `.github/workflows/blocking-ci.yml`: `cargo fmt -- --check`, a package-manager pin check, `cargo shear` (which builds with `bazel build //...`), and the reusable Bazel test workflow. `cargo-deny.yml` audits licenses and advisories. — [.github/workflows/blocking-ci.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/blocking-ci.yml) [.github/workflows/cargo-deny.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/cargo-deny.yml) [.github/workflows/bazel.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/bazel.yml)
- Python under `scripts/` is a separate uv project (`codex-scripts`, requires Python >= 3.12). It is used for release and maintenance scripts, not the agent loop. `python-runtime-build.yml` and `python-runtime-release.yml` build the standalone Python runtime shipped for some Codex features. — [scripts/pyproject.toml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/scripts/pyproject.toml) [.github/workflows/python-runtime-build.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/python-runtime-build.yml) [.github/workflows/python-runtime-release.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/python-runtime-release.yml)
- Exec and login have crate-local tests (`codex-rs/exec`, `codex-rs/login`). SDK TypeScript tests live next to `sdk/typescript` and mock the stdio JSON-RPC transport rather than spawning a real model. There is no single cross-language end-to-end suite in CI that hits the live OpenAI API. — [sdk/typescript/src/codex.ts](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/sdk/typescript/src/codex.ts) [codex-rs/exec/src/lib.rs](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/exec/src/lib.rs) [.github/workflows/blocking-ci.yml](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/.github/workflows/blocking-ci.yml)
- Coverage gaps called out by repo policy: agent behavior changes must add a `core/suite` integration test; unit tests of statically defined tables are discouraged; negative tests for deleted logic are discouraged. UI without an insta snapshot is considered incomplete. — [AGENTS.md](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/AGENTS.md) [codex-rs/core/tests/suite](https://github.com/openai/codex/blob/a1f40f3f1326eff7c81b860a4f4e27c1be186e10/codex-rs/core/tests/suite)

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)
