diff --git a/AGENTS.md b/AGENTS.md index fa2a4bbaba..09c32d02f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,7 @@ In the codex-rs folder where the rust code lives: Run `just fmt` (in `codex-rs` directory) automatically after you have finished making Rust code changes; do not ask for approval to run it. Additionally, run the tests: 1. Run the test for the specific project that was changed. For example, if changes were made in `codex-rs/tui`, run `cargo test -p codex-tui`. -2. Once those pass, if any changes were made in common, core, or protocol, run the complete test suite with `cargo test --all-features`. project-specific or individual tests can be run without asking the user, but do ask the user before running the complete test suite. +2. Once those pass, if any changes were made in common, core, or protocol, run the complete test suite with `cargo test` (or `just test` if `cargo-nextest` is installed). Avoid `--all-features` for routine local runs because it expands the build matrix and can significantly increase `target/` disk usage; use it only when you specifically need full feature coverage. project-specific or individual tests can be run without asking the user, but do ask the user before running the complete test suite. Before finalizing a large change to `codex-rs`, run `just fix -p ` (in `codex-rs` directory) to fix any linter issues in the code. Prefer scoping with `-p` to avoid slow workspace‑wide Clippy builds; only run `just fix` without `-p` if you changed shared crates. Do not re-run tests after running `fix` or `fmt`. diff --git a/docs/install.md b/docs/install.md index 16892c82fe..b7d4f0711a 100644 --- a/docs/install.md +++ b/docs/install.md @@ -43,7 +43,9 @@ just fix -p cargo test -p codex-tui # If you have cargo-nextest installed, `just test` runs the test suite via nextest: just test -# If you specifically want the full `--all-features` matrix, use: +# Avoid `--all-features` for routine local runs because it increases build +# time and `target/` disk usage by compiling additional feature combinations. +# If you specifically want full feature coverage, use: cargo test --all-features ``` diff --git a/justfile b/justfile index 33d62d515b..27ba4fc9c3 100644 --- a/justfile +++ b/justfile @@ -28,10 +28,10 @@ fmt: cargo fmt -- --config imports_granularity=Item 2>/dev/null fix *args: - cargo clippy --fix --all-features --tests --allow-dirty "$@" + cargo clippy --fix --tests --allow-dirty "$@" clippy: - cargo clippy --all-features --tests "$@" + cargo clippy --tests "$@" install: rustup show active-toolchain @@ -41,6 +41,8 @@ install: # --no-fail-fast is important to ensure all tests are run. # # Run `cargo install cargo-nextest` if you don't have it installed. +# Prefer this for routine local runs; use explicit `cargo test --all-features` +# only when you specifically need full feature coverage. test: cargo nextest run --no-fail-fast