Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ test/native_writer.sh /path/to/pg_config # native format catalog output
test/native_roundtrip.sh /path/to/pg_config # native write then read round-trip
test/native_encoding.sh /path/to/pg_config # native per-vector encoding cascade
test/native_zonemap.sh /path/to/pg_config # native zone maps
test/write_minmax_fastpath.sh /path/to/pg_config # direct zone min/max comparison
test/native_skip.sh /path/to/pg_config # native chunk and vector skipping
test/native_agg.sh /path/to/pg_config # native aggregate paths
test/native_agg_deletes.sh /path/to/pg_config # per-row-group fold when rows are deleted
Expand Down
52 changes: 52 additions & 0 deletions test/harness_selftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,56 @@ _verdict="$(pgc_cluster_is_ours && echo ours || echo foreign)"
PGC_PORT="$_saved_port"
check "guard rejects a foreign cluster" "$_verdict" "foreign"

# ---------------------------------------------------------------------------
# Every suite must be registered in the matrix.
#
# A suite that run_all_versions.sh does not list is never run by any gate. It
# passes review, it sits in the tree, and the first change to the code under it
# breaks it silently. This has happened repeatedly: four consecutive PRs added a
# suite without registering it, and two older suites (native_reclaim_reconcile
# among them) had never been run by a gate at all.
#
# The allowlist is deliberately short and each entry needs a reason, because the
# easy way to satisfy this check is to add a name to it.
# ---------------------------------------------------------------------------

TESTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RUNNER="$TESTDIR/run_all_versions.sh"

# Not suites: the shared library, the runner itself, and the two developer
# helpers that build rather than test. native_scale is a suite but is opt-in by
# design and says so in its own header: it runs at a row count the matrix should
# not carry.
not_a_suite() {
case "$1" in
lib|run_all_versions|devloop|rebuild|native_scale) return 0 ;;
*) return 1 ;;
esac
}

# the SUITES=( ... ) array, flattened to one name per line
listed_suites() {
awk '/^SUITES=\(/,/\)/' "$RUNNER" | tr ' \t' '\n\n' |
sed -e 's/^SUITES=(//' -e 's/)$//' -e 's/\\$//' |
grep -E '^[a-z0-9_]+$'
}

unregistered=""
for f in "$TESTDIR"/*.sh; do
name="$(basename "$f" .sh)"
not_a_suite "$name" && continue
listed_suites | grep -qx "$name" || unregistered="$unregistered $name"
done
check "every suite is registered in run_all_versions.sh" \
"$([ -z "$unregistered" ] && echo none || echo "unregistered:$unregistered")" "none"

# The reverse: a name in SUITES with no file is a rename or a typo, and the
# runner would report it as a failure only when it tried to run it.
missing_file=""
while read -r name; do
[ -f "$TESTDIR/$name.sh" ] || missing_file="$missing_file $name"
done < <(listed_suites)
check "every registered suite has a file" \
"$([ -z "$missing_file" ] && echo none || echo "missing:$missing_file")" "none"

pgc_summary
2 changes: 1 addition & 1 deletion test/run_all_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SUITES=(harness_selftest smoke phase2 phase3 phase4 phase5 phase6 audit concurrency unique_conc \
differential recovery fuzz hardening concurrent_diff parallel sorted_projection \
arrow_export parquet_export read_stream corruption \
generated_columns temporal arrow_import index_only projections arrow_nested parquet_import parquet_nested arrow_nested_import parquet_nested_import native_writer native_roundtrip native_encoding native_zonemap native_skip native_agg native_agg_deletes native_bloom native_vecskip native_index native_fetch_position native_dml native_ios native_projection native_cluster native_compact native_recluster native_reclaim native_ownership native_reclaim_cycles native_reclaim_frag native_gap native_truncate native_rewrite native_rewrite_conc native_parquet_schema native_read_parquet native_parquet_fdw native_parquet_pushdown native_parquet_hardening native_parquet_units native_parquet_flba native_parquet_codecs native_parquet_projection native_parquet_multifile native_parquet_streaming native_parquet_partition native_cancel wal_envelope decode_interrupts native_fetch_cache isolation)
generated_columns temporal arrow_import index_only projections arrow_nested parquet_import parquet_nested arrow_nested_import parquet_nested_import native_writer native_roundtrip native_encoding native_zonemap write_minmax_fastpath native_skip native_agg native_agg_deletes native_bloom native_vecskip native_index native_fetch_position native_dml native_ios native_projection native_cluster native_compact native_recluster native_reclaim native_ownership native_reclaim_cycles native_reclaim_frag native_reclaim_reconcile native_gap native_truncate native_rewrite native_rewrite_conc native_parquet_schema native_read_parquet native_parquet_fdw native_parquet_pushdown native_parquet_hardening native_parquet_units native_parquet_flba native_parquet_codecs native_parquet_projection native_parquet_multifile native_parquet_streaming native_parquet_partition native_cancel wal_envelope decode_interrupts native_fetch_cache isolation)

# Default matrix: one assert-enabled pg_config per major, 15 through 19.
DEFAULT_CONFIGS=(
Expand Down