Feature/git pages -> oma nginx perusteinen raporointipalvelu (#48)
CI Gitea Reports Main / Config load (push) Successful in 17s
CI Main / Config load (push) Successful in 20s
CI Gitea Reports Main / Latest version (push) Successful in 17s
CI Main / Latest versio (push) Successful in 19s
ci-helm-build-push Helm push 0.2.0
CI Gitea Reports Main / Build & Push Helm chart (push) Successful in 33s
gitops/gitea-ci-library/gitea-reports GitOps: gitea-reports 0.2.0
CI Gitea Reports Main / GitOps (push) Successful in 33s
CI Gitea Reports Main / Report Summary (push) Successful in 3s
CI Main / Bats tests (push) Failing after 1m16s
CI Main / Cucumber tests (push) Failing after 1m22s
CI Main / Build & Push Docker (push) Has been skipped
CI Main / GitOps (push) Has been skipped
CI Main / Move provider version tag (push) Has been skipped
CI Main / Report Summary (push) Successful in 3s

Co-authored-by: moilanik <niko.moilanen@tietoevry.com>
Reviewed-on: #48
This commit was merged in pull request #48.
This commit is contained in:
2026-06-28 09:10:10 +03:00
parent dd9cdf70b6
commit bd6ed5c2c2
65 changed files with 1602 additions and 2208 deletions
+15 -15
View File
@@ -4,18 +4,18 @@ setup() {
source tests/helpers/mock-api.sh
export GITEA_API_URL="http://localhost:18080"
export GIT_PAGES_URL="http://localhost:18080"
export GIT_PAGES_PUBLISH_TOKEN="publish-token-abc"
export REPORTS_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" {
@@ -38,11 +38,11 @@ teardown() {
[[ "$output" == *"GIT_PAGES_URL"* ]]
}
@test "missing GIT_PAGES_PUBLISH_TOKEN → exit 1" {
unset GIT_PAGES_PUBLISH_TOKEN
@test "missing REPORTS_PUBLISH_TOKEN → exit 1" {
unset REPORTS_PUBLISH_TOKEN
run bash scripts/publish-git-pages.sh "unit-tests"
[ "$status" -eq 1 ]
[[ "$output" == *"GIT_PAGES_PUBLISH_TOKEN"* ]]
[[ "$output" == *"REPORTS_PUBLISH_TOKEN"* ]]
}
@test "missing GITHUB_REPOSITORY → 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" {