Skip to content

Commit f331967

Browse files
committed
[red] Require scoped hardware-tested beta copy
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent 17c7266 commit f331967

4 files changed

Lines changed: 86 additions & 27 deletions

File tree

‎tests/publication/test_public_claims.py‎

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from __future__ import annotations
55

6+
import json
67
import unittest
78
from pathlib import Path
89

@@ -41,23 +42,37 @@ def setUpClass(cls) -> None:
4142
/ "support"
4243
/ "page.tsx"
4344
).read_text(encoding="utf-8")
45+
cls.browser_validation = json.loads(
46+
(
47+
REPO_ROOT
48+
/ "docs"
49+
/ "validation"
50+
/ "browser-flashing"
51+
/ "v0.4.2-production.json"
52+
).read_text(encoding="utf-8")
53+
)
4454

45-
def test_readme_identifies_the_exact_unqualified_public_beta(self) -> None:
55+
def test_readme_identifies_the_exact_hardware_tested_public_beta(self) -> None:
4656
firmware = markdown_section(self.readme, "What works")
4757

4858
self.assertIn(
49-
"public browser installer currently offers the exact v0.4.2 unqualified beta",
59+
"public browser installer currently offers the exact v0.4.2 hardware-tested beta",
5060
firmware,
5161
)
52-
self.assertIn("full project HIL is pending", firmware)
62+
self.assertIn("Production Chrome erase/install", firmware)
63+
self.assertIn("interrupted-flash recovery passed", firmware)
64+
self.assertIn("Complete release qualification continues", firmware)
5365
self.assertIn("`esp32-4mb`", firmware)
5466
self.assertIn("Classic ESP32, 4 MiB external SPI flash", firmware)
5567
self.assertIn("`esp32-s3-n16r8`", firmware)
5668
self.assertIn("16 MiB flash / 8 MiB Octal PSRAM", firmware)
57-
self.assertIn("Unqualified v0.4.2 beta; HIL pending", firmware)
69+
self.assertIn(
70+
"v0.4.2 hardware-tested beta; browser install/recovery passed",
71+
firmware,
72+
)
5873
self.assertIn("Planned; unavailable", firmware)
5974
self.assertNotIn("currently offers qualified images", firmware)
60-
self.assertNotIn("v0.4.2 HIL pending; installer unavailable", firmware)
75+
self.assertNotIn("full HIL pending", firmware)
6176

6277
def test_readme_caption_describes_only_the_visible_app(self) -> None:
6378
caption_start = self.readme.index("<em>Actual PyBLE app")
@@ -69,12 +84,14 @@ def test_readme_caption_describes_only_the_visible_app(self) -> None:
6984
self.assertIn("generated MicroPython", caption)
7085
self.assertNotRegex(caption, r"(?i)pictured|board|module")
7186

72-
def test_readme_try_steps_use_the_active_beta_safely(self) -> None:
87+
def test_readme_try_steps_use_the_hardware_tested_beta_safely(self) -> None:
7388
try_section = markdown_section(self.readme, "Try PyBLE")
7489

75-
self.assertIn("v0.4.2 unqualified beta", try_section)
76-
self.assertIn("full HIL is pending", try_section)
77-
self.assertIn("use it at your own risk", try_section)
90+
self.assertIn("v0.4.2 hardware-tested beta", try_section)
91+
self.assertIn("Browser installation and interrupted-flash recovery passed", try_section)
92+
self.assertIn("complete release qualification continues", try_section)
93+
self.assertNotIn("full HIL pending", try_section)
94+
self.assertNotIn("use it at your own risk", try_section)
7895
self.assertIn("exact profile", try_section)
7996
self.assertIn("back up", try_section)
8097
self.assertIn("enabled install action", try_section)
@@ -88,13 +105,17 @@ def test_current_public_surfaces_agree_on_beta_and_c3_state(self) -> None:
88105

