test_q3_release_desktop_performance.py
file-level
1
files
1
commits
0
hotspots
0
🧊 dead
0
💥 blast risk
| 1 | """Performance tests for Q3-release desktop installers (§QR.13).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import time |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from tests.fixtures.desktop_release import GIT_SHA_FIXTURE, RELEASE_WORKFLOW, sample_signed_artifacts |
| 9 | from tools.desktop_release.constants import VERSION_ALIGN_PERF_BOUND_SECONDS |
| 10 | from tools.desktop_release.manifest import build_manifest, validate_manifest |
| 11 | from tools.desktop_release.refuse import scan_text_for_secret_patterns |
| 12 | from tools.desktop_release.version_align import check_version_alignment |
| 13 | from tests.support import KIT_ROOT |
| 14 | |
| 15 | |
| 16 | def test_version_align_and_manifest_within_bound() -> None: |
| 17 | start = time.perf_counter() |
| 18 | check_version_alignment(KIT_ROOT) |
| 19 | doc = build_manifest( |
| 20 | version="0.1.0", |
| 21 | git_sha=GIT_SHA_FIXTURE, |
| 22 | artifacts=sample_signed_artifacts(), |
| 23 | ) |
| 24 | validate_manifest(doc) |
| 25 | elapsed = time.perf_counter() - start |
| 26 | assert elapsed <= VERSION_ALIGN_PERF_BOUND_SECONDS, elapsed |
| 27 | |
| 28 | |
| 29 | def test_secret_scan_bounded_to_release_workflow_paths() -> None: |
| 30 | """Scan release workflow paths only — not a full-repo secret hunt.""" |
| 31 | paths = [ |
| 32 | RELEASE_WORKFLOW, |
| 33 | KIT_ROOT / ".github" / "workflows" / "desktop-build-smoke.yml", |
| 34 | KIT_ROOT / "templates" / "ci" / "desktop-release-github-actions.yml", |
| 35 | ] |
| 36 | start = time.perf_counter() |
| 37 | for path in paths: |
| 38 | assert path.is_file() |
| 39 | assert scan_text_for_secret_patterns(path.read_text(encoding="utf-8")) == [] |
| 40 | elapsed = time.perf_counter() - start |
| 41 | assert elapsed < 1.0, elapsed |