Skip to content

Commit a9b54e9

Browse files
committed
[red] Guard coherent public beta claims
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent 346a76a commit a9b54e9

2 files changed

Lines changed: 79 additions & 15 deletions

File tree

‎tests/publication/test_public_claims.py‎

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,41 @@ def setUpClass(cls) -> None:
2323
cls.bug_template = (
2424
REPO_ROOT / ".github" / "ISSUE_TEMPLATE" / "bug.yml"
2525
).read_text(encoding="utf-8")
26+
cls.roadmap = (REPO_ROOT / "docs" / "ROADMAP.md").read_text(
27+
encoding="utf-8"
28+
)
29+
cls.home_page = (
30+
REPO_ROOT / "tools" / "web" / "src" / "app" / "page.tsx"
31+
).read_text(encoding="utf-8")
32+
cls.site_copy = (
33+
REPO_ROOT / "tools" / "web" / "src" / "lib" / "site.ts"
34+
).read_text(encoding="utf-8")
35+
cls.support_page = (
36+
REPO_ROOT
37+
/ "tools"
38+
/ "web"
39+
/ "src"
40+
/ "app"
41+
/ "support"
42+
/ "page.tsx"
43+
).read_text(encoding="utf-8")
2644

27-
def test_readme_is_truthful_before_v042_hil_completes(self) -> None:
45+
def test_readme_identifies_the_exact_unqualified_public_beta(self) -> None:
2846
firmware = markdown_section(self.readme, "What works")
2947

3048
self.assertIn(
31-
"public browser installer is currently unavailable pending v0.4.2 HIL",
49+
"public browser installer currently offers the exact v0.4.1 unqualified beta",
3250
firmware,
3351
)
52+
self.assertIn("full project HIL is pending", firmware)
3453
self.assertIn("`esp32-4mb`", firmware)
3554
self.assertIn("Classic ESP32, 4 MiB external SPI flash", firmware)
3655
self.assertIn("`esp32-s3-n16r8`", firmware)
3756
self.assertIn("16 MiB flash / 8 MiB Octal PSRAM", firmware)
57+
self.assertIn("Unqualified v0.4.1 beta; HIL pending", firmware)
58+
self.assertIn("Planned; unavailable", firmware)
3859
self.assertNotIn("currently offers qualified images", firmware)
39-
self.assertNotIn("| Available", firmware)
60+
self.assertNotIn("v0.4.2 HIL pending; installer unavailable", firmware)
4061

4162
def test_readme_caption_describes_only_the_visible_app(self) -> None:
4263
caption_start = self.readme.index("<em>Actual PyBLE app")
@@ -48,13 +69,47 @@ def test_readme_caption_describes_only_the_visible_app(self) -> None:
4869
self.assertIn("generated MicroPython", caption)
4970
self.assertNotRegex(caption, r"(?i)pictured|board|module")
5071

51-
def test_readme_try_steps_are_gated_on_an_active_installer(self) -> None:
72+
def test_readme_try_steps_use_the_active_beta_safely(self) -> None:
5273
try_section = markdown_section(self.readme, "Try PyBLE")
5374

54-
self.assertIn("currently unavailable pending v0.4.2 HIL", try_section)
55-
self.assertIn("active release version", try_section)
75+
self.assertIn("v0.4.1 unqualified beta", try_section)
76+
self.assertIn("full HIL is pending", try_section)
77+
self.assertIn("use it at your own risk", try_section)
78+
self.assertIn("exact profile", try_section)
79+
self.assertIn("back up", try_section)
5680
self.assertIn("enabled install action", try_section)
57-
self.assertNotRegex(try_section, r"(?is)select .*qualified\s+agent firmware")
81+
self.assertIn("Flashing erases the board", try_section)
82+
self.assertNotIn("wait for that page", try_section.lower())
83+
84+
def test_current_public_surfaces_agree_on_beta_and_c3_state(self) -> None:
85+
combined = "\n".join(
86+
(self.home_page, self.site_copy, self.support_page, self.roadmap)
87+
)
88+
89+
for wording in (
90+
"v0.4.1",
91+
"unqualified beta",
92+
"HIL pending",
93+
"esp32-4mb",
94+
"esp32-s3-n16r8",
95+
):
96+
self.assertIn(wording, combined)
97+
self.assertIn("use it at your own risk", combined.lower())
98+
self.assertIn("ESP32-C3", combined)
99+
self.assertRegex(combined, r"(?is)ESP32-C3.{0,180}unavailable")
100+
for stale in (
101+
"public browser installer stays unavailable",
102+
"public installer is unavailable while v0.4.2 HIL runs",
103+
"board provisioning will open only after v0.4.2",
104+
"Browser installation for qualified `esp32-4mb`",
105+
):
106+
self.assertNotIn(stale, combined)
107+
108+
near_term = markdown_section(self.roadmap, "Near term")
109+
self.assertIn(
110+
"Complete full HIL qualification for the exact `esp32-4mb` and",
111+
near_term,
112+
)
58113

