mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: add 60s timeout to all HEIF integration tests for CI
HEIF decoding via heif-convert is slow on CI runners (~15-30s per image) and exceeds the default 30s Vitest timeout. Add explicit 60s timeouts to all 16 HEIF input tests across integration suite.
This commit is contained in:
@@ -829,7 +829,7 @@ describe("Barcode Read", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("reads barcodes from a HEIF image", async () => {
|
it("reads barcodes from a HEIF image", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ describe("Border", () => {
|
|||||||
expect(result.processedSize).toBeGreaterThan(0);
|
expect(result.processedSize).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("handles HEIF input (motorcycle.heif)", async () => {
|
it("handles HEIF input (motorcycle.heif)", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ describe("Bulk Rename", () => {
|
|||||||
|
|
||||||
// ── HEIF file handling ─────────────────────────────────────────
|
// ── HEIF file handling ─────────────────────────────────────────
|
||||||
|
|
||||||
it("renames HEIF files preserving extension", async () => {
|
it("renames HEIF files preserving extension", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -1457,7 +1457,7 @@ describe("Collage", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("handles HEIF input images", async () => {
|
it("handles HEIF input images", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "f1", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
{ name: "f1", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ describe("Solid white image", () => {
|
|||||||
|
|
||||||
// ── HEIF input ─────────────────────────────────────────────────
|
// ── HEIF input ─────────────────────────────────────────────────
|
||||||
describe("HEIF input", () => {
|
describe("HEIF input", () => {
|
||||||
it("extracts palette from HEIF image", async () => {
|
it("extracts palette from HEIF image", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body: payload, contentType } = makeFilePayload(HEIF, "photo.heif", "image/heif");
|
const { body: payload, contentType } = makeFilePayload(HEIF, "photo.heif", "image/heif");
|
||||||
const res = await app.inject({
|
const res = await app.inject({
|
||||||
|
|||||||
@@ -776,7 +776,7 @@ describe("Compare", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("compares HEIF image with PNG", async () => {
|
it("compares HEIF image with PNG", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ describe("Compose", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("handles HEIF base image", async () => {
|
it("handles HEIF base image", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "base.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "base.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -682,7 +682,7 @@ describe("favicon", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ────────────────────────────────────────────
|
// ── HEIF format input ────────────────────────────────────────────
|
||||||
|
|
||||||
it("generates favicons from HEIF input", async () => {
|
it("generates favicons from HEIF input", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -601,7 +601,7 @@ describe("Authentication", () => {
|
|||||||
|
|
||||||
// ── HEIF input ─────────────────────────────────────────────────
|
// ── HEIF input ─────────────────────────────────────────────────
|
||||||
describe("HEIF input", () => {
|
describe("HEIF input", () => {
|
||||||
it("enhances HEIF (sample.heif) input", async () => {
|
it("enhances HEIF (sample.heif) input", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||||
const res = await postTool({ mode: "auto" }, HEIF, "sample.heif", "image/heif");
|
const res = await postTool({ mode: "auto" }, HEIF, "sample.heif", "image/heif");
|
||||||
expect([200, 422]).toContain(res.statusCode);
|
expect([200, 422]).toContain(res.statusCode);
|
||||||
|
|||||||
@@ -589,7 +589,7 @@ describe("Info", () => {
|
|||||||
|
|
||||||
// ── HEIF format info ──────────────────────────────────────────
|
// ── HEIF format info ──────────────────────────────────────────
|
||||||
|
|
||||||
it("returns correct metadata for HEIF (sample.heif) image", async () => {
|
it("returns correct metadata for HEIF (sample.heif) image", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "sample.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "sample.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ describe("Authentication", () => {
|
|||||||
|
|
||||||
// ── HEIF input handling ───────────────────────────────────────
|
// ── HEIF input handling ───────────────────────────────────────
|
||||||
describe("HEIF input", () => {
|
describe("HEIF input", () => {
|
||||||
it("optimizes HEIF (sample.heif) input to webp", async () => {
|
it("optimizes HEIF (sample.heif) input to webp", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||||
const res = await postTool({ format: "webp" }, HEIF, "sample.heif", "image/heif");
|
const res = await postTool({ format: "webp" }, HEIF, "sample.heif", "image/heif");
|
||||||
// HEIF decode may not be available
|
// HEIF decode may not be available
|
||||||
|
|||||||
@@ -1389,7 +1389,7 @@ describe("Split", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("splits a HEIF input image", async () => {
|
it("splits a HEIF input image", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -1487,7 +1487,7 @@ describe("Stitch", () => {
|
|||||||
|
|
||||||
// ── HEIF format input ─────────────────────────────────────────────
|
// ── HEIF format input ─────────────────────────────────────────────
|
||||||
|
|
||||||
it("handles HEIF input in stitching", async () => {
|
it("handles HEIF input in stitching", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "f1", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
{ name: "f1", filename: "a.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -532,24 +532,29 @@ describe("text-overlay", () => {
|
|||||||
|
|
||||||
// ── HEIF input ───────────────────────────────────────────────────
|
// ── HEIF input ───────────────────────────────────────────────────
|
||||||
|
|
||||||
it("handles HEIF input (motorcycle.heif)", async () => {
|
it(
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
"handles HEIF input (motorcycle.heif)",
|
||||||
const { body, contentType } = createMultipartPayload([
|
{ timeout: 60_000 },
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
async () => {
|
||||||
{ name: "settings", content: JSON.stringify({ text: "HEIF overlay" }) },
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
]);
|
const { body, contentType } = createMultipartPayload([
|
||||||
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
{ name: "settings", content: JSON.stringify({ text: "HEIF overlay" }) },
|
||||||
|
]);
|
||||||
|
|
||||||
const res = await app.inject({
|
const res = await app.inject({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/tools/text-overlay",
|
url: "/api/v1/tools/text-overlay",
|
||||||
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
||||||
body,
|
body,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(res.statusCode).toBe(200);
|
expect(res.statusCode).toBe(200);
|
||||||
const json = JSON.parse(res.body);
|
const json = JSON.parse(res.body);
|
||||||
expect(json.downloadUrl).toBeDefined();
|
expect(json.downloadUrl).toBeDefined();
|
||||||
}, 60_000);
|
},
|
||||||
|
60_000,
|
||||||
|
);
|
||||||
|
|
||||||
// ── Animated GIF input ──────────────────────────────────────────
|
// ── Animated GIF input ──────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ describe("vectorize", () => {
|
|||||||
|
|
||||||
// ── HEIF input ───────────────────────────────────────────────
|
// ── HEIF input ───────────────────────────────────────────────
|
||||||
|
|
||||||
it("works with HEIF (sample.heif) input after decoding", async () => {
|
it("works with HEIF (sample.heif) input after decoding", { timeout: 60_000 }, async () => {
|
||||||
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
const HEIF = readFileSync(join(FIXTURES, "formats", "sample.heif"));
|
||||||
const { body, contentType } = createMultipartPayload([
|
const { body, contentType } = createMultipartPayload([
|
||||||
{ name: "file", filename: "sample.heif", contentType: "image/heif", content: HEIF },
|
{ name: "file", filename: "sample.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
|||||||
@@ -520,24 +520,29 @@ describe("watermark-text", () => {
|
|||||||
|
|
||||||
// ── HEIF input ───────────────────────────────────────────────────
|
// ── HEIF input ───────────────────────────────────────────────────
|
||||||
|
|
||||||
it("handles HEIF input (motorcycle.heif)", async () => {
|
it(
|
||||||
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
"handles HEIF input (motorcycle.heif)",
|
||||||
const { body, contentType } = createMultipartPayload([
|
{ timeout: 60_000 },
|
||||||
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
async () => {
|
||||||
{ name: "settings", content: JSON.stringify({ text: "HEIF Test" }) },
|
const HEIF = readFileSync(join(FIXTURES, "content", "motorcycle.heif"));
|
||||||
]);
|
const { body, contentType } = createMultipartPayload([
|
||||||
|
{ name: "file", filename: "photo.heif", contentType: "image/heif", content: HEIF },
|
||||||
|
{ name: "settings", content: JSON.stringify({ text: "HEIF Test" }) },
|
||||||
|
]);
|
||||||
|
|
||||||
const res = await app.inject({
|
const res = await app.inject({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "/api/v1/tools/watermark-text",
|
url: "/api/v1/tools/watermark-text",
|
||||||
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType },
|
||||||
body,
|
body,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(res.statusCode).toBe(200);
|
expect(res.statusCode).toBe(200);
|
||||||
const json = JSON.parse(res.body);
|
const json = JSON.parse(res.body);
|
||||||
expect(json.downloadUrl).toBeDefined();
|
expect(json.downloadUrl).toBeDefined();
|
||||||
}, 60_000);
|
},
|
||||||
|
60_000,
|
||||||
|
);
|
||||||
|
|
||||||
// ── Animated GIF input ──────────────────────────────────────────
|
// ── Animated GIF input ──────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user