Keep recurring acceptance cleanup scoped to each test run
studio CI and deployment / verify-and-deploy (pull_request) Successful in 3m25s

This commit is contained in:
2026-10-28 17:37:46 +08:00
parent ce1963f692
commit 06999cd8a6
2 changed files with 11 additions and 17 deletions
+2 -13
View File
@@ -19,19 +19,8 @@ run_api(){
-e AUTH_CONFIG_FILE=/auth/config.json -e AUTH_CHECK_BASE_URL=http://8.211.154.134:18131 \
--entrypoint node "$TEST_IMAGE" dist/auth-cli.cjs run "/delivery/scripts/$script" "$@"
}
# Clean only this task's explicitly named legacy temporary directories. Preserve test data via archive.
if [[ -f /tmp/studio-library/verification.json ]]; then
run_api /tmp/studio-library verify-studio-library.mjs --finalize
fi
if [[ -d /tmp/studio-library-source ]]; then
test -z "$(git -C /tmp/studio-library-source status --porcelain)" || { echo 'Temporary source has unexpected edits; preserved'; exit 1; }
git --git-dir=/tmp/studio-library-delivery.git worktree remove /tmp/studio-library-source
fi
rm -rf /tmp/studio-library-delivery.git /tmp/studio-library-evidence /tmp/studio-library
for old_path in /tmp/studio-library-source /tmp/studio-library-delivery.git /tmp/studio-library-evidence /tmp/studio-library; do
test ! -e "$old_path" || exit 1
done
printf '{"legacyTemporaryDirectoriesRemoved":true}\n' > "$RESULT_DIR/cleanup.json"
# Result files are uploaded by the workflow and removed after successful upload.
printf '{"temporaryOutputManagedByCI":true}\n' > "$RESULT_DIR/cleanup.json"
# Always archive only the UUIDs created by this run, including when visual checks fail.
finish(){
local status=$?