From 187d3cfba8f24dcf55a1dbfc9e294ee4b6c1f1e2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 12:02:32 +0000 Subject: [PATCH 1/2] Raise fast-xml-parser entity expansion limit for large JUnit reports fast-xml-parser's default entity-expansion protection caps total XML entity expansions at 1000, which some real JUnit reports with long failure messages exceed, causing "Entity expansion limit exceeded" parse failures. Configure processEntities.maxTotalExpansions to a much higher bound. --- dist/index.js | 7 ++++++- src/main.test.ts | 13 +++++++++++++ src/main.ts | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index f0eb854..4bc2c64 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27655,7 +27655,12 @@ var parser = new import_fast_xml_parser.XMLParser({ textNodeName: "#text", parseAttributeValue: false, trimValues: true, - isArray: (name) => ["testsuite", "testcase", "failure", "error", "skipped"].includes(name) + isArray: (name) => ["testsuite", "testcase", "failure", "error", "skipped"].includes(name), + // JUnit reports with long failure messages can legitimately contain more + // than fast-xml-parser's default 1000-entity expansion cap. + processEntities: { + maxTotalExpansions: 1e5 + } }); function parseJunitXml(xml) { const doc = parser.parse(xml); diff --git a/src/main.test.ts b/src/main.test.ts index 9d8b950..0242000 100644 --- a/src/main.test.ts +++ b/src/main.test.ts @@ -48,6 +48,19 @@ test("parseJunitXml: handles nested ", () => { assert.equal(cases[0]!.classname, "inner.SuiteA"); }); +test("parseJunitXml: handles reports with more than 1000 XML entities", () => { + const entities = "&".repeat(1200); + const xml = ` + + + at ${entities} + +`; + const cases = parseJunitXml(xml); + assert.equal(cases.length, 1); + assert.equal(cases[0]!.status, "failed"); +}); + test("extractLocation: finds file/line in a node-style stack", () => { const loc = extractLocation( "AssertionError: boom\n at Object. (src/util.ts:42:7)\n at Module._compile", diff --git a/src/main.ts b/src/main.ts index 7ea6a16..567f50b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,6 +48,11 @@ const parser = new XMLParser({ trimValues: true, isArray: (name) => ["testsuite", "testcase", "failure", "error", "skipped"].includes(name), + // JUnit reports with long failure messages can legitimately contain more + // than fast-xml-parser's default 1000-entity expansion cap. + processEntities: { + maxTotalExpansions: 100_000, + }, }); export function parseJunitXml(xml: string): TestCase[] { From 8157eb6bf537afb69f38d0c399953bdaeb5ef36c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 12:04:17 +0000 Subject: [PATCH 2/2] Add pnpm-workspace.yaml to allow esbuild/biome install scripts Without this, pnpm install skips their postinstall scripts (needed to fetch the native binaries) and prints an ERR_PNPM_IGNORED_BUILDS warning. --- pnpm-workspace.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pnpm-workspace.yaml diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..c533084 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +allowBuilds: + '@biomejs/biome': true + esbuild: true