isoja testimuutoksia
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 22s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m13s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m26s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-20 14:26:08 +03:00
parent ae03589563
commit 6a113659c8
10 changed files with 50 additions and 69 deletions
@@ -27,8 +27,7 @@ function bashQuiet(cmd) {
}
function runReportStatus(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}`);
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}`);
}
function getMockBody() {
@@ -111,12 +110,7 @@ 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' });
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();
bashQuiet(`source "${MOCK_SCRIPT}" && mock_set_response 500 && mock_start`);
const r = runReportStatus('success "Should fail"');
this.reportStatusFailed = (r.status !== 0);
});