mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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:
@@ -45,6 +45,16 @@ const TOOLS_WITH_DROPZONE = [
|
||||
|
||||
const TOOLS_WITHOUT_DROPZONE = [{ id: "qr-generate", name: "QR Code" }];
|
||||
|
||||
const AI_TOOL_IDS = new Set([
|
||||
"remove-background",
|
||||
"upscale",
|
||||
"erase-object",
|
||||
"ocr",
|
||||
"blur-faces",
|
||||
"smart-crop",
|
||||
"noise-removal",
|
||||
]);
|
||||
|
||||
test.describe("All tool pages render", () => {
|
||||
for (const tool of TOOLS_WITH_DROPZONE) {
|
||||
test(`${tool.name} (/${tool.id}) loads with dropzone`, async ({ loggedInPage: page }) => {
|
||||
@@ -53,6 +63,17 @@ test.describe("All tool pages render", () => {
|
||||
// Tool name should be visible
|
||||
await expect(page.getByText(tool.name, { exact: false }).first()).toBeVisible();
|
||||
|
||||
// AI tools may show install prompt instead of dropzone when feature is not installed
|
||||
if (AI_TOOL_IDS.has(tool.id)) {
|
||||
const uploadVisible = await page.getByText("Upload from computer").isVisible();
|
||||
if (!uploadVisible) {
|
||||
await expect(
|
||||
page.getByText(/additional download|Feature Not Enabled/i).first(),
|
||||
).toBeVisible();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Should show dropzone (some tools like collage use custom upload text)
|
||||
const uploadText = (tool as any).customDropzone
|
||||
? page.getByText(/upload/i).first()
|
||||
|
||||
Reference in New Issue
Block a user