Build 20nm final release candidate
This commit is contained in:
@@ -53,6 +53,7 @@ def parse_args() -> argparse.Namespace:
|
||||
parser.add_argument("--toolbar-height", type=int, default=150)
|
||||
parser.add_argument("--bottom-trim", type=int, default=170)
|
||||
parser.add_argument("--timeout-sec", type=int, default=120)
|
||||
parser.add_argument("--virtual-time-budget-ms", type=int, default=30000)
|
||||
parser.add_argument("--hotspots-json", type=Path, default=DEFAULT_HOTSPOTS_PATH)
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -62,11 +63,18 @@ def fetch_compare_version(compare_url: str) -> str | None:
|
||||
text = requests.get(compare_url, timeout=20).text
|
||||
except Exception:
|
||||
return None
|
||||
match = re.search(r'const\s+COMPARE_VERSION\s*=\s*"([^"]+)"', text)
|
||||
match = re.search(r'const\s+(?:COMPARE_VERSION|HTML_VERSION)\s*=\s*"([^"]+)"', text)
|
||||
return match.group(1) if match else None
|
||||
|
||||
|
||||
def run_browser_screenshot(compare_url: str, output_png: Path, width: int, height: int, timeout_sec: int) -> None:
|
||||
def run_browser_screenshot(
|
||||
compare_url: str,
|
||||
output_png: Path,
|
||||
width: int,
|
||||
height: int,
|
||||
timeout_sec: int,
|
||||
virtual_time_budget_ms: int,
|
||||
) -> None:
|
||||
cmd = [
|
||||
"timeout",
|
||||
f"{timeout_sec}s",
|
||||
@@ -75,7 +83,7 @@ def run_browser_screenshot(compare_url: str, output_png: Path, width: int, heigh
|
||||
"--disable-gpu",
|
||||
"--enable-unsafe-swiftshader",
|
||||
"--no-sandbox",
|
||||
"--virtual-time-budget=15000",
|
||||
f"--virtual-time-budget={virtual_time_budget_ms}",
|
||||
f"--window-size={width},{height}",
|
||||
f"--screenshot={output_png}",
|
||||
compare_url,
|
||||
@@ -354,7 +362,14 @@ def main() -> None:
|
||||
right_png = args.output_dir / "compare_right.png"
|
||||
diff_png = args.output_dir / "compare_diff.png"
|
||||
|
||||
run_browser_screenshot(args.compare_url, full_png, args.width, args.height, args.timeout_sec)
|
||||
run_browser_screenshot(
|
||||
args.compare_url,
|
||||
full_png,
|
||||
args.width,
|
||||
args.height,
|
||||
args.timeout_sec,
|
||||
args.virtual_time_budget_ms,
|
||||
)
|
||||
visual_metrics = save_visual_outputs(
|
||||
full_png=full_png,
|
||||
left_png=left_png,
|
||||
|
||||
Reference in New Issue
Block a user