Files
mtusi2026lab7/scripts/app-e2e.sh
T

26 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Black-box набор приложения (app/test/*.e2e-spec.ts) против локального стенда.
# В lab7 PostgreSQL и Redis намеренно не публикуются на хост, поэтому для
# host-side e2e передайте явные DATABASE_URL и REDIS_URL (или запускайте
# unit/contract/lab7 проверки). Секреты в .env отсутствуют.
set -eu
env_file="${COMPOSE_ENV_FILE:-.env}"
compose_dir="$(pwd)"
if [ -f "./$env_file" ]; then
# shellcheck disable=SC1090
set -a
. "./$env_file"
set +a
fi
export API_BASE_URL="${API_BASE_URL:-https://localhost:${APP_PUBLIC_PORT:-8443}}"
export NODE_EXTRA_CA_CERTS="${NODE_EXTRA_CA_CERTS:-${compose_dir}/secrets/pki/ca.crt}"
export E2E_S3_PUBLIC_ENDPOINT="${S3_PUBLIC_ENDPOINT:-https://localhost:${S3_PUBLIC_PORT:-9000}}"
export E2E_S3_BUCKET="${S3_BUCKET:-messenger-attachments}"
export E2E_COMPOSE_DIR="$compose_dir"
export E2E_COMPOSE_ENV_FILE="$env_file"
cd "$(dirname "$0")/../app"
exec npm run test:e2e -- "$@"