runner päivityksessä cucumber testi meni pieleen. korjaus
CI / Load gitea-env.conf to pipeline env (push) Successful in 12s
ci-check Build version 0.1.0 required
ci-cucumber Cucumber tests
ci-bats Bats tests
ci-build Build complete
CI / Build & Push Artifact (push) Successful in 2m30s

This commit is contained in:
moilanik
2026-06-15 09:20:23 +03:00
parent 16b25970ff
commit 1d396c8278
3 changed files with 34 additions and 8 deletions
@@ -6,10 +6,15 @@ const PROJECT_ROOT = path.resolve(__dirname, '..', '..', '..');
const MOCK_SCRIPT = path.join(PROJECT_ROOT, 'tests', 'helpers', 'mock-api.sh');
Before({ tags: '@mock' }, function () {
execSync(`bash -c 'source "${MOCK_SCRIPT}" && mock_start'`, {
const out = execSync(`bash -c 'source "${MOCK_SCRIPT}" && mock_start && sleep 0.3 && curl -s -o /dev/null -w "%{http_code}" --max-time 3 http://localhost:18080/api/v1/repos/health/check'`, {
cwd: PROJECT_ROOT,
stdio: 'ignore',
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],
});
const trimmed = out.trim();
if (!trimmed.startsWith('2') && !trimmed.startsWith('4')) {
throw new Error(`Mock server failed to start (HTTP ${trimmed})`);
}
});
After({ tags: '@mock' }, function () {