From db9d6daebbae55221510deab5513d945950dd2db Mon Sep 17 00:00:00 2001 From: moilanik Date: Mon, 22 Jun 2026 07:53:38 +0300 Subject: [PATCH] fix --- .../step_definitions/gitops-update.steps.js | 3 ++- .../step_definitions/test-execution.steps.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/features/step_definitions/gitops-update.steps.js b/tests/features/step_definitions/gitops-update.steps.js index f73ec4f..997a0a8 100644 --- a/tests/features/step_definitions/gitops-update.steps.js +++ b/tests/features/step_definitions/gitops-update.steps.js @@ -74,7 +74,8 @@ function requestCount() { } function gitCalls() { - const out = bash(`cat "${GIT_CALLS_FILE || '/dev/null'}" 2>/dev/null || echo ""`).stdout; + const callsFile = process.env.GIT_CALLS_FILE || '/dev/null'; + const out = bash(`cat "${callsFile}" 2>/dev/null || echo ""`).stdout; return out.split('\n').filter(l => l.length > 0); } diff --git a/tests/features/step_definitions/test-execution.steps.js b/tests/features/step_definitions/test-execution.steps.js index 4e921d9..27fe35d 100644 --- a/tests/features/step_definitions/test-execution.steps.js +++ b/tests/features/step_definitions/test-execution.steps.js @@ -15,7 +15,7 @@ function bash(cmd) { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], }); - return { status: 0, stdout: out }; + return { status: 0, stdout: out, stderr: '' }; } catch (e) { return { status: e.status, stdout: e.stdout || '', stderr: e.stderr || '' }; } @@ -98,15 +98,19 @@ Then('the calling pipeline reports failure', function () { When('a test workflow is dispatched but does not finish within the allowed time', function () { setupMock(JSON.stringify([ { code: 201 }, - { code: 200, body: { workflow_runs: [{ id: 1, status: 'running' }] } }, - { code: 200, body: { id: 1, status: 'running' } }, - { code: 200, body: { id: 1, status: 'running' } }, - { code: 200, body: { id: 1, status: 'running' } }, + { code: 200, body: { workflow_runs: [] } }, + { code: 200, body: { workflow_runs: [] } }, + { code: 200, body: { workflow_runs: [] } }, + { code: 200, body: { workflow_runs: [] } }, + { code: 200, body: { workflow_runs: [] } }, ])); const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\' "http://localhost:18080" "test-token-abc123" "0.05"'); this.dispatchResult = r.status; + this.dispatchStderr = r.stderr; }); Then('the calling pipeline reports a timeout error', function () { - if (this.dispatchResult !== 124) throw new Error(`Expected timeout exit 124, got ${this.dispatchResult}`); + if (this.dispatchResult !== 124) { + throw new Error(`Expected timeout exit 124, got ${this.dispatchResult}. stderr: ${(this.dispatchStderr || '').substring(0,300)}`); + } });