fix: resolve ONNX CUDA fallback, Docker e2e infrastructure, and all test failures

- Add safe_onnx_session() to gpu.py with graceful CUDA EP → CPU fallback
- Replace bare ort.InferenceSession() calls across colorize, restore, inpaint, remove_bg
- Add libcublas-12-6 to production Dockerfile for ONNX Runtime CUDA EP
- Add skipIfFeatureNotInstalled guards to remove-bg, blur-faces, smart-crop, ocr, noise-removal e2e specs
- Add AI tool install prompt detection in tools-all.spec.ts
- Add smart-crop to PYTHON_SIDECAR_TOOLS so frontend shows install prompt correctly
- Create Dockerfile.test.dockerignore to include tests/ in test image builds
- Add libheif-examples and exiftool to Dockerfile.test for HEIC and metadata tests
- Regenerate visual regression baselines for Docker/Linux and skip on non-Docker platforms
This commit is contained in:
ashim-hq
2026-04-20 20:53:54 +08:00
parent f67a03bb36
commit 37277e5c09
23 changed files with 203 additions and 94 deletions
+11 -8
View File
@@ -1,15 +1,10 @@
import { expect, test, uploadTestImage } from "./helpers";
// ---------------------------------------------------------------------------
// Visual regression tests: capture screenshots at different viewport sizes
// and compare against stored baselines. On the first run, Playwright will
// generate the reference snapshots. Subsequent runs will diff against them.
//
// To update baselines after intentional UI changes:
// npx playwright test visual-regression --update-snapshots
// ---------------------------------------------------------------------------
const isDocker = process.env.CI === "true" || process.env.DOCKER === "true";
test.describe("Visual regression: Home page", () => {
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
test("home page layout - desktop", async ({ loggedInPage: page }) => {
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto("/");
@@ -49,6 +44,8 @@ test.describe("Visual regression: Home page", () => {
});
test.describe("Visual regression: Login page", () => {
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
test("login page layout - desktop", async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto("/login");
@@ -75,6 +72,8 @@ test.describe("Visual regression: Login page", () => {
});
test.describe("Visual regression: Tool pages", () => {
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
test("resize tool - desktop (empty state)", async ({ loggedInPage: page }) => {
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto("/resize");
@@ -139,6 +138,8 @@ test.describe("Visual regression: Tool pages", () => {
});
test.describe("Visual regression: Fullscreen grid", () => {
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
test("fullscreen grid - desktop", async ({ loggedInPage: page }) => {
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto("/fullscreen");
@@ -177,6 +178,8 @@ test.describe("Visual regression: Fullscreen grid", () => {
});
test.describe("Visual regression: Sidebar", () => {
test.skip(!isDocker, "Visual regression baselines are Docker-specific");
test("sidebar collapsed vs expanded appearance - desktop", async ({ loggedInPage: page }) => {
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto("/");