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
@@ -27,7 +27,8 @@ function bashQuiet(cmd) {
}
function runReportStatus(args) {
return bash(`export GITEA_API_URL="http://localhost:18080" GITEA_TOKEN="test-token-abc123" GIT_PAGES_URL="https://reports.example.com" GITHUB_REPOSITORY="test-owner/test-repo" GITHUB_SHA="abc123def456789012345678901234567890abcd" GITHUB_RUN_ID="42"; bash "${REPORT_SCRIPT}" ${args}`);
const apiUrl = process.env.GITEA_API_URL || 'http://localhost:18080';
return bash(`export GITEA_API_URL="${apiUrl}" GITEA_TOKEN="test-token-abc123" GIT_PAGES_URL="https://reports.example.com" GITHUB_REPOSITORY="test-owner/test-repo" GITHUB_SHA="abc123def456789012345678901234567890abcd" GITHUB_RUN_ID="42"; bash "${REPORT_SCRIPT}" ${args}`);
}
function getMockBody() {
@@ -110,7 +111,12 @@ Then('the source commit shows the deployment status alongside the build status',
When('a build step tries to report status but the build system is unavailable', function () {
bashQuiet(`source "${MOCK_SCRIPT}" && mock_stop`);
execSync('sleep 0.3', { stdio: 'ignore' });
bashQuiet(`source "${MOCK_SCRIPT}" && mock_set_response 500 && mock_start`);
const out = execSync(`bash -o pipefail -c 'source "${MOCK_SCRIPT}" && mock_set_response 500 && mock_start >&2 && echo "$GITEA_API_URL"'`, {
cwd: PROJECT_ROOT,
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],
});
process.env.GITEA_API_URL = out.trim();
const r = runReportStatus('success "Should fail"');
this.reportStatusFailed = (r.status !== 0);
});