diff --git a/scripts/check-phase19.3.sh b/scripts/check-phase19.3.sh index 0f44da1..7f33629 100755 --- a/scripts/check-phase19.3.sh +++ b/scripts/check-phase19.3.sh @@ -117,6 +117,51 @@ DOCKER_COOLER_TESTS=( TestSiteCacheAfterCommitOnly TestSiteCacheFailureNeverFails ) +DOCKER_FAQ_TESTS=(TestFaqAdminPurgesSiteCache) +DOCKER_MENU_TESTS=(TestMenuAdminPurgesSiteCache) +DOCKER_JOURNAL_TESTS=( + TestCategoriesAdminPurgesSiteCache + TestPostsAdminPurgesSiteCache + TestCategoriesAdminFrameworkKeysWin +) + +# plugins stage: the purge helpers and the Journal's deprecated keys (-short). +FAQ_CONTROLLERS_TESTS=( + TestPurgeSiteCacheWithoutTx + TestPurgeSiteCacheWithoutPurger +) +MENU_CONTROLLERS_TESTS=("${FAQ_CONTROLLERS_TESTS[@]}") +JOURNAL_ROOT_TESTS=( + TestSiteCacheFrameworkKeysWin + TestSiteCacheAliasKeysDeprecated + TestSiteCacheNoKeys +) +JOURNAL_CLASSES_TESTS=(TestSiteCachePurgeConfig TestSiteCachePurgeRequest) + +# layers stage: the shared purge spec, byte-identical in the three layers. +LAYER_REQUIRE=( + "sitePurge: the shared files match the pinned hashes" + "sitePurge: a missing or short token disables the route" + "sitePurge: a proxied request is refused before the token is checked" + "sitePurge: authorize ok with the token and unauthorized otherwise" + "sitePurge: purge removes only nitro:routes: keys" + "sitePurge: purge event kinds and slugs" + "sitePurge: ok in constant time over sha256 digests, whatever the bearer length" + "sitePurge: purge works with a synchronous storage and skips the bare base key" + "sitePurge: purge event edge cases" + "sitePurge: route answers 404 when disabled or proxied and 401 for a wrong bearer" + "sitePurge: route purges, answers the count and logs kind and slug only" +) +# Files every layer ships byte for byte. +LAYER_SHARED=( + server/lib/siteCachePurge.ts + server/api/__site__/cache/purge.post.ts + tests/sitePurge.test.ts +) + +# docs stage: names of consuming applications that framework lines added by +# this phase must not carry (split so this file does not match itself). +APP_NAMES=("fono""teka" "p[lł]yta""rium" "grzy""by" "summercms""io" "wave""path" "stu""dia") usage() { cat >&2 <<'EOF' @@ -368,11 +413,6 @@ require_dir() { } } -not_wired() { - echo "refuse: stage $1 is not wired yet" >&2 - return 1 -} - run_go() { (cd "$ROOT" && go vet ./...) echo "vet: $ROOT" @@ -400,19 +440,115 @@ run_docker() { go_named "$ROOT" ./modules/cabana "-timeout 20m" "${DOCKER_CABANA_TESTS[@]}" go_named "$ROOT" ./modules/lagoon/attach "-timeout 20m" "${DOCKER_ATTACH_TESTS[@]}" go_named "$ROOT" ./modules/cooler "-timeout 20m" "${DOCKER_COOLER_TESTS[@]}" + require_dir "$FAQ_PLUGIN" "FAQ plugin" + require_dir "$MENU_PLUGIN" "menu plugin" + require_dir "$JOURNAL_PLUGIN" "Journal plugin" + go_named "$FAQ_PLUGIN" . "-timeout 20m" "${DOCKER_FAQ_TESTS[@]}" + go_named "$MENU_PLUGIN" . "-timeout 20m" "${DOCKER_MENU_TESTS[@]}" + go_named "$JOURNAL_PLUGIN" . "-timeout 20m" "${DOCKER_JOURNAL_TESTS[@]}" echo "phase19.3 docker passed" } run_plugins() { - not_wired plugins + require_dir "$FAQ_PLUGIN" "FAQ plugin" + require_dir "$MENU_PLUGIN" "menu plugin" + require_dir "$JOURNAL_PLUGIN" "Journal plugin" + local repo + for repo in "$FAQ_PLUGIN" "$MENU_PLUGIN" "$JOURNAL_PLUGIN"; do + go -C "$repo" vet ./... + echo "vet: $repo" + # The Docker suites skip here and run by name in the docker stage. + go_short "$repo" + done + go_named "$FAQ_PLUGIN" ./controllers -short "${FAQ_CONTROLLERS_TESTS[@]}" + go_named "$MENU_PLUGIN" ./controllers -short "${MENU_CONTROLLERS_TESTS[@]}" + go_named "$JOURNAL_PLUGIN" . -short "${JOURNAL_ROOT_TESTS[@]}" + go_named "$JOURNAL_PLUGIN" ./classes -short "${JOURNAL_CLASSES_TESTS[@]}" + echo "phase19.3 plugins passed" +} + +# pnpm_tap runs `pnpm -C