Add automated UAT smoke tests

This commit is contained in:
hz
2026-07-20 23:54:11 -05:00
parent e5b567eec8
commit c2d000cc48
11 changed files with 476 additions and 0 deletions
+11
View File
@@ -73,4 +73,15 @@ kubectl get --raw "/api/v1/namespaces/${KUBE_NAMESPACE}/services/step3-api:http/
kubectl rollout status deployment/step3-web -n "${KUBE_NAMESPACE}" --timeout=240s
kubectl get --raw "/api/v1/namespaces/${KUBE_NAMESPACE}/services/step3-web:http/proxy/healthz" >/dev/null
if [ "${DEPLOYMENT_ENVIRONMENT}" = "uat" ]; then
# The images are already imported on every Kubernetes node. Reclaim runner
# space before pulling the Playwright browser image.
docker image rm "${API_IMAGE}" "${WEB_IMAGE}" "${TEST_IMAGE}" 2>/dev/null || true
docker builder prune -af >/dev/null || true
UAT_API_ORIGIN="${PUBLIC_API_ORIGIN}" \
UAT_WEB_ORIGIN="${PUBLIC_WEB_ORIGIN:-https://ustep3.ranaze.com}" \
EXPECTED_REVISION="${BUILD_TAG}" \
bash .gitea/scripts/run-uat-smoke.sh
fi
echo "Deployed ${DEPLOYMENT_ENVIRONMENT} revision ${BUILD_TAG}."
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
: "${UAT_API_ORIGIN:=https://us3q.ranaze.com}"
: "${UAT_WEB_ORIGIN:=https://ustep3.ranaze.com}"
IMAGE_TAG="step3-uat-smoke:${GITHUB_RUN_ID:-manual}-${GITHUB_RUN_NUMBER:-0}"
ARTIFACT_DIR="${SMOKE_ARTIFACT_DIR:-artifacts/uat-smoke}"
ARTIFACT_ABS="$(pwd)/${ARTIFACT_DIR}"
cleanup() {
docker image rm "${IMAGE_TAG}" >/dev/null 2>&1 || true
}
trap cleanup EXIT
rm -rf "${ARTIFACT_DIR}"
mkdir -p "${ARTIFACT_DIR}"
docker build -f tests/smoke/Dockerfile -t "${IMAGE_TAG}" tests/smoke
docker run --rm --ipc=host \
-e UAT_API_ORIGIN="${UAT_API_ORIGIN}" \
-e UAT_WEB_ORIGIN="${UAT_WEB_ORIGIN}" \
-e EXPECTED_REVISION="${EXPECTED_REVISION:-}" \
-v "${ARTIFACT_ABS}:/work/test-results" \
"${IMAGE_TAG}"
+10
View File
@@ -32,6 +32,7 @@ jobs:
DEPLOYMENT_ENVIRONMENT: uat
KUBE_NAMESPACE: step3-uat
PUBLIC_API_ORIGIN: https://us3q.ranaze.com
PUBLIC_WEB_ORIGIN: https://ustep3.ranaze.com
MONGODB_CONNECTION_STRING: ${{ secrets.UAT_MONGODB_CONNECTION_STRING }}
AUTH_JWT_KEY: ${{ secrets.UAT_AUTH_JWT_KEY }}
INTERNAL_PURGE_SECRET: ${{ secrets.UAT_INTERNAL_PURGE_SECRET }}
@@ -40,3 +41,12 @@ jobs:
GOOGLE_CLIENT_ID: ${{ secrets.UAT_GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.UAT_GOOGLE_CLIENT_SECRET }}
run: bash .gitea/scripts/deploy-environment.sh
- name: Upload UAT smoke-test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: uat-smoke-${{ github.run_number }}-${{ github.run_attempt }}
path: artifacts/uat-smoke
if-no-files-found: warn
retention-days: 14
+30
View File
@@ -0,0 +1,30 @@
name: Smoke Test STEP3 UAT
on:
workflow_dispatch: {}
concurrency:
group: step3-uat-smoke
cancel-in-progress: false
jobs:
smoke:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run UAT smoke tests
env:
UAT_API_ORIGIN: https://us3q.ranaze.com
UAT_WEB_ORIGIN: https://ustep3.ranaze.com
run: bash .gitea/scripts/run-uat-smoke.sh
- name: Upload smoke-test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: uat-smoke-${{ github.run_number }}-${{ github.run_attempt }}
path: artifacts/uat-smoke
if-no-files-found: warn
retention-days: 14