fix: QA sweep fixes — OCR engine mapping, startup log, Playwright config

- Update OCR engine expected name from "paddleocr" to "paddleocr-v5"
  to match actual PaddleOCR PP-OCRv5 engine (eliminates spurious
  fallback warning in logs)
- Show "waiting for AI sidecar startup" instead of misleading
  "No GPU detected" when Python dispatcher hasn't reported yet
- Fix playwright.docker.config.ts testDir to ./tests/e2e-docker
  and align auth storage state path with auth.setup.ts
This commit is contained in:
SnapOtter
2026-04-27 01:13:32 +08:00
parent 733ebe8010
commit b2a1769c8f
3 changed files with 10 additions and 7 deletions
+7 -4
View File
@@ -242,13 +242,16 @@ const cleanupCron = startCleanupCron();
// Start // Start
try { try {
await app.listen({ port: env.PORT, host: "0.0.0.0" }); await app.listen({ port: env.PORT, host: "0.0.0.0" });
const gpu = isGpuAvailable(); const dispatcherStatus = getDispatcherStatus();
const gpuLine = !dispatcherStatus.ready
? "[INFO] GPU status: waiting for AI sidecar startup..."
: dispatcherStatus.gpu
? "[INFO] GPU detected — AI tools will use CUDA acceleration"
: "[WARN] No GPU detected — AI tools will use CPU (slower)";
console.log( console.log(
[ [
`SnapOtter v${APP_VERSION} running on port ${env.PORT}`, `SnapOtter v${APP_VERSION} running on port ${env.PORT}`,
gpu gpuLine,
? "[INFO] GPU detected — AI tools will use CUDA acceleration"
: "[WARN] No GPU detected — AI tools will use CPU (slower)",
`[INFO] Rate limit: ${env.RATE_LIMIT_PER_MIN > 0 ? `${env.RATE_LIMIT_PER_MIN}/min` : "disabled"}`, `[INFO] Rate limit: ${env.RATE_LIMIT_PER_MIN > 0 ? `${env.RATE_LIMIT_PER_MIN}/min` : "disabled"}`,
`[INFO] Upload limit: ${env.MAX_UPLOAD_SIZE_MB > 0 ? `${env.MAX_UPLOAD_SIZE_MB} MB` : "unlimited"}`, `[INFO] Upload limit: ${env.MAX_UPLOAD_SIZE_MB > 0 ? `${env.MAX_UPLOAD_SIZE_MB} MB` : "unlimited"}`,
`[INFO] Trust proxy: ${env.TRUST_PROXY}`, `[INFO] Trust proxy: ${env.TRUST_PROXY}`,
+1 -1
View File
@@ -151,7 +151,7 @@ export function registerOcr(app: FastifyInstance) {
} }
const expectedEngine = const expectedEngine =
tier === "fast" ? "tesseract" : tier === "balanced" ? "paddleocr" : "paddleocr-vl"; tier === "fast" ? "tesseract" : tier === "balanced" ? "paddleocr-v5" : "paddleocr-vl";
if (result.engine && result.engine !== expectedEngine) { if (result.engine && result.engine !== expectedEngine) {
request.log.warn( request.log.warn(
{ toolId: "ocr", requested: tier, expected: expectedEngine, actual: result.engine }, { toolId: "ocr", requested: tier, expected: expectedEngine, actual: result.engine },
+2 -2
View File
@@ -1,7 +1,7 @@
import path from "node:path"; import path from "node:path";
import { defineConfig, devices } from "@playwright/test"; import { defineConfig, devices } from "@playwright/test";
const authFile = path.join(__dirname, "test-results", ".auth", "user.json"); const authFile = path.join(__dirname, "test-results", ".auth", "analytics-user.json");
// Point raw-fetch tests (api.spec, security.spec, people.spec, rbac.spec) at // Point raw-fetch tests (api.spec, security.spec, people.spec, rbac.spec) at
// the Docker container instead of the dev-server default (port 13490). // the Docker container instead of the dev-server default (port 13490).
@@ -10,7 +10,7 @@ const containerUrl = process.env.BASE_URL || "http://localhost:1349";
process.env.API_URL ??= containerUrl; process.env.API_URL ??= containerUrl;
export default defineConfig({ export default defineConfig({
testDir: "./tests/e2e", testDir: "./tests/e2e-docker",
timeout: 600_000, timeout: 600_000,
expect: { expect: {
timeout: 60_000, timeout: 60_000,