bats korjaus. publish ja link rajapinta muuttunut
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 17s
CI Feature / Bats tests (push) Failing after 1m39s
CI Feature / Cucumber tests (push) Failing after 2m22s
CI Feature / Report Summary (push) Successful in 4s

This commit is contained in:
moilanik
2026-06-28 06:14:05 +03:00
parent 038e5405b6
commit c635044a03
3 changed files with 21 additions and 12 deletions
+11 -11
View File
@@ -7,15 +7,15 @@ setup() {
export GIT_PAGES_PUBLISH_TOKEN="publish-token-abc"
export GITHUB_REPOSITORY="test-owner/test-repo"
export GITHUB_SHA="abc123def456789012345678901234567890abcd"
export GITHUB_REF_NAME="main"
REPORT_DIR="reports/abc123de/unit-tests"
mkdir -p "$REPORT_DIR"
echo "<html>test</html>" > "$REPORT_DIR/index.html"
mkdir -p "unit-tests"
echo "<html>test</html>" > "unit-tests/index.html"
}
teardown() {
mock_stop
rm -rf "reports/abc123de"
rm -rf "unit-tests" "sub"
}
@test "missing suite_path argument → exit 1" {
@@ -24,11 +24,11 @@ teardown() {
[[ "$output" == *"ERROR"* ]]
}
@test "missing GITEA_API_URL → exit 1" {
unset GITEA_API_URL
@test "missing GITHUB_REF_NAME → exit 1" {
unset GITHUB_REF_NAME
run bash scripts/publish-git-pages.sh "unit-tests"
[ "$status" -eq 1 ]
[[ "$output" == *"GITEA_API_URL"* ]]
[[ "$output" == *"GITHUB_REF_NAME"* ]]
}
@test "missing GIT_PAGES_URL → exit 1" {
@@ -65,19 +65,19 @@ teardown() {
mock_start
run bash scripts/publish-git-pages.sh "unit-tests"
[ "$status" -eq 0 ]
[[ "$output" == "http://localhost:18080/test-owner/test-repo/reports/abc123de" ]]
[[ "$output" == "http://localhost:18080/test-owner/test-repo/main/abc123de/unit-tests/" ]]
}
@test "publish with suite subpath" {
mkdir -p "reports/abc123de/sub/suite"
echo "sub" > "reports/abc123de/sub/suite/result.html"
mkdir -p "sub/suite"
echo "sub" > "sub/suite/result.html"
mock_set_sequence '[
{"code":200,"body":"published"}
]'
mock_start
run bash scripts/publish-git-pages.sh "sub/suite"
[ "$status" -eq 0 ]
[[ "$output" == "http://localhost:18080/test-owner/test-repo/reports/abc123de" ]]
[[ "$output" == "http://localhost:18080/test-owner/test-repo/main/abc123de/sub/suite/" ]]
}
@test "git-pages returns HTTP 500 → exit 1" {