59114
def test_bug_template_collects_the_exact_installer_diagnostics(self) -> None:
60115
for field_id in (

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe("public-site contract", () => {
159159
);
160160
});
161161

162-
it("states the vendor-neutral vision and the truthful pre-activation firmware state", () => {
162+
it("states the vendor-neutral vision and the truthful public-beta firmware state", () => {
163163
render(<HomePage />);
164164

165165
expect(
@@ -173,11 +173,11 @@ describe("public-site contract", () => {
173173
/designed for boards that run MicroPython and support Bluetooth Low Energy/i,
174174
),
175175
).toBeInTheDocument();
176-
expect(screen.getByText(/public v0\.4\.2 firmware/i)).toHaveTextContent(
177-
/pending HIL for the exact esp32-4mb and esp32-s3-n16r8 profiles/i,
176+
expect(screen.getByText(/public v0\.4\.1 firmware/i)).toHaveTextContent(
177+
/unqualified beta for the exact esp32-4mb and esp32-s3-n16r8 profiles/i,
178178
);
179-
expect(screen.getByText(/public v0\.4\.2 firmware/i)).toHaveTextContent(
180-
/public browser installer stays unavailable until both exact profiles pass HIL/i,
179+
expect(screen.getByText(/public v0\.4\.1 firmware/i)).toHaveTextContent(
180+
/full hardware-in-the-loop qualification is pending.*use it at your own risk/i,
181181
);
182182
expect(
183183
screen.getByText(
@@ -332,14 +332,14 @@ describe("public-site contract", () => {
332332
id: "esp32-4mb",
333333
target: "Classic ESP32",
334334
constraint: "4 MiB external SPI flash · no PSRAM assumed",
335-
status: "v0.4.2 HIL pending · installer unavailable",
335+
status: "v0.4.1 unqualified beta · HIL pending",
336336
planned: false,
337337
},
338338
{
339339
id: "esp32-s3-n16r8",
340340
target: "ESP32-S3 N16R8",
341341
constraint: "16 MiB flash · 8 MiB Octal PSRAM",
342-
status: "v0.4.2 HIL pending · installer unavailable",
342+
status: "v0.4.1 unqualified beta · HIL pending",
343343
planned: false,
344344
},
345345
{
@@ -359,6 +359,12 @@ describe("public-site contract", () => {
359359
expect(targetCard).toHaveTextContent(target.constraint);
360360
expect(targetCard).toHaveTextContent(target.status);
361361
}
362+
expect(screen.getByText(/provision once/i).closest("li")).toHaveTextContent(
363+
/v0\.4\.1 unqualified beta.*full HIL is pending.*use it at your own risk/i,
364+
);
365+
expect(
366+
screen.getByRole("link", { name: /open firmware installer/i }),
367+
).toHaveAttribute("href", "/flash");
362368
});
363369

364370
it("keeps the public installer unavailable while explaining exact profiles, BLE use, and recovery", () => {
@@ -543,9 +549,12 @@ describe("public-site contract", () => {
543549
).toBeInTheDocument();
544550
expect(
545551
screen.getByText(
546-
/public installer is unavailable while v0\.4\.2 HIL runs for esp32-4mb and esp32-s3-n16r8/i,
552+
/v0\.4\.1 unqualified beta is available for the exact esp32-4mb and esp32-s3-n16r8 profiles/i,
547553
),
548554
).toBeInTheDocument();
555+
expect(
556+
screen.getByText(/full HIL remains pending.*use it at your own risk/i),
557+
).toBeInTheDocument();
549558
expect(
550559
screen.getByText(/ESP32-C3 is not currently available/i),
551560
).toBeInTheDocument();

0 commit comments

Comments
 (0)