Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Commit 5a6d82c

Browse files
committed
test: accept chunked encrypted dashboard marker
1 parent 033ca95 commit 5a6d82c

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

scripts/template_consumer_e2e.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ def _assert_successful_profile(consumer_dir: Path, profile: ConsumerProfile) ->
273273
raise TemplateConsumerE2EError(f"{profile.name}: dashboard HTML was not rendered")
274274
dashboard = dashboard_path.read_text(encoding="utf-8")
275275
if profile.expected_artifact_mode == "encrypted":
276-
if "encrypted-payload" not in dashboard or "export-manifest" not in dashboard:
276+
if "encrypted-dashboard-data" not in dashboard or "export-manifest" not in dashboard:
277277
raise TemplateConsumerE2EError(f"{profile.name}: encrypted dashboard markers missing")
278278
if not list((consumer_dir / "docs" / "assets").glob("export-data-*.enc")):
279279
raise TemplateConsumerE2EError(f"{profile.name}: encrypted export asset missing")
280-
elif "encrypted-payload" in dashboard:
280+
elif "encrypted-dashboard-data" in dashboard or "encrypted-payload" in dashboard:
281281
raise TemplateConsumerE2EError(f"{profile.name}: plain dashboard contains encrypted payload")
282282

283283
managed_manifest = consumer_dir / "docs" / "reponomics" / ".manifest.json"

tests/test_generated_repos.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,39 @@ def test_template_consumer_e2e_absolutizes_cwd_relative_paths(tmp_path, monkeypa
622622
assert template_consumer_e2e._absolute_path(action_python) == tmp_path / action_python
623623

624624

625+
def test_template_consumer_e2e_accepts_chunked_encrypted_dashboard_marker(tmp_path):
626+
(tmp_path / ".e2e-github-output").write_text(
627+
"artifact-mode=encrypted\npublish-pages=true\n",
628+
encoding="utf-8",
629+
)
630+
(tmp_path / "docs" / "assets").mkdir(parents=True)
631+
(tmp_path / "docs" / "assets" / "export-data-test.enc").write_text(
632+
"encrypted",
633+
encoding="utf-8",
634+
)
635+
(tmp_path / "docs" / "reponomics").mkdir(parents=True)
636+
(tmp_path / "docs" / "reponomics" / ".manifest.json").write_text(
637+
"{}\n",
638+
encoding="utf-8",
639+
)
640+
(tmp_path / "docs" / "index.html").write_text(
641+
'<script id="encrypted-dashboard-data" type="application/json"></script>'
642+
'<script id="export-manifest" type="application/json"></script>',
643+
encoding="utf-8",
644+
)
645+
profile = template_consumer_e2e.ConsumerProfile(
646+
name="chunked-encrypted",
647+
privacy_mode="strong",
648+
repo_is_public=False,
649+
generate_readme=False,
650+
dashboard_secret="DASHBOARD_SECRET_DO_NOT_REPLACE_0123456789",
651+
expected_artifact_mode="encrypted",
652+
expected_publish_pages=True,
653+
)
654+
655+
template_consumer_e2e._assert_successful_profile(tmp_path, profile)
656+
657+
625658
def test_template_docs_do_not_reference_old_brand_or_maintenance_docs(tmp_path):
626659
output = tmp_path / "template"
627660

0 commit comments

Comments
 (0)