forked from baron/baron-sso
네이버 웍스 연동기능 개선
This commit is contained in:
50
test/adminfront_dev_performance_policy_test.sh
Normal file
50
test/adminfront_dev_performance_policy_test.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
assert_contains() {
|
||||
local file="$1"
|
||||
local pattern="$2"
|
||||
grep -Fq -- "$pattern" "$file" || fail "$file must contain: $pattern"
|
||||
}
|
||||
|
||||
assert_not_contains() {
|
||||
local file="$1"
|
||||
local pattern="$2"
|
||||
if grep -Fq -- "$pattern" "$file"; then
|
||||
fail "$file must not contain: $pattern"
|
||||
fi
|
||||
}
|
||||
|
||||
for config in \
|
||||
"$ROOT_DIR/adminfront/tailwind.config.ts" \
|
||||
"$ROOT_DIR/devfront/tailwind.config.ts" \
|
||||
"$ROOT_DIR/orgfront/tailwind.config.ts"
|
||||
do
|
||||
assert_not_contains "$config" "../common/**/*.{ts,tsx,css}"
|
||||
assert_contains "$config" "../common/core/**/*.{ts,tsx}"
|
||||
assert_contains "$config" "../common/shell/**/*.{ts,tsx}"
|
||||
done
|
||||
|
||||
assert_contains "$ROOT_DIR/common/config/vite.base.ts" "/workspace/common"
|
||||
|
||||
assert_not_contains \
|
||||
"$ROOT_DIR/adminfront/src/features/tenants/routes/TenantDetailPage.tsx" \
|
||||
"export function canShowWorksmobileEntry"
|
||||
assert_not_contains \
|
||||
"$ROOT_DIR/adminfront/src/features/tenants/routes/TenantSchemaPage.tsx" \
|
||||
"export function createSchemaField"
|
||||
assert_not_contains \
|
||||
"$ROOT_DIR/adminfront/src/features/tenants/routes/TenantWorksmobilePage.tsx" \
|
||||
"export function buildWorksmobilePasswordManageUrl"
|
||||
assert_not_contains \
|
||||
"$ROOT_DIR/adminfront/src/features/tenants/components/ParentTenantSelector.tsx" \
|
||||
"export function filterParentTenants"
|
||||
|
||||
echo "OK: adminfront dev performance settings avoid wide scans and route HMR invalidation"
|
||||
47
test/frontend_dev_bind_mount_policy_test.sh
Normal file
47
test/frontend_dev_bind_mount_policy_test.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
COMPOSE_FILE="$ROOT_DIR/docker-compose.yaml"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
assert_contains() {
|
||||
local pattern="$1"
|
||||
grep -Fq -- "$pattern" "$COMPOSE_FILE" || fail "docker-compose.yaml must contain: $pattern"
|
||||
}
|
||||
|
||||
assert_not_contains() {
|
||||
local pattern="$1"
|
||||
if grep -Fq -- "$pattern" "$COMPOSE_FILE"; then
|
||||
fail "docker-compose.yaml must not contain stale frontend mount: $pattern"
|
||||
fi
|
||||
}
|
||||
|
||||
for app in adminfront devfront orgfront; do
|
||||
assert_contains "./$app:/workspace/$app"
|
||||
assert_contains "/workspace/$app/node_modules"
|
||||
assert_not_contains "./$app:/app"
|
||||
done
|
||||
|
||||
assert_contains "./common:/workspace/common"
|
||||
assert_contains "/workspace/common/node_modules"
|
||||
assert_contains "./locales:/workspace/locales"
|
||||
|
||||
for runtime in \
|
||||
"$ROOT_DIR/adminfront/scripts/runtime-mode.sh" \
|
||||
"$ROOT_DIR/devfront/scripts/runtime-mode.sh" \
|
||||
"$ROOT_DIR/orgfront/scripts/runtime-mode.sh"
|
||||
do
|
||||
grep -Fq -- "/workspace/common" "$runtime" || fail "$runtime must install dependencies from /workspace/common"
|
||||
grep -Fq -- "pnpm install --filter" "$runtime" || fail "$runtime must install only its workspace slice"
|
||||
grep -Fq -- "--frozen-lockfile --ignore-scripts" "$runtime" || fail "$runtime must preserve the workspace lockfile with pnpm"
|
||||
if grep -Fq -- "npm install --no-workspaces" "$runtime"; then
|
||||
fail "$runtime must not install common dependencies outside the workspace graph"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "OK: frontend dev containers bind-mount source into Dockerfile WORKDIR paths"
|
||||
@@ -50,8 +50,8 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
assert_contains "$LOCAL_COMPOSE" "context: ./orgfront"
|
||||
assert_contains "$LOCAL_COMPOSE" "./orgfront:/app"
|
||||
assert_contains "$LOCAL_COMPOSE" "dockerfile: ./orgfront/Dockerfile"
|
||||
assert_contains "$LOCAL_COMPOSE" "./orgfront:/workspace/orgfront"
|
||||
assert_not_contains "$LOCAL_COMPOSE" "../baron-orgchart"
|
||||
|
||||
for file in "$STAGING_COMPOSE" "$PULL_COMPOSE" "$DEPLOY_TEMPLATE"; do
|
||||
@@ -74,9 +74,9 @@ assert_contains "$BUILD_RC" "context: ./orgfront"
|
||||
assert_contains "$BUILD_RC" "/baron_sso/orgfront:"
|
||||
|
||||
assert_contains "$CODE_CHECK" "run_orgfront_tests"
|
||||
assert_contains "$CODE_CHECK" "orgfront/package-lock.json"
|
||||
assert_contains "$CODE_CHECK" "cd orgfront"
|
||||
assert_contains "$CODE_CHECK" "npm test"
|
||||
assert_contains "$CODE_CHECK" "pnpm install -C ../common --no-frozen-lockfile"
|
||||
assert_contains "$CODE_CHECK" "pnpm run test"
|
||||
|
||||
assert_contains "$STAGING_RELEASE" "ORGFRONT_IMAGE_NAME"
|
||||
assert_contains "$STAGING_RELEASE" "ORGFRONT_PORT="
|
||||
|
||||
@@ -16,7 +16,17 @@ assert_contains() {
|
||||
}
|
||||
|
||||
assert_contains orgfront/package.json "build:org-context-chart:min"
|
||||
assert_contains orgfront/package.json "scripts/build-org-context-chart.mjs"
|
||||
assert_contains orgfront/scripts/build-org-context-chart.mjs "ORG_CONTEXT_CHART_BUILD_ID"
|
||||
assert_contains orgfront/vite.org-context-chart.config.ts "ORG_CONTEXT_CHART_MINIFY"
|
||||
assert_contains orgfront/vite.org-context-chart.config.ts "ORG_CONTEXT_CHART_BUILD_ID"
|
||||
assert_contains orgfront/vite.org-context-chart.config.ts "boc-"
|
||||
assert_contains orgfront/vite.org-context-chart.config.ts ".min"
|
||||
assert_contains orgfront/scripts/build-org-context-chart.mjs 'return `${year}${month}${random}`;'
|
||||
assert_contains orgfront/vite.org-context-chart.config.ts 'return `${year}${month}${random}`;'
|
||||
|
||||
echo "OK: OrgContext chart package emits explicit minified bundles"
|
||||
if grep -Fq '${year}${month}${day}' orgfront/scripts/build-org-context-chart.mjs orgfront/vite.org-context-chart.config.ts; then
|
||||
fail "OrgContext chart build id must use YYMM plus 4 random digits, without day or separators"
|
||||
fi
|
||||
|
||||
echo "OK: OrgContext chart package emits timestamped short bundle names"
|
||||
|
||||
30
test/shell_layout_policy_test.sh
Normal file
30
test/shell_layout_policy_test.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
LAYOUT_FILE="$ROOT_DIR/common/shell/layout.ts"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
assert_contains() {
|
||||
local pattern="$1"
|
||||
grep -Fq -- "$pattern" "$LAYOUT_FILE" || fail "common shell layout must contain: $pattern"
|
||||
}
|
||||
|
||||
assert_not_contains() {
|
||||
local pattern="$1"
|
||||
if grep -Fq -- "$pattern" "$LAYOUT_FILE"; then
|
||||
fail "common shell layout must not contain: $pattern"
|
||||
fi
|
||||
}
|
||||
|
||||
assert_contains "root: \"grid min-h-screen grid-cols-[240px,minmax(0,1fr)]"
|
||||
assert_not_contains "md:grid-cols-[240px,1fr]"
|
||||
assert_contains "aside:"
|
||||
assert_contains "sticky top-0 h-screen"
|
||||
assert_not_contains "border-b border-border bg-card md:sticky"
|
||||
|
||||
echo "OK: shell layout keeps the navigation in a fixed left column"
|
||||
Reference in New Issue
Block a user