docs(tests): improve upgrade tests README
What changed, and why it matters
This commit only updates a documentation file explaining how to run internal upgrade tests. It adds instructions for using nix-shell, building the emulator, and selecting which device models to test. There is no code change and no security relevance.
No action required. This is a documentation-only change with no security implications.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies docs/tests/upgrade-tests.md, a markdown README. It expands the setup steps for running pytest-based upgrade tests, clarifies environment setup (nix-shell + uv), emulator build commands, and the TREZOR_UPGRADE_TEST environment variable syntax. No source code, build scripts, tests, or cryptographic logic is changed.
Changed components
docs/tests/upgrade-tests.mdInspect captured patch +19 / −4
diff --git a/docs/tests/upgrade-tests.md b/docs/tests/upgrade-tests.md
index 93da4856..b85e592f 100644
--- a/docs/tests/upgrade-tests.md
+++ b/docs/tests/upgrade-tests.md
@@ -1,8 +1,9 @@
# Running Upgrade Tests
-1. As always, use uv environment:
+1. As always, use `nix-shell` + `uv` environment:
```sh
+nix-shell
uv sync
source .venv/bin/activate
```
@@ -15,7 +16,14 @@ tests/download_emulators.sh {model}
For tropic-capable models, this also downloads tropic-enabled emulator variants into the same subfolder layout as on S3.
-3. And run the tests using pytest:
+3. Build the emulator for the model you want to test, use `DISABLE_TROPIC=0` for tropic-enabled models:
+
+```sh
+make -C core build_unix TREZOR_MODEL=T2T1
+make -C core build_unix TREZOR_MODEL=T3W1 DISABLE_TROPIC=0
+```
+
+4. And run the tests using pytest:
```sh
pytest tests/upgrade_tests
@@ -23,8 +31,15 @@ pytest tests/upgrade_tests
----
-You can use `TREZOR_UPGRADE_TEST` environment variable if you would like to run core or legacy upgrade tests exclusively. This will run `core` only:
+You can use `TREZOR_UPGRADE_TEST` to limit the run to specific models.
+Accepted values are model internal names (`T1B1`, `T2T1`, `T3W1`), and they can be combined as a comma-separated list.
```sh
-TREZOR_UPGRADE_TEST="core" pytest tests/upgrade_tests
+TREZOR_UPGRADE_TEST="T2T1" pytest tests/upgrade_tests
+TREZOR_UPGRADE_TEST="T3W1" pytest tests/upgrade_tests
+TREZOR_UPGRADE_TEST="T1B1,T3W1" pytest tests/upgrade_tests
```
+
+If `TREZOR_UPGRADE_TEST` is not set, this command auto-selects targets based on locally available emulator builds.
+`T1B1` (legacy) runs when the local legacy emulator is available, and `T2T1`/`T3W1` (core) runs when the local core emulator is available.
+For local core builds, the suite detects the model from the build tree; if it cannot be determined, the run fails explicitly and you should set `TREZOR_UPGRADE_TEST` yourself.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.