testien nopeutus
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 27s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 51s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m32s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-20 13:44:36 +03:00
parent a039e6637e
commit cd6ff8830c
4 changed files with 31 additions and 38 deletions
@@ -6,15 +6,16 @@ const PROJECT_ROOT = path.resolve(__dirname, '..', '..', '..');
const MOCK_SCRIPT = path.join(PROJECT_ROOT, 'tests', 'helpers', 'mock-api.sh');
Before({ tags: '@mock' }, function () {
const out = execSync(`bash -c 'source "${MOCK_SCRIPT}" && mock_start && sleep 1 && curl -s -o /dev/null -w "%{http_code}" --max-time 3 http://localhost:18080/api/v1/repos/health/check'`, {
const out = execSync(`bash -o pipefail -c 'source "${MOCK_SCRIPT}" && mock_start >&2 && echo "$GITEA_API_URL"'`, {
cwd: PROJECT_ROOT,
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})`);
const apiUrl = out.trim();
if (!apiUrl.startsWith('http')) {
throw new Error(`Mock server failed to start (no API URL: ${apiUrl})`);
}
process.env.GITEA_API_URL = apiUrl;
});
After({ tags: '@mock' }, function () {