From 40facf62939b9f818d09756bad5c14e09b9046fd Mon Sep 17 00:00:00 2001 From: Rodrigo Belfiore Date: Wed, 14 Oct 2026 19:16:47 +0000 Subject: [PATCH] Run browser tests on the GPU on Linux ANGLE on Vulkan gives headless Chromium the machine's GPU in place of SwiftShader. The editing test waits for the mask's histogram to change after exposure instead of reading a stale one, and gets the 90 s timeout the other long workflows have. Co-Authored-By: Claude Opus 5.5 --- playwright.config.ts | 6 +++--- tests/editing.e2e.ts | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index b96ad57c..a3ffb8da 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -2,13 +2,13 @@ import { defineConfig } from "@playwright/test"; const args = ["--enable-unsafe-webgpu"]; const features = ["WebMCP"]; -if (process.platform !== "darwin") { +if (process.platform === "win32") { args.push("--use-webgpu-adapter=swiftshader"); } if (process.platform === "linux") { - // Vulkan enables image transfers; ANGLE's SwiftShader path presents canvases in headless Chromium. + // ANGLE on Vulkan gives headless Chromium the machine's GPU for WebGPU and canvases. features.push("Vulkan"); - args.push("--use-angle=swiftshader", "--use-vulkan=swiftshader"); + args.push("--use-angle=vulkan"); } args.push(`--enable-features=${features.join(",")}`); diff --git a/tests/editing.e2e.ts b/tests/editing.e2e.ts index b33beefe..8aa0279c 100644 --- a/tests/editing.e2e.ts +++ b/tests/editing.e2e.ts @@ -7,6 +7,7 @@ import { box, choose, drag, zoom } from "./pointer"; test("edit a photo, inspect the preview and histograms, undo changes, and export", async ({ page, }) => { + test.setTimeout(90_000); const state = () => page.evaluate(() => window.openlight.getState()); await openPhoto(page); const canvas = page @@ -291,11 +292,12 @@ test("edit a photo, inspect the preview and histograms, undo changes, and export // A neutral mask receives the same pixels, counted only where it covers them. await expect(plot).toHaveAttribute("points", /,\d{1,2}\./); await expect(plot).not.toHaveAttribute("points", whole); + const neutral = (await plot.getAttribute("points")) ?? ""; await page.evaluate( (mask) => window.openlight.setAdjustments({ exposure: 1 }, mask), mask, ); - await expect(plot).toHaveAttribute("points", /,\d{1,2}\./); + await expect(plot).not.toHaveAttribute("points", neutral); const points = (await plot.getAttribute("points")) ?? ""; await page .getByRole("button", { name: "Show Curve input mask", exact: true })