89106
for wording in (
90107
"v0.4.2",
91-
"unqualified beta",
92-
"HIL pending",
108+
"hardware-tested beta",
109+
"browser install/recovery passed",
110+
"release qualification pending",
93111
"esp32-4mb",
94112
"esp32-s3-n16r8",
95113
):
96114
self.assertIn(wording, combined)
97-
self.assertIn("use it at your own risk", combined.lower())
115+
self.assertIn("Production Chrome install", combined)
116+
self.assertIn("interrupted-flash recovery passed", combined)
117+
self.assertNotIn("full HIL pending", combined)
118+
self.assertNotIn("use it at your own risk", combined.lower())
98119
self.assertIn("ESP32-C3", combined)
99120
self.assertRegex(combined, r"(?is)ESP32-C3.{0,180}unavailable")
100121
for stale in (
@@ -107,10 +128,37 @@ def test_current_public_surfaces_agree_on_beta_and_c3_state(self) -> None:
107128

108129
near_term = markdown_section(self.roadmap, "Near term")
109130
self.assertIn(
110-
"Complete full HIL qualification for the exact `esp32-4mb` and",
131+
"Complete the app, PBLE/1, resource, and remaining firmware release",
111132
near_term,
112133
)
113134

135+
def test_production_browser_claim_is_bound_to_public_evidence(self) -> None:
136+
evidence = self.browser_validation
137+
138+
self.assertEqual(evidence["result"], "passed")
139+
self.assertEqual(evidence["release"]["version"], "0.4.2")
140+
self.assertEqual(
141+
evidence["release"]["release_json_sha256"],
142+
"5d1b0db8c4b90cccf054cd244530afb3b9112d489aa02f7c5da650e92161acde",
143+
)
144+
self.assertEqual(
145+
[profile["profile_id"] for profile in evidence["profiles"]],
146+
["esp32-4mb", "esp32-s3-n16r8"],
147+
)
148+
for profile in evidence["profiles"]:
149+
self.assertGreater(profile["interruption_percentage"], 5)
150+
self.assertLess(profile["interruption_percentage"], 100)
151+
self.assertEqual(profile["recovery_write_percentage"], 100)
152+
self.assertTrue(profile["full_erase"])
153+
self.assertTrue(profile["hard_reset"])
154+
self.assertTrue(profile["visible_completion"])
155+
self.assertTrue(profile["serial_route_released"])
156+
self.assertEqual(profile["interruption_fetch_rounds"]["firmware"], 2)
157+
self.assertEqual(profile["recovery_fetch_rounds"]["firmware"], 2)
158+
self.assertTrue(
159+
any("not the formal" in limitation for limitation in evidence["limitations"])
160+
)
161+
114162
def test_bug_template_collects_the_exact_installer_diagnostics(self) -> None:
115163
for field_id in (
116164
"profile",

‎tools/web/src/test/build-contract.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ describe("production build contract", () => {
259259
);
260260

261261
expect(page).toContain('release?.deployment === "public-beta"');
262-
expect(page).toMatch(/unqualified beta/i);
263-
expect(page).toMatch(/full hardware.*validation.*pending/i);
262+
expect(page).toMatch(/hardware-tested firmware beta/i);
263+
expect(page).toMatch(/production chrome.*install/i);
264+
expect(page).toMatch(/interrupted-flash recovery.*both exact profiles/i);
265+
expect(page).toMatch(/complete release qualification.*pending/i);
266+
expect(page).not.toMatch(/full HIL pending|use at your own risk/i);
264267
});
265268
});

‎tools/web/src/test/flash-installer.test.tsx‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,16 @@ describe("browser firmware installer states", () => {
314314
expect(document.querySelector("esp-web-install-button")).toBeNull();
315315
});
316316

