Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Add timeout and diagnostic logging to the JUnit hook-rewrite CI step (#75201)

Oleh Kb757d6b6bf37
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index 6050c352e63..9daedaaac99 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -183,9 +183,11 @@ jobs:
- name: Rewrite JUnit hook failures (partial rollout)
if: always()
continue-on-error: true
+ timeout-minutes: 1
shell: bash
run: |
if [ -d ./target/junit ]; then
+ echo "fix-junit-hooks: invoking bun"
bun e2e/support/fix-junit-hooks.ts ./target/junit \
--include sharing/public-resource-downloads \
--include sharing/sharing-reproductions \
diff --git a/.github/workflows/embedding-sdk-component-tests.yml b/.github/workflows/embedding-sdk-component-tests.yml
index 632879d92a3..6a5be66cc39 100644
--- a/.github/workflows/embedding-sdk-component-tests.yml
+++ b/.github/workflows/embedding-sdk-component-tests.yml
@@ -90,9 +90,11 @@ jobs:
- name: Rewrite JUnit hook failures (dry-run)
if: always()
continue-on-error: true
+ timeout-minutes: 1
shell: bash
run: |
if [ -d ./target/junit ]; then
+ echo "fix-junit-hooks: invoking bun"
bun e2e/support/fix-junit-hooks.ts --dry-run ./target/junit
else
echo "No ./target/junit directory; nothing to process."
@@ -254,9 +256,11 @@ jobs:
- name: Rewrite JUnit hook failures (dry-run)
if: always()
continue-on-error: true
+ timeout-minutes: 1
shell: bash
run: |
if [ -d ./target/junit ]; then
+ echo "fix-junit-hooks: invoking bun"
bun e2e/support/fix-junit-hooks.ts --dry-run ./target/junit
else
echo "No ./target/junit directory; nothing to process."
diff --git a/e2e/support/fix-junit-hooks.ts b/e2e/support/fix-junit-hooks.ts
index f198572c523..0818947ce30 100755
--- a/e2e/support/fix-junit-hooks.ts
+++ b/e2e/support/fix-junit-hooks.ts
@@ -49,6 +49,8 @@ type Result = {
rewrites: Rewrite[];
};
+console.error("fix-junit-hooks: parsing arguments");
+
const program = new Command();
program
.name("fix-junit-hooks")
@@ -72,6 +74,10 @@ program
const [inDir, outDir = inDir] = program.processedArgs as [string, string?];
const { dryRun = false, include: includes } = program.opts<Options>();
+console.error(
+ `fix-junit-hooks: start (in=${inDir}, out=${outDir}, dryRun=${dryRun}, includes=[${includes.join(", ")}])`,
+);
+
if (!statSync(inDir).isDirectory()) {
console.error(`error: <input-dir> must be a directory, got ${inDir}`);
process.exit(1);
@@ -226,11 +232,16 @@ const files = readdirSync(inDir)
.filter((f) => f.endsWith(".xml"))
.sort();
+console.error(`fix-junit-hooks: found ${files.length} XML file(s)`);
+
let totalScanned = 0;
let totalRewritten = 0;
for (const f of files) {
const inP = join(inDir, f);
const outP = inDir === outDir ? inP : join(outDir, f);
+ console.error(
+ `fix-junit-hooks: processing ${f} (${statSync(inP).size} bytes)`,
+ );
const r = processFile(inP, outP);
console.error(summarize(inP, r));
totalScanned += r.scanned;