From 3cf3adee7c55e2d055a1d625da0e3ac788a96eb0 Mon Sep 17 00:00:00 2001 From: hided62 Date: Fri, 31 Jul 2026 08:30:00 +0000 Subject: [PATCH] test: reject empty conditional test modes --- docs/integration-tests.md | 4 +++- tools/run-conditional-integration.sh | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/integration-tests.md b/docs/integration-tests.md index f540d3a..7fd88c7 100644 --- a/docs/integration-tests.md +++ b/docs/integration-tests.md @@ -80,7 +80,9 @@ runtime role을 삭제하고 PID와 명령행 및 daemon 종료를 확인한 뒤 더 이상 테스트에 존재하지 않으면 runner가 테스트 실행 전에 실패합니다. Registry는 marker 존재 여부뿐 아니라 중복, 형식과 지원 execution mode도 검사합니다. 지원하지 않는 mode로 인해 test가 실행 group에서 빠지는 경우에도 -runner는 test 시작 전에 실패합니다. +runner는 test 시작 전에 실패합니다. 지원 mode에 marker가 하나도 없거나 +실행 group의 marker 정규식이 비어도 전체 파일로 선택 범위를 넓히지 않고 +실패합니다. 관리자 시간 조정의 PostgreSQL 경계는 `runtimeClockShiftPersistence.integration.test.ts`, gateway action diff --git a/tools/run-conditional-integration.sh b/tools/run-conditional-integration.sh index c3c639a..d18d212 100755 --- a/tools/run-conditional-integration.sh +++ b/tools/run-conditional-integration.sh @@ -298,6 +298,9 @@ validate_marker_registry() { printf "line %d has unsupported execution mode: %s\n", NR, $2; failed = 1; } + ($2 in allowed_modes) { + mode_counts[$2]++; + } seen[$1]++ { printf "line %d duplicates marker: %s\n", NR, $1; failed = 1; @@ -305,7 +308,15 @@ validate_marker_registry() { { print $1 "\t" $2 > validated_registry_file; } - END { exit failed } + END { + for (mode_name in allowed_modes) { + if (!mode_counts[mode_name]) { + printf "supported execution mode has no marker: %s\n", mode_name; + failed = 1; + } + } + exit failed; + } ' "$registry_file" >"$registry_errors_file" || { echo "invalid conditional integration marker registry:" >&2 sed 's/^/ /' "$registry_errors_file" >&2 @@ -400,6 +411,10 @@ run_marked_tests() { package_dir=$1 marker=$2 label=$3 + if [ -z "$marker" ]; then + echo "no conditional database marker configured for $label" >&2 + exit 65 + fi test_files=$(cd "$workspace_root/$package_dir" && rg -l "$marker" test -g '*.integration.test.ts' | sort) if [ -z "$test_files" ]; then echo "no $label tests found under $package_dir" >&2