From c2c8b0f3973ce06e2becb56dce3986206817dd61 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 12 Mar 2026 11:36:27 -0400 Subject: [PATCH] nextest --- .cargo/config.toml | 2 ++ hacking.md | 15 +++++++++++++++ test-quiet.sh | 11 +++++++++++ 3 files changed, 28 insertions(+) create mode 100644 .cargo/config.toml create mode 100755 test-quiet.sh diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..8b2e039 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +t = "nextest run" diff --git a/hacking.md b/hacking.md index c21b237..0a9dbab 100644 --- a/hacking.md +++ b/hacking.md @@ -35,6 +35,21 @@ $ cargo test && cargo fmt && cargo clippy - TODO: configure tangled CI to run these on PR +#### nextest + +the full test suite should run in single-digit seconds on a fast machine, but you can make it go slightly faster (and with prettier output) with [`cargo-nextest`](https://nexte.st/) + +```bash +$ cargo install cargo-nextest --locked +``` + +then do `cargo nextest run`. or `cargo t` -- aliased in `./cargo/config.toml`. + +if your terminal makes annoying noisy output for BEL chars like mine does (which, nextest outputs many!!), there's a wrapper to strip them, `./test-quiet.sh`. + +the wrapper also sets the concurrency to CPUs * 3 which seems to be the fastest for this test suite for me. if you're not using the wrapper, you can do it manually like `cargo t -j 30`. + + ## current implementation status lightrail is like 4% interesting approach to `listReposByCollection` and 96% just a sync1.1 implementation. diff --git a/test-quiet.sh b/test-quiet.sh new file mode 100755 index 0000000..26fa543 --- /dev/null +++ b/test-quiet.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# with all the db setup/teardown, this suite runs best with 3x cpu jobs for me +cpus=$(sysctl -n hw.logicalcpu 2>/dev/null || nproc 2>/dev/null) +jobs_arg=$( [ -n "$cpus" ] && echo "-j $(( cpus * 3 ))" ) + +# strip BEL chars that are noisy in some terminals, without losing everything +# shellcheck disable=SC2086 # $jobs_arg intentionally unquoted +cargo nextest run --color=always $jobs_arg "$@" 2>&1 | tr -d '\007' + +exit "${PIPESTATUS[0]}" -- 2.51.2