-
Notifications
You must be signed in to change notification settings - Fork 0
feat(tests): suíte E2E + integração edge functions + fuzz expandido + coverage por módulo #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8710cb4
05eb7c5
3efd327
0feed2c
73ac6cb
8ec1811
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -270,6 +270,25 @@ jobs: | |
| continue-on-error: true | ||
| run: npm run check:critical-coverage | ||
|
|
||
| # Gera relatório de cobertura por módulo e por rota (após coverage-summary.json existir). | ||
| # Informativo: não bloqueia o build mas é publicado como artifact para análise de gaps. | ||
| - name: Generate Per-Module & Per-Route Coverage Report | ||
| if: always() | ||
| continue-on-error: true | ||
| run: node scripts/generate-coverage-report.mjs | ||
|
|
||
| - name: Upload per-module coverage report | ||
| if: always() | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: module-coverage-report-${{ github.run_id }} | ||
| path: | | ||
| coverage/module-coverage-report.json | ||
| coverage/route-coverage-report.json | ||
| coverage/coverage-report.md | ||
| retention-days: 30 | ||
| if-no-files-found: ignore | ||
|
|
||
| integration-tests: | ||
| name: Edge Integration & Fuzzing | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -283,8 +302,17 @@ jobs: | |
| cache: npm | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Run Fuzz Testing (Massive) | ||
|
|
||
| # Testes de integração mocked para todas as edge functions críticas. | ||
| # Cobre: health-check, cnpj-lookup, webhook-inbound, secure-upload, | ||
| # send-notification, validate-access, generate-mockup, quote-sync. | ||
| - name: Run Edge Function Integration Tests (mocked) | ||
| run: npx vitest run tests/edge-functions/integration/ --reporter=verbose | ||
|
|
||
| - name: Run Fuzz Testing (Massive — dry-run sem credenciais) | ||
| run: npm run test:fuzz:full | ||
| env: | ||
| FUZZ_CONCURRENCY: "3" | ||
| - name: Run Contract Testing (Schema Validation) | ||
| shell: bash | ||
| run: | | ||
|
|
@@ -301,13 +329,26 @@ jobs: | |
| else | ||
| echo "Skipping stress test: Supabase URL/token not configured." | ||
| fi | ||
| - name: Run Edge Integration Tests (Mocked Env) | ||
| - name: Run Legacy Edge Integration Tests (Mocked Env) | ||
| run: | | ||
| npm run test:edge:integration || true | ||
| # Report-only: gera artifact JSON/HTML sem aplicar thresholds globais. | ||
| # Gates reais ficam em jobs dedicados (per-file). | ||
| - name: Generate Coverage Report | ||
| run: npm run test:ci-core:coverage | ||
| - name: Generate Coverage Report (JSON/HTML) | ||
| run: >- | ||
| npx vitest run --coverage | ||
| --coverage.reporter=json | ||
| --coverage.reporter=html | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In the Useful? React with 👍 / 👎. |
||
| --coverage.thresholds.lines=0 | ||
| --coverage.thresholds.functions=0 | ||
| --coverage.thresholds.branches=0 | ||
| --coverage.thresholds.statements=0 | ||
| # Gera relatório por módulo/rota a partir do coverage-summary.json produzido acima. | ||
| - name: Generate Per-Module & Per-Route Coverage Report | ||
| if: always() | ||
| continue-on-error: true | ||
| run: node scripts/generate-coverage-report.mjs | ||
|
|
||
| - name: Upload Coverage Artifacts | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/promo-gifts-v4
Length of output: 3306
🏁 Script executed:
Repository: adm01-debug/promo-gifts-v4
Length of output: 113
🏁 Script executed:
Repository: adm01-debug/promo-gifts-v4
Length of output: 2365
Pin
actions/upload-artifactpor commit SHA no CI (reduz drift/supply-chain)Em
.github/workflows/ci.yml, o step “Upload per-module coverage report” usaactions/upload-artifact@v5(linha 282) sem pin por SHA; a ação pode mudar entre execuções. Trocar parauses: actions/upload-artifact@<sha-do-commit>.🧰 Tools
🪛 zizmor (1.25.2)
[error] 282-282: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents