Skip to content

tests: Add board qualification tests for user LEDs.#91

Merged
nedseb merged 4 commits intofeature/board-qualification-frameworkfrom
feature/board-leds
Mar 13, 2026
Merged

tests: Add board qualification tests for user LEDs.#91
nedseb merged 4 commits intofeature/board-qualification-frameworkfrom
feature/board-leds

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 13, 2026

Summary

Closes #85
Depends on #89 (framework extension)

Adds board qualification tests for the user RGB LED (red, green, blue) and BLE LED.

Scenario: tests/scenarios/board_leds.yaml

Test Pin Type
LED RED on/off LED_RED (PC12) hardware_script
LED RED visible manual
LED GREEN on/off LED_GREEN (PC11) hardware_script
LED GREEN visible manual
LED BLUE on/off LED_BLUE (PC10) hardware_script
LED BLUE visible manual
RGB LED full cycle R→G→B→white hardware_script
RGB LED full cycle visible manual
LED BLE on/off LED_BLE (PH3) hardware_script
LED BLE visible manual

How to test

# Mock tests (no regression)
pytest tests/ -k mock

# Collect LED board tests
pytest tests/ -k board_leds --collect-only

# Run on hardware (requires STeaMi board, interactive)
pytest tests/ --port /dev/ttyACM0 -k board_leds -s

Test results

$ pytest tests/ -k mock -q
41 passed, 95 deselected

$ pytest tests/ -k board_leds --collect-only -q
10 tests collected (board_leds/LED RED on|off, LED RED visible, ..., LED BLE visible)

$ pytest tests/ -k board_leds -q  # (sans --port)
10 skipped  # correctly skipped without hardware

$ pytest tests/ --port /dev/ttyACM0 -k board_leds -s -v   
============================== test session starts ==============================
platform linux -- Python 3.13.7, pytest-8.3.5, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/nedjar/sandbox/micropython-steami-lib
configfile: pytest.ini
plugins: typeguard-4.4.2
collected 113 items / 103 deselected / 10 selected                                                                                                                                                                                                                          

tests/test_scenarios.py::test_scenario[board_leds/LED RED on/off/hardware]   [INTERACTIVE] Observez la LED rouge sur la carte, puis appuyez sur Entrée. 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED RED visible/hardware]   [MANUAL] La LED rouge s'est-elle allumée puis éteinte ? [Entree=oui / Echap=non] 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED GREEN on/off/hardware]   [INTERACTIVE] Observez la LED verte, puis appuyez sur Entrée. 

True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED GREEN visible/hardware]   [MANUAL] La LED verte s'est-elle allumée puis éteinte ? [Entree=oui / Echap=non] 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED BLUE on/off/hardware]   [INTERACTIVE] Observez la LED bleue, puis appuyez sur Entrée. 

True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED BLUE visible/hardware]   [MANUAL] La LED bleue s'est-elle allumée puis éteinte ? [Entree=oui / Echap=non] 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/RGB LED full cycle/hardware]   [INTERACTIVE] Observez la LED RGB (séquence R/G/B/blanc), puis appuyez sur Entrée. 

True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/RGB LED full cycle visible/hardware]   [MANUAL] La LED a-t-elle affiché rouge, vert, bleu, puis blanc ? [Entree=oui / Echap=non] 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED BLE on/off/hardware]   [INTERACTIVE] Observez la LED BLE, puis appuyez sur Entrée. 
True
PASSED
tests/test_scenarios.py::test_scenario[board_leds/LED BLE visible/hardware]   [MANUAL] La LED BLE (bleue) s'est-elle allumée puis éteinte ? [Entree=oui / Echap=non] 
True
PASSED

====================== 10 passed, 103 deselected in 37.75s ======================

Hardware test results will be added after board validation.

Test plan

  • ruff check tests/ — passed
  • pytest tests/ -k mock — 41 passed (no regression)
  • 10 LED board tests correctly collected and skipped without --port
  • Hardware validation on STeaMi board (pending)

@nedseb nedseb requested a review from Copilot March 13, 2026 09:05
@nedseb nedseb self-assigned this Mar 13, 2026
@nedseb nedseb added enhancement New feature or request test labels Mar 13, 2026
@nedseb nedseb linked an issue Mar 13, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new board-level (driverless) hardware qualification scenario to validate the STeaMi board’s user RGB LED channels and BLE LED via a mix of automated MicroPython scripts and manual confirmation prompts.

Changes:

  • Add tests/scenarios/board_leds.yaml as a type: board scenario.
  • Introduce 10 board qualification tests covering RED/GREEN/BLUE/BLE on-off scripts plus manual “visible” confirmations, and an RGB cycle script + manual confirmation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/scenarios/board_leds.yaml
Comment thread tests/scenarios/board_leds.yaml
Comment thread tests/scenarios/board_leds.yaml
Comment thread tests/scenarios/board_leds.yaml
@nedseb nedseb force-pushed the feature/board-leds branch from a705006 to f4f04e9 Compare March 13, 2026 09:14
@nedseb
Copy link
Copy Markdown
Contributor Author

nedseb commented Mar 13, 2026

Corrections suite à la review Copilot (955f174) :

  • pre_prompt ajouté à chaque test hardware_script LED pour que l'opérateur puisse se préparer avant le clignotement (appui sur Entrée pour démarrer).
  • Durée du blanc alignée : sleep_ms(1000)sleep_ms(500) pour le blanc dans le cycle RGB, cohérent avec les 500ms par couleur.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new board-level qualification scenario to validate the STeaMi board’s user RGB LED (R/G/B + white mix) and BLE LED using the type: board YAML scenario framework (introduced in #89 / depends on #89).

Changes:

  • Add tests/scenarios/board_leds.yaml defining 10 hardware-only tests (5 scripted LED toggles + 5 manual visibility confirmations).
  • Include an RGB full-cycle scripted test (R → G → B → white) plus a manual confirmation step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/scenarios/board_leds.yaml
Comment thread tests/scenarios/board_leds.yaml Outdated
Comment thread tests/scenarios/board_leds.yaml Outdated
Comment thread tests/scenarios/board_leds.yaml
Comment thread tests/scenarios/board_leds.yaml
@nedseb
Copy link
Copy Markdown
Contributor Author

nedseb commented Mar 13, 2026

Réponses aux commentaires Copilot :

pre_prompt manquants sur les tests intermédiaires (GREEN, BLUE, cycle RGB) — Retrait volontaire : seuls le premier test RGB et le test BLE ont un pre_prompt. Les tests intermédiaires s'enchaînent sans pause car l'opérateur observe déjà la carte.

Formulation des pre_prompt — Corrigé : reformulé en « Appuyez sur Entrée pour lancer le test, puis observez la carte » pour clarifier que Entrée déclenche le test.

Durée du blanc (1000ms vs 500ms) — Déjà corrigé dans un commit précédent, le blanc est à 500ms comme les autres couleurs.

@nedseb nedseb merged commit 2f1d107 into feature/board-qualification-framework Mar 13, 2026
@nedseb nedseb deleted the feature/board-leds branch March 13, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: Add board qualification tests for user LEDs.

2 participants