fix(test): scripts/test-commands.sh runs to completion and reports totals (#679) - #684
Merged
Merged
Conversation
…tals (#679) The suite CLAUDE.md points at for every new command had never printed a result. It died partway through, silently, and the operator saw a truncated log instead of a summary. It now finishes: 504 rows, 478 passing. The 26 remaining failures are pre-existing and are filed as #683 -- they became visible for the first time because the run now reaches them. Nothing here weakens an assertion to get a green. Every abort was the same bash shape: a command whose non-zero status `set -euo pipefail` converts into a silent exit. grep exits 1 when it matches nothing, lsof exits 1 when a port is free, pkill exits 1 when nothing matched, and a shell function whose last statement is a false `if` returns 1 as well. Because that failure prints nothing at all, each instance hid the next -- which is why this took several rounds, and why two of the guards below are for aborts introduced by earlier ones in this same commit. Guarded: * 26 command substitutions ending in grep. The reported NUMERIC-07 site was one of a class, so the class is fixed rather than the instance. * 6 raw redis-cli pipelines and all four client wrappers, so a dead server yields failing rows plus a summary instead of a truncated log. Nothing in the file branches on those wrappers' exit status (checked: no `if mcli` and no `mcli ... &&` anywhere), so `|| true` costs no signal. * `cargo build ... 2>/dev/null`, which threw away the reason a build failed and left the log reading "Building moon..." and nothing else. * the cleanup trap, which returned its last kill's status rather than the script's -- reporting a clean run as a failure. Three defects that produced wrong results rather than aborts: * `grep -Pzo "(?s)A.*B"` at 13 call sites is GNU-only. On a macOS host grep is ugrep, which rejects -P and exits 2; since those rows compare output rather than status, that 2 was being reported as moon's answer. Replaced with a portable spans() helper. * No --dir, so moon treated the CWD as its data dir: the suite wrote appendonlydir/ and moon.lock into the repo root and reloaded the previous run's FT index definitions, so a second run failed with "Index already exists". Each run now gets a fresh mktemp dir, removed on exit. * No port pre-flight. A leftover server from an unrelated run answers and every row silently compares against it. Not hypothetical: it produced a full run of MOONERR diskfull failures traced to another session's moon on the port. The suite now refuses to start on an occupied port and names the holder. The `FT.CREATE ... VECTOR FLAT` row expected OK, but moon has only ever implemented HNSW (ERR expected HNSW algorithm, in ft_create.rs since #27), so it had failed from the day it was written and took four dependent rows with it. It now builds an HNSW index, and the FLAT gap is asserted explicitly instead of hiding inside a row that expected success. Added a regression row for #681 asserting the server is still alive after a truncated FT.CREATE. Proven in both directions: it fails against a pre-#682 binary and passes after. CLAUDE.md's "190 tests" was stale by more than half. Fixes #679 Refs #681, #682, #683 author: Tin Dang
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Warning Review limit reachedNext included review available in 20 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #679.
What was wrong
scripts/test-commands.shis the suite CLAUDE.md points at for every newcommand, and it had never printed a result. It died partway through, silently,
and the operator saw a truncated log instead of a summary.
What it does now
The 26 are pre-existing and are filed separately as #683. They became
visible for the first time because the run now reaches them — I verified each
one against the session-start log rather than assuming. Nothing here weakens
an assertion to manufacture a green; three rows that were failing do pass now
(
FT.CREATE basic,FT.INFO returns index name,FT.DROPINDEX), because theFLAT bug below was the cause.
Why one report became a sweep
Every abort was the same bash shape: a command whose non-zero status
set -euo pipefailconverts into a silent exit.grepexits 1 when it matchesnothing,
lsofexits 1 when a port is free,pkillexits 1 when nothingmatched, and a shell function whose last statement is a false
ifreturns 1too. That failure prints nothing at all, so each instance hid the next. Two of
the guards in this PR are for aborts I introduced while fixing earlier ones
in the same class — both found with
bash -x, not by reading.Guarded: 26 command substitutions ending in
grep(the reported NUMERIC-07site was one of a class, so the class is fixed); 6 raw
redis-clipipelinesand all four client wrappers, so a dead server yields failing rows plus a
summary instead of a truncated log;
cargo build ... 2>/dev/null, which threwaway the reason a build failed; and the
cleanuptrap, which returned its lastkill's status rather than the script's — reporting a clean run as a failure.On the wrappers: nothing in the file branches on their exit status (checked —
no
if mcli ...and nomcli ... &&anywhere), so|| truecosts no signal.Three defects behind wrong results, not aborts
grep -Pzo "(?s)A.*B"at 13 call sites is GNU-only. On a macOS hostgrepis ugrep, which rejects
-Pand exits 2 — and since those rows compare outputrather than status, that
2was being reported as moon's answer. Replaced witha portable
spans()helper.No
--dir, so moon used the CWD. The suite wroteappendonlydir/andmoon.lockinto the repo root and reloaded the previous run's FT indexdefinitions, so a second run failed with
ERR Index already exists. Each runnow gets a fresh
mktempdir, removed on exit.No port pre-flight. A leftover server from an unrelated run answers, and
every row silently compares against it. Not hypothetical: it produced a full
run of
MOONERR diskfullfailures that I initially misattributed to my own--dirchange, until an A/B cleared the flag andlsofnamed anothersession's moon on the port. The suite now refuses to start on an occupied port
and names the holder.
The FLAT row
FT.CREATE ... VECTOR FLATexpectedOK, but moon has only ever implementedHNSW (
ERR expected HNSW algorithm, inft_create.rssince #27) — so that rowhad failed from the day it was written, and took four dependent rows down with
it. It now builds an HNSW index, and the FLAT gap is asserted explicitly
instead of hiding inside a row that expected success.
Regression coverage
Added a row for #681 (truncated
FT.CREATEaborting the process) asserting theserver is still alive afterwards. Mutation-proven in both directions: it FAILS
against a pre-#682 binary and PASSES after.
Also
CLAUDE.md's "190 tests across 13 categories" was stale by more than half.Gates
bash -nclean; full suite run to completion on a macOS host (the platformwhere
grep -Pwas the blocker).scripts/ci-local.sh+ the full dispatch matrix before merge.