Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions tests/approved_css_stage_c_computed_parity_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,11 @@
import shutil
import tempfile
from playwright.async_api import async_playwright
from approved_css_original_bundle_fixture import reconstructed_original_css_html
from approved_css_original_bundle_fixture import restore_original_css_bundle

ROOT = Path(__file__).resolve().parents[1]
PRODUCTION = ROOT / "dist-pages" / "preview"
SHEETS = (
"mixer-console-foundation.css", "mixer-channel-grid.css",
"mixer-section-controls.css", "mixer-section-layout.css",
"mixer-hardware-artwork.css", "mixer-v3-layout-contract.css",
"mixer-chrome-material.css", "mixer-control-keys.css",
"mixer-fx-rack.css", "mixer-plugin-browser.css",
"mixer-pan-controls.css", "mixer-fader-assembly.css",
"mixer-meter-display.css", "mixer-utility-controls.css",
"inter-embedded.css", "mixer-wire-dots.css",
"mixer-wire-out-align-v48.css", "mixer-contextual-buttons.css",
)

PROPERTIES = (
"display", "position", "visibility", "opacity", "width", "height",
"min-width", "min-height", "max-width", "max-height", "top", "left",
Expand Down Expand Up @@ -103,13 +93,7 @@ async def main():
with tempfile.TemporaryDirectory(prefix="armix-css-c-baseline-") as tmp:
before = Path(tmp) / "approved-original-css"
shutil.copytree(PRODUCTION, before)
original_html=reconstructed_original_css_html((before/'index.html').read_text(encoding='utf-8'))
(before/'index.html').write_text(original_html,encoding='utf-8')
for name in SHEETS:
source = (ROOT / ("site/preview-buttons/assets"
if name == "mixer-control-keys.css"
else "site/preview-v2/assets") / name)
shutil.copy2(source, before / "assets" / name)
restore_original_css_bundle(before)
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
try:
Expand Down
21 changes: 21 additions & 0 deletions tests/approved_publication_fixture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Resolve the sole shipped console after checking its exact build provenance.

Authoring HTML is a compiler input, and legacy URLs are redirect shells.
Browser regressions must exercise /preview/index.html, not demand a second
published skin or compare generated HTML with an unassembled input file.
"""
from pathlib import Path
import subprocess
import sys

ROOT = Path(__file__).resolve().parents[1]


def published_console(dist):
dist = Path(dist)
# This existing independent contract checks the complete assembled HTML,
# compiled CSS bytes/hashes, approved PNG assets and legacy-only redirects.
subprocess.run(
[sys.executable, str(ROOT / "tests/single_preview_publication_contract_test.py"),
str(dist)], cwd=ROOT, check=True, capture_output=True, text=True)
return dist / "preview/index.html"
13 changes: 2 additions & 11 deletions tests/approved_stage_c_css_visual_parity_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import asyncio
import hashlib
from pathlib import Path
import re
import shutil
import tempfile

from playwright.async_api import async_playwright
from approved_css_original_bundle_fixture import reconstructed_original_css_html
from approved_css_original_bundle_fixture import restore_original_css_bundle

ROOT=Path(__file__).resolve().parents[1]
COMPILED=ROOT/"dist-pages/preview"
Expand Down Expand Up @@ -74,15 +73,7 @@ async def main():
with tempfile.TemporaryDirectory(prefix="armix-stage-c-original-") as tmp:
baseline=Path(tmp)/"preview"
shutil.copytree(COMPILED,baseline)
original_html=reconstructed_original_css_html((baseline/'index.html').read_text(encoding='utf-8'))
(baseline/'index.html').write_text(original_html,encoding='utf-8')
cssnames=[p.name for p in (COMPILED/"assets").glob("*.css")]
for name in cssnames:
source=(ROOT/("site/preview-buttons/assets"
if name=="mixer-control-keys.css"
else "site/preview-v2/assets")/name)
if source.is_file():
shutil.copyfile(source,baseline/"assets"/name)
restore_original_css_bundle(baseline)
async with async_playwright() as playwright:
browser=await playwright.chromium.launch(headless=True)
try:
Expand Down
Loading