317-
it("offers the exact audited unrestricted v0.4.2 beta with prominent unqualified warnings", async () => {
317+
it("offers the exact v0.4.2 hardware-tested beta with scoped qualification copy", async () => {
318318
renderInstaller({ release: publicBetaFirmwareRelease });
319319

320320
expect(screen.getByRole("status")).toHaveTextContent(
321-
/unqualified firmware beta.*full hardware-in-the-loop.*pending.*use at your own risk/i,
321+
/hardware-tested firmware beta.*browser installation.*interrupted-flash recovery.*esp32-4mb.*esp32-s3-n16r8.*complete release qualification.*pending.*not a qualified release/i,
322322
);
323323
expect(screen.queryByText(/protected release candidate/i)).toBeNull();
324324
expect(screen.queryByText(/qualified release/i)).toBeNull();
325+
expect(screen.queryByText(/full HIL pending/i)).toBeNull();
326+
expect(screen.queryByText(/use at your own risk/i)).toBeNull();
325327

326328
const profileGroup = screen.getByRole("radiogroup", {
327329
name: /select the exact module profile/i,
@@ -336,11 +338,13 @@ describe("browser firmware installer states", () => {
336338
expect(document.querySelector("esp-web-install-button")).not.toBeNull();
337339
});
338340
expect(
339-
screen.getByText(/unqualified beta.*use at your own risk/i),
341+
screen.getByText(
342+
/browser installation.*interrupted-flash recovery.*real hardware.*exact profile.*complete release qualification.*pending/i,
343+
),
340344
).toBeInTheDocument();
341345
expect(
342346
screen.getByRole("button", {
343-
name: /install unqualified beta pyble 0\.4\.2/i,
347+
name: /install pyble 0\.4\.2 beta/i,
344348
}),
345349
).toBeInTheDocument();
346350
});

‎tools/web/src/test/site-contract.test.tsx‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ describe("public-site contract", () => {
126126
]);
127127
expect(socialSvg).toContain("One-time USB setup.");
128128
expect(socialSvg).toContain("Everyday coding over BLE.");
129-
expect(socialSvg).toContain("FIRMWARE HIL PENDING");
130-
expect(socialSvg).not.toContain("WEB FLASHER");
129+
expect(socialSvg).toContain("WEB FLASHING VALIDATED");
130+
expect(socialSvg).not.toContain("FIRMWARE HIL PENDING");
131131
const socialPngSha256 = createHash("sha256")
132132
.update(socialPng)
133133
.digest("hex");
@@ -394,7 +394,7 @@ describe("public-site contract", () => {
394394
).toHaveAttribute("href", "/flash");
395395
});
396396

397-
it("shows the exact beta claims only when its build selector is active", async () => {
397+
it("shows the scoped hardware-tested beta claims only when its build selector is active", async () => {
398398
const selectionRoot = await mkdtemp(
399399
join(tmpdir(), "pyble-site-beta-selection-"),
400400
);
@@ -410,24 +410,28 @@ describe("public-site contract", () => {
410410
try {
411411
const home = render(<HomePage />);
412412
expect(screen.getByText(/public v0\.4\.2 firmware/i)).toHaveTextContent(
413-
/unqualified beta for the exact esp32-4mb and esp32-s3-n16r8 profiles/i,
413+
/hardware-tested beta for the exact esp32-4mb and esp32-s3-n16r8 profiles/i,
414414
);
415415
expect(screen.getByText(/public v0\.4\.2 firmware/i)).toHaveTextContent(
416-
/full hardware-in-the-loop qualification is pending.*use it at your own risk/i,
416+
/production chrome install.*interrupted-flash recovery passed on both exact profiles.*complete release qualification continues/i,
417417
);
418418
for (const target of firmwareTargetsForRelease(
419419
publicBetaFirmwareRelease,
420420
).filter(({ planned }) => !planned)) {
421421
expect(screen.getByText(target.id).closest("div")).toHaveTextContent(
422-
"v0.4.2 unqualified beta · HIL pending",
422+
"v0.4.2 hardware-tested beta · browser install/recovery passed · release qualification pending",
423423
);
424424
}
425425
home.unmount();
426426

427427
render(<SupportPage />);
428428
expect(
429-
screen.getByText(/v0\.4\.2 unqualified beta is available/i),
430-
).toHaveTextContent(/full HIL remains pending.*use it at your own risk/i);
429+
screen.getByText(/v0\.4\.2 hardware-tested beta is available/i),
430+
).toHaveTextContent(
431+
/production chrome install.*interrupted-flash recovery passed on both exact profiles.*complete release qualification continues/i,
432+
);
433+
expect(screen.queryByText(/full HIL pending/i)).toBeNull();
434+
expect(screen.queryByText(/use at your own risk/i)).toBeNull();
431435
} finally {
432436
if (previousSelection === undefined) {
433437
delete process.env.PYBLE_FLASH_SELECTION_FILE;

0 commit comments

Comments
 (0)