test: add reproducible device verification

This commit is contained in:
QiuSW
2026-08-08 09:19:40 +08:00
parent 730bc528be
commit d82ab836a2
5 changed files with 67 additions and 6 deletions
+7 -1
View File
@@ -35,7 +35,13 @@
.\gradlew.bat connectedDebugAndroidTest
```
若采用不同格式化插件,命令可以调整,但必须在本文件和 CI 同步更新。`connectedDebugAndroidTest` 需要模拟器或设备,继续与环境独立的 `verifyLocal` 分开;`verifyLocal` 通过证明 APK 已构建,但不等于真机测试已经通过。
若本机存在两个不兼容的 ADB server,可在只保留一个 server 的前提下使用等价的可重复入口:
```powershell
.\scripts\run-connected-tests.ps1 -AdbPath <能够稳定识别设备的 adb.exe>
```
该脚本重新构建主/测试 APK、检查授权状态、覆盖安装两者并直接调用同一个 `AndroidJUnitRunner`;失败、零测试或缺少 `OK` 结果都会使脚本失败。若采用不同格式化插件,命令可以调整,但必须在本文件和 CI 同步更新。设备测试继续与环境独立的 `verifyLocal` 分开;`verifyLocal` 通过证明 APK 已构建,但不等于真机测试已经通过。
## 3. 测试层次