mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-04-03 16:51:26 +00:00
chore(ci): ajout test_settings.py et SKILL run-tests
This commit is contained in:
53
.github/instructions/run-tests.instruction.md
vendored
Normal file
53
.github/instructions/run-tests.instruction.md
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
applyTo: "**"
|
||||
---
|
||||
|
||||
# Lancer les tests – N3WT-SCHOOL
|
||||
|
||||
## Tests backend (Django)
|
||||
|
||||
Les tests backend tournent dans le conteneur Docker. Toujours utiliser `--settings=N3wtSchool.test_settings`.
|
||||
|
||||
```powershell
|
||||
# Tous les tests
|
||||
docker exec -it n3wt-school-backend-1 python3 manage.py test --settings=N3wtSchool.test_settings --verbosity=2
|
||||
|
||||
# Un module spécifique
|
||||
docker exec -it n3wt-school-backend-1 python3 manage.py test --settings=N3wtSchool.test_settings Auth.tests --verbosity=2
|
||||
```
|
||||
|
||||
### Points importants
|
||||
|
||||
- Le fichier `Back-End/N3wtSchool/test_settings.py` configure l'environnement de test :
|
||||
- Base PostgreSQL dédiée `school_test` (SQLite incompatible avec `ArrayField`)
|
||||
- Cache en mémoire locale (pas de Redis)
|
||||
- Channels en mémoire (`InMemoryChannelLayer`)
|
||||
- Throttling désactivé
|
||||
- Hashage MD5 (plus rapide)
|
||||
- Email en mode `locmem`
|
||||
- Si le conteneur n'est pas démarré : `docker compose up -d` depuis la racine du projet
|
||||
- Les logs `WARNING` dans la sortie des tests sont normaux (endpoints qui retournent 400/401 intentionnellement)
|
||||
|
||||
## Tests frontend (Jest)
|
||||
|
||||
```powershell
|
||||
# Depuis le dossier Front-End
|
||||
cd Front-End
|
||||
npm test -- --watchAll=false
|
||||
|
||||
# Avec couverture
|
||||
npm test -- --watchAll=false --coverage
|
||||
```
|
||||
|
||||
### Points importants
|
||||
|
||||
- Les tests sont dans `Front-End/src/test/`
|
||||
- Les warnings `ReactDOMTestUtils.act is deprecated` sont non bloquants (dépendance `@testing-library/react`)
|
||||
- Config Jest : `Front-End/jest.config.js`
|
||||
|
||||
## Résultats attendus
|
||||
|
||||
| Périmètre | Nb tests | Statut |
|
||||
| -------------- | -------- | ------ |
|
||||
| Backend Django | 121 | ✅ OK |
|
||||
| Frontend Jest | 24 | ✅ OK |
|
||||
Reference in New Issue
Block a user