test(16.2-07): gate requires the conformance inventory, the purge suites and a cache stage

- go stage: TestPhase10ConformanceInventory (Docker-free), and the Journal
  TestSiteCachePurgeConfig and TestSiteCachePurgeRequest by name
- postgres stage: TestPhase10OpenAPIConformance and the Journal
  TestCategoriesAdminPurgesSiteCache and TestPostsAdminPurgesSiteCache
- layer stage: the four site cache purge tests by name
- new cache stage: playground build, purge-check, then the acme SSR smoke
  on the same route-cached build
This commit is contained in:
2026-10-10 18:44:34 +02:00
parent 11be08d680
commit ee624100ef

View File

@@ -5,21 +5,34 @@
# #
# Stages: # Stages:
# go go vet in both Go repositories; the framework's field type tests # go go vet in both Go repositories; the framework's field type tests
# and the Journal classes and controllers tests (including the # and the Docker-free admin route conformance inventory
# editor-corpus policy cross-check); the 16.1 policy test files # (TestPhase10ConformanceInventory: every inventoried admin route
# must be unchanged since c60abc6. # has a conformance case); the Journal classes and controllers
# tests (including the editor-corpus policy cross-check and the
# site cache purger, TestSiteCachePurgeConfig and
# TestSiteCachePurgeRequest); the 16.1 policy test files must be
# unchanged since c60abc6.
# admin the admin SPA typecheck and full vitest suite. # admin the admin SPA typecheck and full vitest suite.
# editor the Blog Editor typecheck and full vitest suite (smoke, corpus, # editor the Blog Editor typecheck and full vitest suite (smoke, corpus,
# preview, element, schema, serializer, embed). # preview, element, schema, serializer, embed).
# layer the vue-journal-layer node --test suite and the editor corpus # layer the vue-journal-layer node --test suite (including the site
# copy, which must equal the plugin's byte for byte (cmp). # cache purge tests) and the editor corpus copy, which must equal
# the plugin's byte for byte (cmp).
# cache builds the layer playground (routeRules swr) and runs
# testing/purge-check.mjs on it (post hello-acme at
# /blog/hello-acme: a cached page shows a change on the first
# request after an authorized purge, guards refuse the rest), then
# the acme SSR smoke against the same build.
# docs TestDocsTree, the admin OpenAPI and dist drift gates and the # docs TestDocsTree, the admin OpenAPI and dist drift gates and the
# plugin's assets/dist drift gate. # plugin's assets/dist drift gate.
# postgres Docker host only: the testcontainers suites (cabana, including # postgres Docker host only: the testcontainers suites (cabana, including
# TestFieldTypeSavePostgres; the Journal admin harness, including # TestFieldTypeSavePostgres and TestPhase10OpenAPIConformance; the
# TestPostsAdminResaveKeepsHTML, TestPostsAdminSaveSanitizesHTML, # Journal admin harness, including TestPostsAdminResaveKeepsHTML,
# TestCategoriesAdminContent and TestCategoriesAdminBlogEditor). # TestPostsAdminSaveSanitizesHTML, TestCategoriesAdminContent,
# Without a reachable Docker daemon this stage fails. # TestCategoriesAdminBlogEditor, TestJournalSVGEmbed and the site
# cache purge suites TestCategoriesAdminPurgesSiteCache and
# TestPostsAdminPurgesSiteCache). Without a reachable Docker daemon
# this stage fails.
# #
# Every stage exits non-zero on a failing command; a go test -json run that # Every stage exits non-zero on a failing command; a go test -json run that
# fails, skips, matches zero tests, prints "no tests to run" or misses a named # fails, skips, matches zero tests, prints "no tests to run" or misses a named
@@ -29,7 +42,7 @@
# test. --self-test proves the detectors and the corpus comparison fail on # test. --self-test proves the detectors and the corpus comparison fail on
# planted output. # planted output.
# #
# --all runs self-test, go, admin, editor, layer and docs, then postgres when # --all runs self-test, go, admin, editor, layer, cache and docs, then postgres when
# a Docker daemon answers. When none does, --all says so loudly (NOT RUN # a Docker daemon answers. When none does, --all says so loudly (NOT RUN
# postgres) and the Docker suites stay a manual step for a Docker host: # postgres) and the Docker suites stay a manual step for a Docker host:
# bash scripts/check-phase16.2.sh postgres # bash scripts/check-phase16.2.sh postgres
@@ -48,7 +61,7 @@ LAYER="${LAYER:-$ROOT/../vue-journal-layer}"
POLICY_BASE="c60abc6" POLICY_BASE="c60abc6"
# Framework tests (modules/pact, modules/cabana) that must pass by name. # Framework tests (modules/pact, modules/cabana) that must pass by name.
FRAMEWORK_RUN='^(TestFormFieldErrorMessage|TestFormFieldTypeContract|TestFieldTypeRegistry|TestFieldTypeOptions|TestFieldTypeCompile|TestFieldTypeDecode|TestFieldTypeNotices|TestFieldTypeUntouched|TestFieldTypeLoad|TestFieldTypeListValue|TestFieldTypeWrites|TestFieldTypesRoute|TestFieldUpload|TestFieldTypeTracerSmoke|TestFieldTypeExpansionSmoke|TestPhase10CSRF|TestPhase09ContractInventory|TestPhase09PermissionMatrix|ExampleCompileFormWithTypes)$' FRAMEWORK_RUN='^(TestFormFieldErrorMessage|TestFormFieldTypeContract|TestFieldTypeRegistry|TestFieldTypeOptions|TestFieldTypeCompile|TestFieldTypeDecode|TestFieldTypeNotices|TestFieldTypeUntouched|TestFieldTypeLoad|TestFieldTypeListValue|TestFieldTypeWrites|TestFieldTypesRoute|TestFieldUpload|TestFieldTypeTracerSmoke|TestFieldTypeExpansionSmoke|TestPhase10CSRF|TestPhase09ContractInventory|TestPhase09PermissionMatrix|TestPhase10ConformanceInventory|ExampleCompileFormWithTypes)$'
FRAMEWORK_REQUIRE=( FRAMEWORK_REQUIRE=(
TestFormFieldErrorMessage TestFormFieldTypeContract TestFormFieldErrorMessage TestFormFieldTypeContract
TestFieldTypeRegistry TestFieldTypeOptions TestFieldTypeCompile TestFieldTypeDecode TestFieldTypeRegistry TestFieldTypeOptions TestFieldTypeCompile TestFieldTypeDecode
@@ -56,6 +69,7 @@ FRAMEWORK_REQUIRE=(
TestFieldTypeWrites TestFieldTypesRoute TestFieldUpload TestFieldTypeWrites TestFieldTypesRoute TestFieldUpload
TestFieldTypeTracerSmoke TestFieldTypeExpansionSmoke TestFieldTypeTracerSmoke TestFieldTypeExpansionSmoke
TestPhase10CSRF TestPhase09ContractInventory TestPhase09PermissionMatrix TestPhase10CSRF TestPhase09ContractInventory TestPhase09PermissionMatrix
TestPhase10ConformanceInventory
ExampleCompileFormWithTypes ExampleCompileFormWithTypes
) )
# Journal classes and controllers tests that must pass by name (the packages # Journal classes and controllers tests that must pass by name (the packages
@@ -68,13 +82,15 @@ JOURNAL_REQUIRE=(
TestMediaObjectPath TestMediaFolderPatternRejectsDotDot TestMediaObjectPath TestMediaFolderPatternRejectsDotDot
TestPostsEditorHooks TestBlogEditorTracerSmoke TestBlogEditorUploadSmoke TestPostsEditorHooks TestBlogEditorTracerSmoke TestBlogEditorUploadSmoke
TestWriteMediaStoreError TestWriteMediaStoreError
TestSiteCachePurgeConfig TestSiteCachePurgeRequest
) )
# Docker-host suites. # Docker-host suites.
PG_FRAMEWORK_REQUIRE=(TestFieldTypeSavePostgres TestListRelationSearchPostgres) PG_FRAMEWORK_REQUIRE=(TestFieldTypeSavePostgres TestListRelationSearchPostgres TestPhase10OpenAPIConformance)
PG_JOURNAL_REQUIRE=( PG_JOURNAL_REQUIRE=(
TestPostsFormCompiles TestPostsAdminCreateSmoke TestPostsAdminResaveKeepsHTML TestPostsFormCompiles TestPostsAdminCreateSmoke TestPostsAdminResaveKeepsHTML
TestPostsAdminSaveSanitizesHTML TestCategoriesAdminContent TestCategoriesAdminBlogEditor TestPostsAdminSaveSanitizesHTML TestCategoriesAdminContent TestCategoriesAdminBlogEditor
TestJournalSVGEmbed TestJournalSVGEmbed
TestCategoriesAdminPurgesSiteCache TestPostsAdminPurgesSiteCache
) )
ADMIN_FILES=( ADMIN_FILES=(
@@ -107,14 +123,18 @@ LAYER_REQUIRE=(
"the sinks expand after sanitizing and the payload transforms never expand" "the sinks expand after sanitizing and the payload transforms never expand"
"the Go policy negatives are stripped the same way here" "the Go policy negatives are stripped the same way here"
"the editor corpus has the entries the mirror rules are for" "the editor corpus has the entries the mirror rules are for"
"purge auth: a missing or short token disables the route"
"purge auth: a proxied request is refused before the token is checked"
"purge auth: a missing or wrong bearer token is unauthorized"
"purge removes every route cache entry and only those"
) )
usage() { usage() {
cat >&2 <<'EOF' cat >&2 <<'EOF'
usage: usage:
check-phase16.2.sh --self-test check-phase16.2.sh --self-test
check-phase16.2.sh go | admin | editor | layer | docs | postgres check-phase16.2.sh go | admin | editor | layer | cache | docs | postgres
check-phase16.2.sh --go | --admin | --editor | --layer | --docs | --postgres check-phase16.2.sh --go | --admin | --editor | --layer | --cache | --docs | --postgres
check-phase16.2.sh --all check-phase16.2.sh --all
EOF EOF
exit 2 exit 2
@@ -434,7 +454,7 @@ ok 1 - a
rm -f "$a" "$b" rm -f "$a" "$b"
local mode local mode
for mode in self-test go admin editor layer docs postgres all; do for mode in self-test go admin editor layer cache docs postgres all; do
grep -q -- "^ --$mode" "${BASH_SOURCE[0]}" || { grep -q -- "^ --$mode" "${BASH_SOURCE[0]}" || {
echo "refuse: missing mode --$mode" >&2 echo "refuse: missing mode --$mode" >&2
return 1 return 1
@@ -484,6 +504,28 @@ run_layer() {
echo "phase16.2 layer passed" echo "phase16.2 layer passed"
} }
# run_cache proves the site cache purge end to end on the layer playground,
# whose routeRules cache every page, then runs the acme SSR smoke against the
# same build.
run_cache() {
require_dir "$LAYER" "layer repository"
local log rc=0
pnpm -C "$LAYER" run build:playground >/dev/null
log="$(mktemp)"
node "$LAYER/testing/purge-check.mjs" --output "$LAYER/.playground/.output" --fixtures "$LAYER/testing/fixtures/acme" \
--kind post --slug hello-acme --path /blog/hello-acme >"$log" 2>&1 || rc=$?
if [[ "$rc" -ne 0 ]] || ! tail -n 1 "$log" | grep -q '^purge-check: ok'; then
cat "$log" >&2
rm -f "$log"
echo "refuse: purge-check on the layer playground (exit $rc)" >&2
return 1
fi
tail -n 1 "$log"
rm -f "$log"
node "$LAYER/testing/smoke-ssr.mjs" --output "$LAYER/.playground/.output" --fixtures "$LAYER/testing/fixtures/acme" --expect "$LAYER/testing/expect-acme.txt"
echo "phase16.2 cache passed"
}
run_docs() { run_docs() {
require_dir "$JOURNAL" "Journal plugin" require_dir "$JOURNAL" "Journal plugin"
REQUIRE_TESTS="TestDocsTree" go_json "$ROOT" -count=1 -run '^TestDocsTree$' ./cmd/summer REQUIRE_TESTS="TestDocsTree" go_json "$ROOT" -count=1 -run '^TestDocsTree$' ./cmd/summer
@@ -510,7 +552,7 @@ run_postgres() {
run_all() { run_all() {
local stage local stage
for stage in self-test go admin editor layer docs; do for stage in self-test go admin editor layer cache docs; do
if bash "${BASH_SOURCE[0]}" "--$stage"; then if bash "${BASH_SOURCE[0]}" "--$stage"; then
echo "PASS $stage" echo "PASS $stage"
else else
@@ -532,9 +574,11 @@ run_all() {
cat >&2 <<'EOF' cat >&2 <<'EOF'
************************************************************************ ************************************************************************
NOT RUN postgres: no reachable Docker daemon on this host. NOT RUN postgres: no reachable Docker daemon on this host.
The testcontainers suites (TestFieldTypeSavePostgres, the Journal admin The testcontainers suites (TestFieldTypeSavePostgres,
harness incl. TestPostsAdminResaveKeepsHTML, TestPostsAdminSaveSanitizesHTML, TestPhase10OpenAPIConformance, the Journal admin harness incl.
TestCategoriesAdminContent, TestCategoriesAdminBlogEditor) did NOT run. TestPostsAdminResaveKeepsHTML, TestPostsAdminSaveSanitizesHTML,
TestCategoriesAdminContent, TestCategoriesAdminBlogEditor, TestJournalSVGEmbed
and the site cache purge suites) did NOT run.
Run on a Docker host before /msd-verify-work: Run on a Docker host before /msd-verify-work:
bash scripts/check-phase16.2.sh postgres bash scripts/check-phase16.2.sh postgres
************************************************************************ ************************************************************************
@@ -550,6 +594,7 @@ case "${1:---all}" in
--admin | admin) run_admin ;; --admin | admin) run_admin ;;
--editor | editor) run_editor ;; --editor | editor) run_editor ;;
--layer | layer) run_layer ;; --layer | layer) run_layer ;;
--cache | cache) run_cache ;;
--docs | docs) run_docs ;; --docs | docs) run_docs ;;
--postgres | postgres) run_postgres ;; --postgres | postgres) run_postgres ;;
--all | all) run_all ;; --all | all) run_all ;;