diff --git a/CHANGELOG.md b/CHANGELOG.md index b3b8a7b3..d78160d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1445,6 +1445,53 @@ true until the next version shipped. The refusal on a changed source had never been exercised by anyone before this change, only read. It is now driven end to end, along with the three other states. +- The ten suites that recorded nothing now record their checks (#965). + + Ten registered suites print their own `PASS : ` lines and their own + verdict and emit no machine-readable records at all. Counted across the ten, 293 + checks were invisible to every mechanism built on that vocabulary: the ledger, the + census, the count of checks never observed red, the red-observation record, and the + duplicate-name detection. They pass, and nothing that reads records can see them. + + This converts the first of the ten. Its nine checks now emit a record each and a + total, measured on PG18: nine records where there were none, and `checks run: 9` + where there was no total. + + The human output is unchanged, byte for byte. `pgc_record` takes the display whole, + so each line still reads `PASS count(*): 100000` with the measured value rather + than a label. That value is the comparison, not a message, which is why the local + helper records through `pgc_record` rather than delegating to `lib.sh`'s own + `check` -- the latter composes its own display and would drop the value. + + The suite's own verdict line stays, and so does its exit logic. That line is + load-bearing until a reconciliation replaces it: `smoke.sh` runs under + `set -euo pipefail`, so a failing command aborts it, and the verdict is what + distinguishes a suite that finished from one that stopped. Removing it in the same + change would make the suite report less than it did before. + + This converts nine more of the ten, the same way, after the shape was reviewed on + the first. Measured on PG18: 227 records where there were none, and every suite's + human output byte-for-byte unchanged. + + It also fixes a call that was failing silently. `unique_conc.sh` calls `check_skip` + for the case where the citext extension is absent, and that function lives in + `lib.sh`, which the suite did not source -- so the baseline log carries + `line 392: check_skip: command not found`, the suite continued under + `set -uo pipefail`, and the case was reported nowhere at all. It now emits a SKIP + record with its reason. + + Fifty-eight checks across four of the suites are still not recorded -- fifty-eight + on PG18 and fifty-seven on PG16, because one of them sits behind a version gate -- + since those suites have further check-like helpers of their own, `eq_on_off` in + `phase6` alone accounting for thirty-nine, each printing its own display. Those need a + second pass rather than the same substitution, and the count in #965 should be read + as the number of checks rather than the number of helpers. + + It does not add the suite to the ledger. Making a suite coverable and covering it + are separate decisions, and the second one is blocked on a measurement: check NAMES + differ between majors in at least one suite, the ledger has no major dimension, and + a gate seeded from one major would refuse runs on another. + ## [1.0-alpha3] - 2026-09-02 ### Added diff --git a/test/audit.sh b/test/audit.sh index 9879af12..01fae2d9 100755 --- a/test/audit.sh +++ b/test/audit.sh @@ -67,7 +67,10 @@ trap 'rc=$?; if [ "$AUDIT_REACHED_END" = 0 ]; then echo "The checks after the failing command did not run."; fi' EXIT -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -119,12 +122,32 @@ PSQL="psql -p $PORT -d audit -qAtX -v ON_ERROR_STOP=1" q() { run_pg "$PSQL -c \"$1\""; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -389,8 +412,10 @@ q "DROP TABLE ss_dup;" >/dev/null echo AUDIT_REACHED_END=1 if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "AUDIT TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "AUDIT TEST FAILED" echo "---- server log tail ----" run_pg "tail -30 '$LOGFILE'" || true diff --git a/test/concurrency.sh b/test/concurrency.sh index 74561727..51f79cd6 100755 --- a/test/concurrency.sh +++ b/test/concurrency.sh @@ -47,7 +47,10 @@ # portlib.sh alone, not lib.sh: this suite carries its own harness, and the port # band is needed before any of it runs. Sourcing portlib twice is harmless. -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" set -uo pipefail @@ -168,12 +171,32 @@ SPSQL="psql -h '$WORKDIR' -p $PORT -d conc -qAtX" ctl_q() { run_pg "$PSQL -c \"$1\""; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -369,8 +392,10 @@ send s2 "\\q" echo if [ "$fail" = 0 ]; then + echo "checks run: $PGC_CHECKS" echo "CONCURRENCY TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "CONCURRENCY TEST FAILED" fi exit "$fail" diff --git a/test/phase2.sh b/test/phase2.sh index 3a8e4e5d..78c05797 100755 --- a/test/phase2.sh +++ b/test/phase2.sh @@ -15,7 +15,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -68,12 +71,32 @@ q() { run_pg "$PSQL -c \"$1\""; } qq() { run_pg "$PSQL -c \"$1\"" | tr '\n' ',' ; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -193,8 +216,10 @@ check "orphan chunks" "$(q 'SELECT count(*) FROM pgcolumnar.column_chunk;')" echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "PHASE 2 TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "PHASE 2 TEST FAILED" echo "---- server log tail ----" run_pg "tail -40 '$LOGFILE'" || true diff --git a/test/phase3.sh b/test/phase3.sh index a0e02c4b..034e223a 100755 --- a/test/phase3.sh +++ b/test/phase3.sh @@ -17,7 +17,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -77,12 +80,32 @@ q() { run_pg "$PSQL" <<<"$1"; } qq() { run_pg "$PSQL" <<<"$1" | tr '\n' ',' ; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -217,8 +240,10 @@ check "row group cleaned" "$(q 'SELECT count(*) FROM pgcolumnar.row_group;')" "0 echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "PHASE 3 TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "PHASE 3 TEST FAILED" echo "---- server log tail ----" run_pg "tail -40 '$LOGFILE'" || true diff --git a/test/phase4.sh b/test/phase4.sh index 83222d74..70ddbbb8 100755 --- a/test/phase4.sh +++ b/test/phase4.sh @@ -20,7 +20,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -74,12 +77,32 @@ q() { run_pg "$PSQL -c \"$1\""; } qq() { run_pg "$PSQL -c \"$1\"" | tr '\n' ',' ; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -244,8 +267,10 @@ assert_plan_seq echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "PHASE 4 TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "PHASE 4 TEST FAILED" echo "---- server log tail ----" run_pg "tail -60 '$LOGFILE'" || true diff --git a/test/phase5.sh b/test/phase5.sh index 99b11b4b..25575ee6 100755 --- a/test/phase5.sh +++ b/test/phase5.sh @@ -23,7 +23,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -76,12 +79,32 @@ PSQL="psql -p $PORT -d p5 -qAtX -v ON_ERROR_STOP=1" q() { run_pg "$PSQL -c \"$1\""; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -277,8 +300,10 @@ check "seq-scan fallback returns correct rows" \ echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "PHASE 5 TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "PHASE 5 TEST FAILED" echo "---- server log tail ----" run_pg "tail -60 '$LOGFILE'" || true diff --git a/test/phase6.sh b/test/phase6.sh index 915d23cb..b1bc8399 100755 --- a/test/phase6.sh +++ b/test/phase6.sh @@ -27,7 +27,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -80,12 +83,32 @@ PSQL="psql -p $PORT -d p6 -qAtX -v ON_ERROR_STOP=1" q() { run_pg "$PSQL -c \"$1\""; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -252,8 +275,10 @@ fi echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "PHASE 6 TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "PHASE 6 TEST FAILED" echo "---- server log tail ----" run_pg "tail -60 '$LOGFILE'" || true diff --git a/test/smoke.sh b/test/smoke.sh index f50bc1a1..49b43809 100755 --- a/test/smoke.sh +++ b/test/smoke.sh @@ -15,7 +15,10 @@ set -euo pipefail -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here. Its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" PG_CONFIG="${1:-/usr/local/pg17/bin/pg_config}" BINDIR="$("$PG_CONFIG" --bindir)" @@ -99,12 +102,40 @@ ORPHANS="$(run_pg "$PSQL -c \"SELECT count(*) FROM pgcolumnar.row_group;\"")" # ---- check ----------------------------------------------------------------- fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted nine human PASS +# lines and no RESULT records, so every mechanism built on the record vocabulary -- +# the ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all nine. Measured: 0 RESULT lines. +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. `fail` is still set, so this suite's own exit logic is untouched -- +# the verdict line it prints is load-bearing until `checks run:` reconciles, and +# removing it in the same step would make the suite report less than it did before. +# +# NOT lib.sh's own `check`: that composes its own display and would drop the +# `: $got` suffix these lines carry, which is the measured value rather than a +# label. The name and the value are both wanted. +# +# AND THE `checks run:` LINE BELOW IS READ BY NOTHING YET, which is worth saying +# so the next conversion does not add it believing it wired something up +# (@jdatcmd, #969 review). The matrix decides whether to reconcile a suite by +# looking for the ACCOUNTING line -- `run_all_versions.sh` calls +# `pgc_log_shows_accounting`, which greps for +# `accounting: N passed + N failed + N unrunnable + N skipped = N` -- and this +# suite emits none, because it emits no accounting line. Measured: 0 accounting +# lines here against 1 in any suite that does. +# +# The line is still correct and still wanted: it is the total the records +# reconcile against, and `pgc_reconcile_records` returns 0 on this log when driven +# directly. So the remaining step is a gate flip rather than new work -- once +# whatever replaces the verdict line emits the accounting line, reconciliation +# starts working for all ten of these suites with no further change to them. check() { local name="$1" got="$2" want="$3" if [ "$got" = "$want" ]; then - echo "PASS $name: $got" + pgc_record PASS "$name" "PASS $name: $got" else - echo "FAIL $name: got [$got] want [$want]" + pgc_record FAIL "$name" "FAIL $name: got [$got] want [$want]" fail=1 fi } @@ -125,8 +156,10 @@ check "native catalog tables" "$NATIVE_TABLES" "4" echo if [ "$fail" = "0" ]; then + echo "checks run: $PGC_CHECKS" echo "SMOKE TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "SMOKE TEST FAILED" echo "---- server log tail ----" run_pg "tail -30 '$LOGFILE'" || true diff --git a/test/unique_conc.sh b/test/unique_conc.sh index 304119d8..af93dc5a 100755 --- a/test/unique_conc.sh +++ b/test/unique_conc.sh @@ -54,7 +54,10 @@ # Own harness rather than lib.sh; portlib carries the port band. -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" set -uo pipefail @@ -158,11 +161,31 @@ ctl_q() { run_pg "$PSQL -c \"$1\""; } ctl_qe() { run_pg "$SPSQL -c \"$1\" 2>&1"; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { # name got want if [ "$2" = "$3" ]; then - echo "PASS $1: $2" + pgc_record PASS "$1" "PASS $1: $2" else - echo "FAIL $1: got [$2] want [$3]" + pgc_record FAIL "$1" "FAIL $1: got [$2] want [$3]" fail=1 fi } @@ -563,8 +586,10 @@ send sh "\\q" echo if [ "$fail" = 0 ]; then + echo "checks run: $PGC_CHECKS" echo "UNIQUE_CONC TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "UNIQUE_CONC TEST FAILED" fi exit "$fail" diff --git a/test/update_conc.sh b/test/update_conc.sh index 592d2494..201bd05a 100755 --- a/test/update_conc.sh +++ b/test/update_conc.sh @@ -63,7 +63,10 @@ # Own harness rather than lib.sh; portlib carries the port band. -. "$(dirname "${BASH_SOURCE[0]}")/portlib.sh" +# lib.sh for the check vocabulary (#965). It sources portlib.sh itself +# (lib.sh:110), so this is a superset of what was here, and its top level is +# assignments and function definitions only, so sourcing it starts nothing. +. "$(dirname "${BASH_SOURCE[0]}")/lib.sh" set -uo pipefail @@ -156,11 +159,31 @@ SPSQL="psql -h '$WORKDIR' -p $PORT -d upconc -qAtX" ctl_q() { run_pg "$PSQL -c \"$1\""; } fail=0 +# RECORDS RATHER THAN ONLY PRINTING (#965). This suite emitted human PASS lines +# and no RESULT records, so every mechanism built on the record vocabulary -- the +# ledger, the census, checks_never_observed_red, the red-observation record, +# duplicate-name detection -- was blind to all of them. The ledger did not merely +# return nothing on this log, it REFUSED it: "no RESULT records, so there is +# nothing to reconcile". +# +# `pgc_record` takes the DISPLAY whole, so the human output below is byte-for-byte +# what it was. NOT lib.sh's own `check`: that composes its own display and would +# drop the `: $got` suffix, which is the measured value rather than a label. +# +# `fail` is still set, so this suite's exit logic is untouched. Its verdict line +# stays for the same reason: under `set -euo pipefail` a failing command aborts the +# suite, and the verdict is what distinguishes finished from stopped. +# +# The `checks run:` line is READ BY NOTHING YET. The matrix gates reconciliation on +# the ACCOUNTING line via `pgc_log_shows_accounting`, and this suite emits none +# because it emits no accounting line. The line is still correct and wanted -- +# it is the total the records reconcile against -- so the remaining step is a gate +# flip rather than new work (@jdatcmd, #969 review). check() { # name got want if [ "$2" = "$3" ]; then - echo "PASS $1: $2" + pgc_record PASS "$1" "PASS $1: $2" else - echo "FAIL $1: got [$2] want [$3]" + pgc_record FAIL "$1" "FAIL $1: got [$2] want [$3]" fail=1 fi } @@ -453,8 +476,10 @@ send s2 "\\q" echo if [ "$fail" = 0 ]; then + echo "checks run: $PGC_CHECKS" echo "UPDATE CONCURRENCY TEST PASSED" else + echo "checks run: $PGC_CHECKS" echo "UPDATE CONCURRENCY TEST FAILED" fi exit "$fail"