feat: add comprehensive testing mechanism for dashboard features
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 2m0s
Run Tests / Backend Tests (push) Failing after 4m26s
Run Tests / Frontend Tests (push) Failing after 49s
Run Tests / Test Summary (push) Failing after 15s
Run Tests / Backend Tests (pull_request) Failing after 6m9s
Run Tests / Frontend Tests (pull_request) Failing after 3m54s
Run Tests / Test Summary (pull_request) Failing after 15s

- Add smoke test script for post-deployment verification
- Add health monitoring script with Telegram alerts
- Add backend integration tests for conversation tracker API
- Add frontend tests to verify correct API paths
- Update CI/CD workflows to enforce test failures and run smoke tests
- Add comprehensive testing documentation

This testing mechanism will catch issues like the double /api/ prefix bug
before they reach users.
This commit is contained in:
Gan, Jimmy
2026-04-19 21:54:13 +08:00
parent 9b8d7cfb00
commit 01fcb53a3a
8 changed files with 801 additions and 0 deletions
+28
View File
@@ -80,3 +80,31 @@ jobs:
# Manually connect to networks after container is created
docker network connect nas-dashboard_internal nas-dashboard-dev || true
docker network connect gitea_gitea nas-dashboard-dev || true
- name: Wait for container to be healthy
run: |
echo "Waiting for container to be healthy..."
for i in {1..30}; do
STATUS=$(docker inspect --format='{{.State.Health.Status}}' nas-dashboard-dev 2>/dev/null || echo "starting")
if [ "$STATUS" = "healthy" ]; then
echo "Container is healthy"
break
fi
echo "Waiting... ($i/30) Status: $STATUS"
sleep 2
done
# Final check
STATUS=$(docker inspect --format='{{.State.Health.Status}}' nas-dashboard-dev 2>/dev/null || echo "unknown")
if [ "$STATUS" != "healthy" ]; then
echo "Container failed to become healthy: $STATUS"
docker logs nas-dashboard-dev --tail 50
exit 1
fi
- name: Run smoke tests
run: |
cd /volume1/repos/nas-tools
bash scripts/smoke-test-dashboard.sh dev
if [ $? -ne 0 ]; then
echo "Smoke tests failed! Check logs above."
docker logs nas-dashboard-dev --tail 100
exit 1
fi
+14
View File
@@ -72,6 +72,13 @@ jobs:
--junit-xml=test-results.xml \
--cov-fail-under=49
# Explicitly check exit code
if [ $? -ne 0 ]; then
echo "❌ Backend tests failed!"
exit 1
fi
echo "✅ Backend tests passed"
- name: Upload coverage report
if: always()
run: |
@@ -145,6 +152,13 @@ jobs:
cd dashboard/frontend
npm run test:coverage -- --reporter=verbose --run --pool=forks --poolOptions.forks.maxForks=2
# Explicitly check exit code
if [ $? -ne 0 ]; then
echo "❌ Frontend tests failed!"
exit 1
fi
echo "✅ Frontend tests passed"
test-summary:
name: Test Summary
runs-on: ubuntu-latest