From a80731a162ddb756766031bd2bb2b789f0919a5d Mon Sep 17 00:00:00 2001 From: moilanik Date: Sat, 13 Jun 2026 16:06:56 +0300 Subject: [PATCH] joku muutos --- .../step_definitions/test-execution.steps.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/features/step_definitions/test-execution.steps.js b/tests/features/step_definitions/test-execution.steps.js index 264a861..8657eb7 100644 --- a/tests/features/step_definitions/test-execution.steps.js +++ b/tests/features/step_definitions/test-execution.steps.js @@ -21,14 +21,6 @@ function bash(cmd) { } } -function envBlock() { - return [ - 'export GITEA_API_URL="http://localhost:18080"', - 'export GITEA_TOKEN="test-token-abc123"', - 'export DISPATCH_POLL_INTERVAL="0.1"', - ].join('; '); -} - function setupMock(seqJson) { execSync('lsof -ti :18080 2>/dev/null | xargs -r kill -9 2>/dev/null || true', { stdio: 'ignore' }); execSync('sleep 0.4', { stdio: 'ignore' }); @@ -62,7 +54,7 @@ function setupMock(seqJson) { } function runDispatch(args) { - return bash(`${envBlock()}; bash "${DISPATCH_SCRIPT}" ${args}`); + return bash(`export DISPATCH_POLL_INTERVAL="0.1"; bash "${DISPATCH_SCRIPT}" ${args}`); } Given('a deployment has completed in the target environment', function () { @@ -77,7 +69,7 @@ When('a test workflow is dispatched to a test project', function () { { code: 200, body: { workflow_runs: [{ id: 1, status: 'running' }] } }, { code: 200, body: { id: 1, status: 'completed', conclusion: 'success' } }, ])); - const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\''); + const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\' "http://localhost:18080" "test-token-abc123"'); this.dispatchResult = r.status; }); @@ -95,7 +87,7 @@ When('a test workflow is dispatched and the tests fail', function () { { code: 200, body: { workflow_runs: [{ id: 1, status: 'running' }] } }, { code: 200, body: { id: 1, status: 'completed', conclusion: 'failure' } }, ])); - const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\''); + const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\' "http://localhost:18080" "test-token-abc123"'); this.dispatchResult = r.status; }); @@ -111,7 +103,7 @@ When('a test workflow is dispatched but does not finish within the allowed time' { code: 200, body: { id: 1, status: 'running' } }, { code: 200, body: { id: 1, status: 'running' } }, ])); - const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\' "0.001"'); + const r = runDispatch('"test-owner/test-repo" "test.yml" "main" \'{"version":"1.2.3"}\' "http://localhost:18080" "test-token-abc123" "0.001"'); this.dispatchResult = r.status; });