feat(cli): orchestrate full uatu test pipeline

runTestPipeline assembles the v0.1 stack end to end:
  1. Bundle the spec (with @uatu/spec alias resolution)
  2. Extract the embedded sidecar JAR
  3. Spawn java -jar sidecar --port <free>
  4. Wait for sidecar Health
  5. Listen on a host TCP port + adb reverse to the device's
     localabstract:uatu-agent socket
  6. Launch the app via the maestro driver
  7. Accept the SDK HELLO
  8. Load the bundle into the verifier
  9. Open the trace writer + write meta.json
  10. runner.Run for the requested duration
  11. Terminate the app + clean up adb reverse

Test subcommand now prints a bundle error for a missing spec,
verifying the flag surface reaches the pipeline.
This commit is contained in:
pj committed 2026-04-18 00:51:44 +07:00
1 parent e7b3e2ba9c
commit e99c85c363
3 files changed
+249 -11

No files matched your search

+7 -9
View File
@@ -113,18 +113,16 @@ func TestRun_Doctor(t *testing.T) {
}
}
func TestRun_TestSubcommand(t *testing.T) {
var stdout bytes.Buffer
func TestRun_TestSubcommand_ReportsBundleErrorForMissingSpec(t *testing.T) {
// Without a real spec file the pipeline should fail at the bundle step
// rather than panicking — proves the flag wiring reaches the runner.
err := run([]string{
"uatu", "test",
"--spec", "s.ts",
"--spec", "definitely-missing-spec.ts",
"--bundle-id", "com.example",
"--avd", "Pixel_5_API_33",
}, &stdout, io.Discard)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(stdout.String(), "uatu test (stub)") {
t.Errorf("test stub output missing, got: %q", stdout.String())
}, io.Discard, io.Discard)
if err == nil || !strings.Contains(err.Error(), "bundle") {
t.Errorf("expected bundle error, got %v", err)
}
}