[infra] CI con GitHub Actions: correr pytest y Vitest en cada PR
Débutant
help wantedinfradificultad: media
0 ★
Poids du clone léger
Mise à jour
Description
**Dificultad:** media.
El repo tiene 11 archivos de test en `sistema-ayuda-nacional/tests/` (pytest) y dos
suites en `nodo-local/src/` (`db.test.js`, `sync.test.js`, Vitest), pero no existe
`.github/workflows/`. Nada corre esos tests automáticamente, así que un PR de
alguien externo puede romper el pipeline sin que se note hasta el merge.
Qué hacer:
- Crear `.github/workflows/ci.yml` con dos jobs independientes.
- **Backend:** Python, `pip install -r sistema-ayuda-nacional/requirements.txt`,
luego `pytest` respetando `sistema-ayuda-nacional/pytest.ini`.
- **Frontend:** Node, `npm ci` y `npm test` dentro de `nodo-local/`. Correr
también `oxlint` ya que hay `.oxlintrc.json`.
- Disparar en `push` a `main` y en `pull_request`.
- Usar `paths` para no correr el job de frontend cuando el PR solo toca backend.
Ojo con los tests que tocan integraciones (`test_usgs.py`, `test_ushahidi.py`,
`test_whatsapp.py`): si pegan a la red van a fallar en CI. Verificar que estén
mockeados antes de dar esto por cerrado.
Con esto en verde, aceptar PRs de gente nueva deja de ser un acto de fe.
Issues similaires
Tout voir
Python
Débutant
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an im…
Mise à jour
Python
Débutant
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:54…
Mise à jour
Python
Débutant
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the r…
Mise à jour