Skip to content

Infra: CI GitHub Actions + séparation des tests matériel (#18) - #26

Closed
mickaelbegon wants to merge 3 commits into
mainfrom
infra/18-ci
Closed

mickaelbegon wants to merge 3 commits into
mainfrom
infra/18-ci

Conversation

@mickaelbegon

Copy link
Copy Markdown
Owner

Fixes #18

Contenu

Séparation des tests matériel (tests/conftest.py)

  • Option --port (ou variable d'environnement PYSCIENCEMODE_PORT) + fixture port qui remplace les COM3/COM4 codés en dur.
  • Marqueurs hardware, p24, rehastim2 (posés via pytestmark au niveau module) : les tests matériel sont skippés par défaut sans port.
  • Marqueur interactive pour les tests d'erreur d'électrode (nécessitent de débrancher une électrode pendant le test) : ne tournent qu'avec --run-interactive.
  • Marqueurs enregistrés dans conftest.py (aucune modification de pyproject.toml, pour ne pas entrer en conflit avec Infra: packaging unifié (pyproject unique, extra [p24], nettoyage du dépôt) #19).

Exemples :

pytest tests                                          # tests matériel skippés
pytest tests/test_update_parameter_p24.py --port COM4
PYSCIENCEMODE_PORT=/dev/ttyUSB0 pytest tests -m rehastim2

Test obsolète (tests/test_raise_error_p24.py)

  • test_no_stimulation_duration_error attendait « Please indicate the stimulation duration », message qui n'existe plus : stimulation_duration est désormais optionnel dans P24.start_stimulation. Remplacé par test_invalid_stimulation_duration_type_error, qui vérifie le TypeError actuel (« Please provide a int or float type for stimulation duration »).

Smoke tests sans matériel (tests/test_no_hardware.py)

CI (.github/workflows/ci.yml)

  • ruff check avec un jeu de règles volontairement minimal (E9,F63,F7,F82) pour passer aujourd'hui ; à durcir plus tard.
  • pytest tests (sans matériel) sur ubuntu / windows / macos × Python 3.10, 3.11, 3.12, installation via pip install -e . pytest.
  • La wheel sciencemode_cffi (Windows cp310 uniquement) n'est pas installée : les tests qui en dépendent sont des tests matériel, donc skippés.

Vérifié localement (Windows, Python 3.11)

🤖 Generated with Claude Code

mickaelbegon and others added 3 commits September 24, 2026 09:38
Hardware tests are skipped unless --port or PYSCIENCEMODE_PORT is given;
electrode-removal tests also need --run-interactive. Replaces the
hard-coded COM3/COM4 ports with a port fixture. Also replaces the obsolete
'Please indicate the stimulation duration' test (the duration is now
optional) with a check of the current TypeError on an invalid type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, py3.10-3.12)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mickaelbegon

Copy link
Copy Markdown
Owner Author

Déplacée sur upstream : s2mLab#27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infra: CI GitHub Actions (Win/Linux/macOS) + séparation des tests matériel

1 participant