food-market/.forgejo/workflows/regression.yml
nns ed140cb819
Some checks are pending
Auto-tag / Create date-tag (push) Waiting to run
CI / Backend (.NET 8) (push) Waiting to run
CI / Web (React + Vite) (push) Waiting to run
CI / POS (WPF, Windows) (push) Waiting to run
Docker API / Build + push API (push) Waiting to run
Docker API / Deploy API on stage (push) Blocked by required conditions
docs(s28): api-reference 195→240 + observability + integration #7 + CI
Overnight progress while 4h-soak runs in background:

1. ApiReferenceDocsJob.cs + scripts/gen-api-reference.py — return-type
   regex теперь ловит nested generics любой глубины. Было 195
   endpoint'ов в auto-gen reference; стало 240 (+45). EmployeesController
   GET /api/organization/employees был пропущен из-за
   Task<ActionResult<PagedResult<EmployeeDto>>>.

2. docs/observability.md — добавлен food_market_disk_free_bytes (Sprint 20)
   + раздел "quality-watchdog метрики" (5 метрик textfile exporter'a из
   Sprint 26: run_total, step_failure_total, endpoint_p95_ms,
   last_run_status, incidents_total). Готовые dashboards теперь содержат
   оба JSON (food-market.json + quality-watchdog.json).

3. tests/integration/07-import-export-flows.spec.ts — POST 1C-CSV import
   (semicolon-CSV cp1251) → создаются продукты с группой автоматом;
   POST /api/org/export (НЕ /api/admin/org-export) → возвращает
   {id, status}; orgB не видит export orgA. Прогон 8.2s.

4. tests/food-market.IntegrationTests/PruneQualityTestOrgsTests.cs —
   2 [Fact]'a для метода из Sprint 25. Удаляет только quality-* старше
   threshold, не трогает реальные org. Требует Testcontainers.

5. .forgejo/workflows/regression.yml — добавлен шаг integration suite
   после flows+visual. Telegram: "35 flows + 60 visual + 8 integration".

Soak-real (4h @ 50 RPS) запущен в setsid-detach session, продолжается.
Итоговые числа добавлю в sprint28-progress.md после завершения.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 03:26:39 +05:00

119 lines
4.5 KiB
YAML
Raw Permalink 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.

name: Regression suite
# Запускается ПОСЛЕ успешного docker-api/docker-web (stage-verify),
# когда stage уже задеплоен новой ревизией. Гонит полную регрессию
# (35 flow-тестов + 60 visual-snapshot'ов). Время прогона цель < 15 мин.
#
# Если падает — Telegram-уведомление со ссылкой на playwright-html отчёт.
on:
workflow_run:
workflows: ["Docker API", "Docker Web"]
types: [completed]
workflow_dispatch:
jobs:
regression:
name: Regression suite на stage
# Не запускаемся если триггерный workflow упал — нет смысла верифировать
# незадеплоенное.
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: [self-hosted, linux]
timeout-minutes: 20
env:
E2E_ADMIN_URL: https://test.admin.food-market.kz
CI: '1'
steps:
- uses: actions/checkout@v4
- name: Wait for stage /health/ready
run: |
for i in 1 2 3 4 5 6 7 8 9 10; do
if curl -fsS "$E2E_ADMIN_URL/health/ready" | grep -q '"status":"Healthy"'; then
echo "stage ready"; exit 0
fi
sleep 3
done
echo "stage NOT ready" >&2
exit 1
- name: Setup pnpm cache for regression suite
uses: actions/cache@v4
with:
path: ~/.local/share/pnpm/store
key: pnpm-regression-${{ runner.os }}-${{ hashFiles('tests/regression/pnpm-lock.yaml') }}
restore-keys: |
pnpm-regression-${{ runner.os }}-
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: pw-browsers-${{ hashFiles('tests/regression/package.json') }}
restore-keys: |
pw-browsers-
- name: Install regression deps
working-directory: tests/regression
run: pnpm install --frozen-lockfile
- name: Install Playwright Chromium
working-directory: tests/regression
run: pnpm exec playwright install chromium
- name: Run flows (35 tests)
id: flows
working-directory: tests/regression
run: pnpm exec playwright test flows/ --reporter=list,json
- name: Run visual (60 snapshots)
id: visual
working-directory: tests/regression
run: pnpm exec playwright test visual/ --reporter=list,json
# Sprint 27/28: cross-feature integration suite (отдельная папка
# tests/integration с собственным package.json). 7 specs, ~1.5 мин.
# Реюзает factories из regression/, отдельный pnpm install.
- name: Install integration deps
working-directory: tests/integration
run: pnpm install --frozen-lockfile
- name: Run integration cross-feature suite (Sprint 27/28)
id: integration
working-directory: tests/integration
run: pnpm exec playwright test --reporter=list,json
- name: Upload playwright artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ github.run_id }}
path: |
tests/regression/reports/
tests/integration/reports/
- name: Notify Telegram on failure
if: failure()
env:
BOT: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT: ${{ secrets.TELEGRAM_CHAT_ID }}
SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
run: |
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -sS -X POST "https://api.telegram.org/bot$BOT/sendMessage" \
--data-urlencode "chat_id=$CHAT" \
--data-urlencode "text=❌ regression FAILED — ${SHA:0:7} — $RUN_URL" \
> /dev/null
- name: Notify Telegram on success
if: success() && github.event_name == 'workflow_run'
env:
BOT: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT: ${{ secrets.TELEGRAM_CHAT_ID }}
SHA: ${{ github.event.workflow_run.head_sha }}
run: |
curl -sS -X POST "https://api.telegram.org/bot$BOT/sendMessage" \
--data-urlencode "chat_id=$CHAT" \
--data-urlencode "text=✅ regression OK — ${SHA:0:7} (35 flows + 60 visual + 8 integration)" \
> /dev/null