From e08c2bbdfddd1ff7e350280bc745e853fea5d729 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Mon, 18 May 2026 19:41:51 -0700 Subject: [PATCH] fix: add debug logging to CSV upload and cucumber tests --- e2e/csv-upload-deduplication.test.ts | 9 ++++++++ e2e/cucumber-e2e.test.ts | 31 +++++++++++++++++----------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/e2e/csv-upload-deduplication.test.ts b/e2e/csv-upload-deduplication.test.ts index 25b8208..486ee7e 100644 --- a/e2e/csv-upload-deduplication.test.ts +++ b/e2e/csv-upload-deduplication.test.ts @@ -85,6 +85,9 @@ test.describe('CSV Upload Player Deduplication', () => { multipart: formData, }); + if (!response.ok()) { + console.log('CSV upload failed:', response.status(), await response.text()); + } expect(response.ok()).toBeTruthy(); // Check that only 4 unique players were created (not 8) @@ -139,6 +142,9 @@ test.describe('CSV Upload Player Deduplication', () => { multipart: formData, }); + if (!response.ok()) { + console.log('CSV upload failed:', response.status(), await response.text()); + } expect(response.ok()).toBeTruthy(); // Check that players were created without extra whitespace @@ -196,6 +202,9 @@ test.describe('CSV Upload Player Deduplication', () => { multipart: formData, }); + if (!response.ok()) { + console.log('CSV upload failed:', response.status(), await response.text()); + } expect(response.ok()).toBeTruthy(); // Check that the existing player was updated (not duplicated) diff --git a/e2e/cucumber-e2e.test.ts b/e2e/cucumber-e2e.test.ts index 55cfbc9..4a11524 100644 --- a/e2e/cucumber-e2e.test.ts +++ b/e2e/cucumber-e2e.test.ts @@ -7,18 +7,25 @@ test.describe('Cucumber E2E Tests', () => { ? 'https://euchre-ci.notsosm.art' : 'http://localhost:3000'; - const result = execSync( - 'npx cucumber-js --config e2e/cucumber/cucumber.config.ts', - { - encoding: 'utf-8', - stdio: 'pipe', - env: { - ...process.env, - BASE_URL: baseURL, - }, - cwd: process.cwd(), - } - ); + let result; + try { + result = execSync( + 'npx cucumber-js --config e2e/cucumber/cucumber.config.ts', + { + encoding: 'utf-8', + stdio: 'pipe', + env: { + ...process.env, + BASE_URL: baseURL, + }, + cwd: process.cwd(), + } + ); + } catch (error: any) { + console.log('Cucumber stderr:', error.stderr?.toString() || 'none'); + console.log('Cucumber stdout:', error.stdout?.toString() || 'none'); + throw error; + } console.log(result); });