bd6ed5c2c2
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
45 lines
1.1 KiB
Bash
45 lines
1.1 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
setup() {
|
|
export GITEA_API_URL="http://localhost:18080"
|
|
export GITEA_TOKEN="test-token-abc"
|
|
export GIT_PAGES_URL="http://localhost:18080"
|
|
export REPORTS_PUBLISH_TOKEN="publish-token-abc"
|
|
export GITHUB_REPOSITORY="test-owner/test-repo"
|
|
export GITHUB_SHA="abc123def456789012345678901234567890abcd"
|
|
}
|
|
|
|
@test "missing suite_path argument → exit 1" {
|
|
run bash scripts/publish.sh ""
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" == *"ERROR"* ]]
|
|
}
|
|
|
|
@test "missing GITEA_API_URL → exit 1" {
|
|
unset GITEA_API_URL
|
|
run bash scripts/publish.sh "unit-tests"
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" == *"GITEA_API_URL"* ]]
|
|
}
|
|
|
|
@test "missing GITEA_TOKEN → exit 1" {
|
|
unset GITEA_TOKEN
|
|
run bash scripts/publish.sh "unit-tests"
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" == *"GITEA_TOKEN"* ]]
|
|
}
|
|
|
|
@test "missing GIT_PAGES_URL → exit 1" {
|
|
unset GIT_PAGES_URL
|
|
run bash scripts/publish.sh "unit-tests"
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" == *"GIT_PAGES_URL"* ]]
|
|
}
|
|
|
|
@test "missing REPORTS_PUBLISH_TOKEN → exit 1" {
|
|
unset REPORTS_PUBLISH_TOKEN
|
|
run bash scripts/publish.sh "unit-tests"
|
|
[ "$status" -eq 1 ]
|
|
[[ "$output" == *"REPORTS_PUBLISH_TOKEN"* ]]
|
|
}
|