1
0
forked from baron/baron-sso

code-check 오류 수정

This commit is contained in:
2026-05-20 17:12:48 +09:00
parent b55ab7bc67
commit 0af268021e
20 changed files with 442 additions and 269 deletions

View File

@@ -15,9 +15,31 @@ trap "cleanup; exit" INT TERM
trap "cleanup" EXIT
mkdir -p reports
rm -rf adminfront/node_modules
tmp_dir="$(mktemp -d /tmp/baron-sso-adminfront-tests.XXXXXX)"
pnpm_store_dir="$tmp_dir/pnpm-store"
seed_dir=""
for candidate in \
/tmp/baron-sso-adminfront-tests.FRPGmL \
/tmp/baron-sso-adminfront-tests.mumSD6 \
/tmp/baron-sso-adminfront-tests.pwAMAt; do
if [ -d "$candidate/adminfront/node_modules" ] && \
[ -d "$candidate/common/node_modules" ]; then
seed_dir="$candidate"
break
fi
done
if [ -z "$seed_dir" ]; then
for candidate in /tmp/baron-sso-adminfront-tests.*; do
if [ "$candidate" != "$tmp_dir" ] && \
[ -d "$candidate/adminfront/node_modules" ] && \
[ -d "$candidate/common/node_modules" ]; then
seed_dir="$candidate"
break
fi
done
fi
reuse_seed_node_modules=0
mkdir -p "$tmp_dir/scripts"
cp "$repo_root/scripts/playwrightHostDeps.cjs" "$tmp_dir/scripts/"
@@ -30,14 +52,30 @@ if command -v rsync >/dev/null 2>&1; then
rsync -rlptD --delete \
--exclude 'node_modules' \
"$repo_root/common/" "$tmp_dir/common/"
rm -rf "$tmp_dir/common/node_modules"
else
cp -R "$repo_root/adminfront" "$tmp_dir/adminfront"
cp -R "$repo_root/common" "$tmp_dir/common"
rm -rf "$tmp_dir/adminfront/node_modules" \
"$tmp_dir/common/node_modules" \
"$tmp_dir/adminfront/playwright-report" \
"$tmp_dir/adminfront/test-results"
fi
if [ -n "$seed_dir" ] && [ "$seed_dir" != "$tmp_dir" ] && \
[ -d "$seed_dir/adminfront/node_modules" ] && \
[ -d "$seed_dir/common/node_modules" ]; then
cp -a "$seed_dir/adminfront/node_modules" "$tmp_dir/adminfront/"
cp -a "$seed_dir/common/node_modules" "$tmp_dir/common/"
reuse_seed_node_modules=1
fi
if [ ! -d "$tmp_dir/adminfront/node_modules" ] || \
[ ! -d "$tmp_dir/common/node_modules" ]; then
rm -rf "$tmp_dir/adminfront/playwright-report" \
"$tmp_dir/adminfront/test-results"
fi
is_port_available() {
local port="$1"
node -e '
@@ -159,8 +197,12 @@ fi
set +e
(
cd "$tmp_dir/adminfront"
run_with_retry 3 npm install -g pnpm
run_with_retry 3 pnpm install -C ../common --no-frozen-lockfile
if [ "$reuse_seed_node_modules" -eq 0 ]; then
if ! command -v pnpm >/dev/null 2>&1; then
run_with_retry 3 npm install -g pnpm
fi
run_with_retry 3 pnpm install -C ../common --no-frozen-lockfile --store-dir "$pnpm_store_dir"
fi
) 2>&1 | tee reports/adminfront-install.log
install_exit_code=${PIPESTATUS[0]}
set -e
@@ -175,7 +217,7 @@ if [ "$install_exit_code" -ne 0 ]; then
echo "- Exit Code: \`$install_exit_code\`"
echo
echo "## Command"
echo "\`cd adminfront && npm install -g pnpm && pnpm install -C ../common --no-frozen-lockfile\`"
echo "\`cd adminfront && if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install -C ../common --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
echo
echo "## Install Log Tail (last 200 lines)"
echo '```text'
@@ -242,7 +284,7 @@ if [ "$test_exit_code" -ne 0 ]; then
echo
echo "## Commands"
echo "1. \`cd adminfront\`"
echo "2. \`npm install -g pnpm && pnpm install -C ../common --no-frozen-lockfile\`"
echo "2. \`if [ \"$reuse_seed_node_modules\" -eq 0 ]; then if ! command -v pnpm >/dev/null 2>&1; then npm install -g pnpm; fi && pnpm install -C ../common --no-frozen-lockfile --store-dir \"\$TMPDIR/pnpm-store\"; fi\`"
echo "3. \`${playwright_install_desc}\`"
echo "4. \`npx playwright test\`"
echo