试验 React 内联上下文与原生表单登录流程
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
cache_dir=${IAM_NPM_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/iam-login/npm}
|
||||
mkdir -p -- "$cache_dir"
|
||||
cache_dir=$(cd -- "$cache_dir" && pwd)
|
||||
docker_cmd=(docker)
|
||||
if [[ ${IAM_DOCKER_USE_SUDO:-0} == 1 ]]; then
|
||||
docker_cmd=(sudo -n docker)
|
||||
fi
|
||||
exec "${docker_cmd[@]}" run --rm --network host \
|
||||
--cpus 2 --memory 1g --user "$(id -u):$(id -g)" \
|
||||
-e HOME=/npm -e npm_config_cache=/npm \
|
||||
-v "$cache_dir:/npm" -v "$repo_root:/workspace" \
|
||||
-w /workspace/frontend node@sha256:d8e448a56fc63242f70026718378bd4b00f8c82e78d20eefb199224a4d8e33d8 \
|
||||
sh -c 'npm ci --no-audit --no-fund && npm run build'
|
||||
@@ -13,6 +13,8 @@ if (($# == 0)); then
|
||||
set -- test
|
||||
fi
|
||||
|
||||
"$repo_root/scripts/frontend-in-docker"
|
||||
|
||||
# Linux host networking is needed for Testcontainers' published ports.
|
||||
exec "${docker_cmd[@]}" run --rm --network host \
|
||||
--cpus "${IAM_BUILD_CPUS:-4}" --memory "${IAM_BUILD_MEMORY:-8g}" \
|
||||
|
||||
@@ -78,6 +78,7 @@ def main():
|
||||
ready_seconds = time.monotonic() - started
|
||||
assert request('/actuator/prometheus')[0] == 401, 'Anonymous metrics must be rejected'
|
||||
assert request('/')[0] == 401, 'Anonymous application access must be rejected'
|
||||
assert request('/preview')[0] == 404, 'UI preview must be disabled by default'
|
||||
status, before = request('/actuator/prometheus', authenticated=True)
|
||||
assert status == 200, 'Authenticated Prometheus scrape failed'
|
||||
for _ in range(3):
|
||||
|
||||
Reference in New Issue
Block a user