diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-09 16:24:39 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-09 20:26:39 -0400 |
| commit | bc65ad14264e18aabe9711476e99500b4c4bcf76 (patch) | |
| tree | 4b6a7461b4c99795b54f8eebb404c342ac60868b | |
| parent | ssp: abstraction directory cleared once (diff) | |
test: fix, a skipped check is not a pass
fix of a couple of issues with tests.
test-search-cgi.sh reported PASS while printing "Schema version gate:
skipped, sqlite3 not on PATH", and the values it searches for were the
hardcoded fallbacks rather than values read out of the database it had
just built. Both halves need sqlite3, both are checks, and a run that
leaves them out still exits 0. The other three scripts re-run
themselves under nix shell "nixpkgs#sqlite"; this one now does the
same. sqlite3 is still not required: with neither sqlite3 nor nix the
test runs as before and says what it skipped.
test-abstraction-ssp.sh depends on --abstraction for its meaning, and
nothing in it said so. --show-abstraction does not appear in spine's
parallelise() list, so dropping that one flag turns the current run
serial, and the parallel-versus-serial comparison below it then
compares a serial run with itself - the guard gone, with nothing
failing to report it. That is how the multi-lingual write race survived.
A comment at the call now says not to drop it.
(assisted by Claude-Code)
| -rw-r--r-- | org/tests_for_document_abstraction_shell_scripts.org | 16 | ||||
| -rwxr-xr-x | test/test-abstraction-ssp.sh | 4 | ||||
| -rwxr-xr-x | test/test-search-cgi.sh | 12 |
3 files changed, 32 insertions, 0 deletions
diff --git a/org/tests_for_document_abstraction_shell_scripts.org b/org/tests_for_document_abstraction_shell_scripts.org index 30771be..932f1cd 100644 --- a/org/tests_for_document_abstraction_shell_scripts.org +++ b/org/tests_for_document_abstraction_shell_scripts.org @@ -232,6 +232,10 @@ fi echo "Generating current .ssp files..." rm -rf "$TMP_DIR" mkdir -p "$TMP_DIR" +# --abstraction is what puts this run in parallel: --show-abstraction on its +# own does not appear in spine's parallelise() list, so it runs serially and +# the parallel-vs-serial comparison below would compare a serial run with +# itself. Do not drop it. $SPINE_BIN --abstraction --show-abstraction --skip-output --output="$SCRIPT_DIR/current" "$SAMPLES_DIR"/* 2>&1 | tail -1 # flatten find "$SCRIPT_DIR/current" -name "*.ssp" ! -path "$TMP_DIR/*" -exec mv {} "$TMP_DIR/" \; @@ -973,6 +977,18 @@ set -e SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SPINE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +# sqlite3 is not required here: the parts that use it fall back to fixed probe +# values and to skipping the schema version gate. Both are checks, though, and +# a run that quietly leaves them out still says PASS, so where sqlite3 is +# absent and nix is to hand, re-run inside a nix shell that has it. With +# neither, the test runs as before and says what it skipped. +if ! command -v sqlite3 > /dev/null 2>&1; then + if command -v nix > /dev/null 2>&1; then + echo "sqlite3 not on PATH, re-running inside nix shell \"nixpkgs#sqlite\"" + exec nix shell "nixpkgs#sqlite" -c "$0" "$@" + fi +fi + SPINE_BIN="${1:-}" if [ -z "$SPINE_BIN" ]; then if [ -x "$SPINE_DIR/result/bin/spine" ]; then SPINE_BIN="$SPINE_DIR/result/bin/spine" diff --git a/test/test-abstraction-ssp.sh b/test/test-abstraction-ssp.sh index 133cfb6..bb44d1c 100755 --- a/test/test-abstraction-ssp.sh +++ b/test/test-abstraction-ssp.sh @@ -104,6 +104,10 @@ fi echo "Generating current .ssp files..." rm -rf "$TMP_DIR" mkdir -p "$TMP_DIR" +# --abstraction is what puts this run in parallel: --show-abstraction on its +# own does not appear in spine's parallelise() list, so it runs serially and +# the parallel-vs-serial comparison below would compare a serial run with +# itself. Do not drop it. $SPINE_BIN --abstraction --show-abstraction --skip-output --output="$SCRIPT_DIR/current" "$SAMPLES_DIR"/* 2>&1 | tail -1 # flatten find "$SCRIPT_DIR/current" -name "*.ssp" ! -path "$TMP_DIR/*" -exec mv {} "$TMP_DIR/" \; diff --git a/test/test-search-cgi.sh b/test/test-search-cgi.sh index 7541a92..1667a43 100755 --- a/test/test-search-cgi.sh +++ b/test/test-search-cgi.sh @@ -37,6 +37,18 @@ set -e SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SPINE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +# sqlite3 is not required here: the parts that use it fall back to fixed probe +# values and to skipping the schema version gate. Both are checks, though, and +# a run that quietly leaves them out still says PASS, so where sqlite3 is +# absent and nix is to hand, re-run inside a nix shell that has it. With +# neither, the test runs as before and says what it skipped. +if ! command -v sqlite3 > /dev/null 2>&1; then + if command -v nix > /dev/null 2>&1; then + echo "sqlite3 not on PATH, re-running inside nix shell \"nixpkgs#sqlite\"" + exec nix shell "nixpkgs#sqlite" -c "$0" "$@" + fi +fi + SPINE_BIN="${1:-}" if [ -z "$SPINE_BIN" ]; then if [ -x "$SPINE_DIR/result/bin/spine" ]; then SPINE_BIN="$SPINE_DIR/result/bin/spine" |
