Skip to content

Commit ff0c6ca

Browse files
author
Codex
committed
Add smoke summary schema fixture
1 parent c077730 commit ff0c6ca

4 files changed

Lines changed: 51 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ All notable changes to Android Harness are tracked here.
3232
- `android-harness smoke --redact-all` as a share-safe preset for smoke
3333
reports.
3434
- `android-harness smoke --summary` for count-based smoke artifacts.
35+
- Public JSON schema fixture for `android-harness smoke --summary` output.
3536
- `android-harness smoke --redact-device` to hide selected device identifiers in
3637
issue-triage reports.
3738
- GitHub Actions `Release Build` workflow and release checklist documentation

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ host-side, ADB-first Android automation layer.
5555
- Doctor count-based summary for safer diagnostic artifacts.
5656
- Smoke count-based summary for safer issue triage artifacts.
5757
- Doctor summary schema compatibility fixture.
58+
- Smoke summary schema compatibility fixture.
5859

5960
## Next
6061

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"schema_version": "android-harness.smoke.v1",
3+
"summary": true,
4+
"ok": true,
5+
"transport": "daemon",
6+
"check_count": 4,
7+
"failed_check_count": 0,
8+
"failed_checks": [],
9+
"daemon": {
10+
"running": true,
11+
"status_present": true
12+
},
13+
"doctor": {
14+
"summary": true,
15+
"adb_available": true,
16+
"device_ready": true,
17+
"device_count": 1,
18+
"ready_device_count": 1,
19+
"selected": true,
20+
"tcpip_selected": false,
21+
"error_present": false,
22+
"uiautomator_available": true,
23+
"screenshot_available": true
24+
}
25+
}

tests/test_smoke.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,30 @@ def fake_doctor(serial=None, *, transport_name=None):
7373
assert payload == fixture
7474

7575

76+
def test_smoke_summary_matches_public_schema_fixture(monkeypatch):
77+
def fake_doctor(serial=None, *, transport_name=None):
78+
return FakeReport(
79+
{
80+
"adb_available": True,
81+
"devices": [["emulator-5554", "device"]],
82+
"selected_serial": "emulator-5554",
83+
"device_ready": True,
84+
"screenshot_available": True,
85+
"uiautomator_available": True,
86+
"error": None,
87+
}
88+
)
89+
90+
monkeypatch.setattr(smoke, "doctor", fake_doctor)
91+
monkeypatch.setattr(smoke, "daemon_status", lambda: "running: /tmp/android-harness/daemon.sock")
92+
93+
report = smoke.run_smoke("emulator-5554", transport_name="daemon")
94+
payload = json.loads(json.dumps(smoke.summarize_smoke_report(report)))
95+
fixture = json.loads((FIXTURES / "smoke_summary_v1.json").read_text())
96+
97+
assert payload == fixture
98+
99+
76100
def test_redact_smoke_report_removes_device_identifiers():
77101
report = {
78102
"schema_version": smoke.SMOKE_SCHEMA_VERSION,

0 commit comments

Comments
 (0)