test: preserve quality and websocket evidence (#107)

Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
Rogee
2026-08-22 21:19:09 +08:00
committed by GitHub
co-authored by rogee
parent fb83285617
commit 6444c40531
3 changed files with 426 additions and 2 deletions
+25
View File
@@ -43,6 +43,8 @@ jobs:
run: deploy/docker/observability_test.sh
- name: Test quality gate failure contracts
working-directory: backend
env:
GOCHAT_QUALITY_DIR: ${{ github.workspace }}/backend/quality/sqlite/failure-injection
run: python3 scripts/quality_gate_test.py
- name: Test
working-directory: backend
@@ -106,6 +108,15 @@ jobs:
--health-interval 5s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7.4.2-alpine@sha256:02419de7eddf55aa5bcf49efb74e88fa8d931b4d77c07eff8a6b2144472b6952
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
@@ -242,6 +253,20 @@ jobs:
if empty:
raise SystemExit(f"required E2E suites ran no passing subtests: {', '.join(empty)}")
PY
- name: Test multi-instance WebSocket fanout
working-directory: backend
env:
GOCHAT_MULTI_INSTANCE_E2E: "1"
GOCHAT_MULTI_INSTANCE_DATABASE_DSN: postgres://postgres:postgres@localhost:5432/gochat_test?sslmode=disable
GOCHAT_REDIS_DSN: redis://localhost:6379
GOCHAT_WS_E2E_EVIDENCE_DIR: ${{ github.workspace }}/backend/quality/postgres/websocket-multi-instance
run: |
set -euo pipefail
mkdir -p "$GOCHAT_WS_E2E_EVIDENCE_DIR"
go test -json -count=1 -timeout 2m ./tests/e2e -run '^TestWebSocketMultiInstanceFanout$' \
| tee "$GOCHAT_WS_E2E_EVIDENCE_DIR/test.jsonl"
grep -Eq '"Action":"pass".*"Test":"TestWebSocketMultiInstanceFanout"' \
"$GOCHAT_WS_E2E_EVIDENCE_DIR/test.jsonl"
- name: Upload PostgreSQL quality evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2