forked from baron/baron-sso
코드 체크 개선
This commit is contained in:
23
test/code_check_playwright_cache_policy_test.sh
Normal file
23
test/code_check_playwright_cache_policy_test.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
WORKFLOW_FILE="$ROOT_DIR/.gitea/workflows/code_check.yml"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
grep -Fq -- "scripts/playwrightPackageVersion.cjs" "$WORKFLOW_FILE" || \
|
||||
fail "Code Check workflow must compute Playwright cache versions through the shared package.json reader"
|
||||
|
||||
if grep -Fq -- "npm list @playwright/test" "$WORKFLOW_FILE"; then
|
||||
fail "Code Check workflow must not call npm list before npm ci"
|
||||
fi
|
||||
|
||||
if grep -Fq -- "pnpm list -C ../common @playwright/test" "$WORKFLOW_FILE"; then
|
||||
fail "Code Check workflow must not call pnpm list before pnpm install"
|
||||
fi
|
||||
|
||||
echo "OK: Code Check Playwright cache keys do not depend on preinstalled node_modules"
|
||||
25
test/playwright_package_version_test.sh
Normal file
25
test/playwright_package_version_test.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
fail() {
|
||||
echo "ERROR: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
assert_version() {
|
||||
local package_dir="$1"
|
||||
local expected="$2"
|
||||
local actual
|
||||
actual="$(node "$ROOT_DIR/scripts/playwrightPackageVersion.cjs" "$package_dir")"
|
||||
[ "$actual" = "version=$expected" ] || \
|
||||
fail "$package_dir Playwright version must be $expected, got: $actual"
|
||||
}
|
||||
|
||||
assert_version userfront-e2e 1.58.2
|
||||
assert_version adminfront 1.60.0
|
||||
assert_version devfront 1.60.0
|
||||
assert_version orgfront 1.60.0
|
||||
|
||||
echo "OK: Playwright package versions are read from package.json"
|
||||
Reference in New Issue
Block a user