From 0168d531508aa7b67559368c440dc3dc24e01f59 Mon Sep 17 00:00:00 2001 From: vanminhpe Date: Sun, 16 Aug 2026 23:40:13 +0800 Subject: [PATCH] add script rules --- docs/script_rules.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/script_rules.md diff --git a/docs/script_rules.md b/docs/script_rules.md new file mode 100644 index 0000000..c517455 --- /dev/null +++ b/docs/script_rules.md @@ -0,0 +1,28 @@ +# Regression Test Script Rules + +These rules apply to every regression test script in `tests/` (pytest-based +or plain-script style alike). + +## After every test group / test case + +1. **Restore default config values.** + Any register changed for the test (TPU `Debug` dataset config, RPU flash + config such as `Voltage_setting_Q128`/`Current_setting_Q128`, etc.) must be + restored to its original value before the script exits. Read the actual + value from the unit at setup time (not a hardcoded nominal constant) and + write it back on `close()`/`finally`, using the device's own + config-writable + rewrite flow (`wait_until_config_writable()` -> + `write()` -> `rewrite_config()`). + +2. **Don't turn off the eload/AC source - just switch back to local.** + Leaving TPU/RPU powered lets the operator continue on the bench without a + fresh power-up sequence. On close, set the voltage back to the bench-safe + default (50V or 48V, whichever the test group uses) then call + `set_local()` - never `output_off()`/`disconnect()` the supply itself + mid-session. + +3. **The script must print every step of the test as it runs.** + Anyone reading the terminal should be able to follow along without reading + the code: print before every voltage/current change, every charger + enable/disable, every wait, and every register read/write of consequence - + not just the final PASS/FAIL.