1
0
forked from baron/baron-sso
Files
baron-sso/test/make_help_target_test.sh
2026-06-12 18:36:18 +09:00

53 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
fail() {
echo "ERROR: $*" >&2
exit 1
}
assert_contains() {
local output="$1"
local expected="$2"
grep -Fq -- "$expected" <<<"$output" || fail "help output must contain: $expected"
}
help_output="$(
make -C "$repo_root" help 2>&1
)"
assert_contains "$help_output" "Usage:"
assert_contains "$help_output" "Targets:"
assert_contains "$help_output" "Options:"
assert_contains "$help_output" "Restore Safety:"
for target in up dev code-check dump restore-plan code-check-userfront-e2e-tests; do
assert_contains "$help_output" "$target"
done
for option in DEV_SERVICES CODE_CHECK_TEST_JOBS PLAYWRIGHT_WORKERS BACKUP_USE_DOCKER DUMP_SERVICES RESTORE_SERVICES; do
assert_contains "$help_output" "$option"
done
for restore_usage in \
"CONFIRM_RESTORE=baron-sso" \
"ALLOW_NON_EMPTY_RESTORE=true" \
"make restore-plan FILE_PATH=stg.today.tar.gz CONFIRM_RESTORE=baron-sso" \
"make restore FILE_PATH=stg.today.tar.gz CONFIRM_RESTORE=baron-sso ALLOW_NON_EMPTY_RESTORE=true"; do
assert_contains "$help_output" "$restore_usage"
done
for description in \
"전체 로컬 스택 실행" \
"개발 앱 컨테이너를 포그라운드로 실행" \
"로컬 CI 상당 코드 검사 실행" \
"백업 덤프 생성" \
"복구 실행 계획 출력" \
"UserFront WASM E2E 테스트 실행"; do
assert_contains "$help_output" "$description"
done
echo "OK: make help exposes generated targets and configurable options"