test(web): extend timeout for ExcelJS-based excel import tests
CI / Architecture Guardrails (push) Successful in 3m44s
CI / Assistant Split Regression (push) Successful in 5m16s
CI / Typecheck (push) Successful in 7m23s
CI / Lint (push) Successful in 8m20s
CI / Unit Tests (push) Successful in 8m22s
CI / E2E Tests (push) Failing after 5m12s
CI / Fresh-Linux Docker Deploy (push) Failing after 8m19s
CI / Release Images (push) Has been skipped
CI / Build (push) Successful in 7m34s
CI / Architecture Guardrails (push) Successful in 3m44s
CI / Assistant Split Regression (push) Successful in 5m16s
CI / Typecheck (push) Successful in 7m23s
CI / Lint (push) Successful in 8m20s
CI / Unit Tests (push) Successful in 8m22s
CI / E2E Tests (push) Failing after 5m12s
CI / Fresh-Linux Docker Deploy (push) Failing after 8m19s
CI / Release Images (push) Has been skipped
CI / Build (push) Successful in 7m34s
ExcelJS dynamic import + workbook writeBuffer exceeds the default 5s vitest timeout on the constrained QNAP CI runner, matching the same pattern already applied to skillMatrixParser.test.ts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,7 @@
|
|||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import { MAX_BROWSER_SPREADSHEET_BYTES, assertSpreadsheetFile, parseSpreadsheet } from "./excel.js";
|
||||||
MAX_BROWSER_SPREADSHEET_BYTES,
|
|
||||||
assertSpreadsheetFile,
|
|
||||||
parseSpreadsheet,
|
|
||||||
} from "./excel.js";
|
|
||||||
|
|
||||||
async function createWorkbookFile(
|
async function createWorkbookFile(rows: unknown[][], fileName = "spreadsheet.xlsx"): Promise<File> {
|
||||||
rows: unknown[][],
|
|
||||||
fileName = "spreadsheet.xlsx",
|
|
||||||
): Promise<File> {
|
|
||||||
const ExcelJS = await import("exceljs");
|
const ExcelJS = await import("exceljs");
|
||||||
const workbook = new ExcelJS.Workbook();
|
const workbook = new ExcelJS.Workbook();
|
||||||
const worksheet = workbook.addWorksheet("Sheet1");
|
const worksheet = workbook.addWorksheet("Sheet1");
|
||||||
@@ -25,11 +18,9 @@ async function createWorkbookFile(
|
|||||||
|
|
||||||
describe("excel import helpers", () => {
|
describe("excel import helpers", () => {
|
||||||
it("parses csv files with quoted values and skips blank rows", async () => {
|
it("parses csv files with quoted values and skips blank rows", async () => {
|
||||||
const file = new File(
|
const file = new File(['name,role\n"Alice, A.",Engineer\n\nBob,Producer\n'], "people.csv", {
|
||||||
['name,role\n"Alice, A.",Engineer\n\nBob,Producer\n'],
|
type: "text/csv",
|
||||||
"people.csv",
|
});
|
||||||
{ type: "text/csv" },
|
|
||||||
);
|
|
||||||
|
|
||||||
await expect(parseSpreadsheet(file)).resolves.toEqual([
|
await expect(parseSpreadsheet(file)).resolves.toEqual([
|
||||||
{ name: "Alice, A.", role: "Engineer" },
|
{ name: "Alice, A.", role: "Engineer" },
|
||||||
@@ -38,6 +29,7 @@ describe("excel import helpers", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("parses xlsx files and normalizes date cells to ISO strings", async () => {
|
it("parses xlsx files and normalizes date cells to ISO strings", async () => {
|
||||||
|
// ExcelJS dynamic import + workbook writeBuffer is slow on constrained CI runners.
|
||||||
const file = await createWorkbookFile([
|
const file = await createWorkbookFile([
|
||||||
["name", "startDate", "active"],
|
["name", "startDate", "active"],
|
||||||
["Alice", new Date("2026-03-30T09:15:00.000Z"), true],
|
["Alice", new Date("2026-03-30T09:15:00.000Z"), true],
|
||||||
@@ -50,7 +42,7 @@ describe("excel import helpers", () => {
|
|||||||
active: "true",
|
active: "true",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
});
|
}, 30000);
|
||||||
|
|
||||||
it("rejects duplicate headers in xlsx imports", async () => {
|
it("rejects duplicate headers in xlsx imports", async () => {
|
||||||
const file = await createWorkbookFile([
|
const file = await createWorkbookFile([
|
||||||
@@ -59,16 +51,14 @@ describe("excel import helpers", () => {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
await expect(parseSpreadsheet(file)).rejects.toThrow('duplicate header "name"');
|
await expect(parseSpreadsheet(file)).rejects.toThrow('duplicate header "name"');
|
||||||
});
|
}, 30000);
|
||||||
|
|
||||||
it("rejects legacy .xls uploads before parsing", () => {
|
it("rejects legacy .xls uploads before parsing", () => {
|
||||||
const file = new File(["legacy"], "legacy.xls", {
|
const file = new File(["legacy"], "legacy.xls", {
|
||||||
type: "application/vnd.ms-excel",
|
type: "application/vnd.ms-excel",
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(() => assertSpreadsheetFile(file)).toThrow(
|
expect(() => assertSpreadsheetFile(file)).toThrow("Legacy .xls files are not supported.");
|
||||||
"Legacy .xls files are not supported.",
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("rejects oversized spreadsheet uploads before parsing", () => {
|
it("rejects oversized spreadsheet uploads before parsing", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user