env conf ylimääräinen value pois
This commit is contained in:
@@ -27,7 +27,7 @@ function bashQuiet(cmd) {
|
||||
}
|
||||
|
||||
function runReportStatus(args) {
|
||||
return bash(`export GITEA_API_URL="http://localhost:18080" GITEA_TOKEN="test-token-abc123" PAGES_HOST="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() {
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
setup() {
|
||||
source tests/helpers/mock-api.sh
|
||||
export GITEA_API_URL="http://localhost:18080"
|
||||
export PAGES_HOST="reports.example.com"
|
||||
export GIT_PAGES_PUBLISH_URL="http://localhost:18080/"
|
||||
export GIT_PAGES_URL="http://localhost:18080"
|
||||
export GIT_PAGES_PUBLISH_TOKEN="publish-token-abc"
|
||||
export GITHUB_REPOSITORY="test-owner/test-repo"
|
||||
export GITHUB_SHA="abc123def456789012345678901234567890abcd"
|
||||
@@ -32,18 +31,11 @@ teardown() {
|
||||
[[ "$output" == *"GITEA_API_URL"* ]]
|
||||
}
|
||||
|
||||
@test "missing PAGES_HOST → exit 1" {
|
||||
unset PAGES_HOST
|
||||
@test "missing GIT_PAGES_URL → exit 1" {
|
||||
unset GIT_PAGES_URL
|
||||
run bash scripts/publish-git-pages.sh "unit-tests"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"PAGES_HOST"* ]]
|
||||
}
|
||||
|
||||
@test "missing GIT_PAGES_PUBLISH_URL → exit 1" {
|
||||
unset GIT_PAGES_PUBLISH_URL
|
||||
run bash scripts/publish-git-pages.sh "unit-tests"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"GIT_PAGES_PUBLISH_URL"* ]]
|
||||
[[ "$output" == *"GIT_PAGES_URL"* ]]
|
||||
}
|
||||
|
||||
@test "missing GIT_PAGES_PUBLISH_TOKEN → exit 1" {
|
||||
@@ -73,7 +65,7 @@ teardown() {
|
||||
mock_start
|
||||
run bash scripts/publish-git-pages.sh "unit-tests"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == "https://reports.example.com/test-owner/test-repo/reports/abc123de" ]]
|
||||
[[ "$output" == "http://localhost:18080/test-owner/test-repo/reports/abc123de" ]]
|
||||
}
|
||||
|
||||
@test "publish with suite subpath" {
|
||||
@@ -85,7 +77,7 @@ teardown() {
|
||||
mock_start
|
||||
run bash scripts/publish-git-pages.sh "sub/suite"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == "https://reports.example.com/test-owner/test-repo/reports/abc123de" ]]
|
||||
[[ "$output" == "http://localhost:18080/test-owner/test-repo/reports/abc123de" ]]
|
||||
}
|
||||
|
||||
@test "git-pages returns HTTP 500 → exit 1" {
|
||||
|
||||
+4
-12
@@ -3,8 +3,7 @@
|
||||
setup() {
|
||||
export GITEA_API_URL="http://localhost:18080"
|
||||
export GITEA_TOKEN="test-token-abc"
|
||||
export PAGES_HOST="reports.example.com"
|
||||
export GIT_PAGES_PUBLISH_URL="http://localhost:18080/"
|
||||
export GIT_PAGES_URL="http://localhost:18080"
|
||||
export GIT_PAGES_PUBLISH_TOKEN="publish-token-abc"
|
||||
export GITHUB_REPOSITORY="test-owner/test-repo"
|
||||
export GITHUB_SHA="abc123def456789012345678901234567890abcd"
|
||||
@@ -30,18 +29,11 @@ setup() {
|
||||
[[ "$output" == *"GITEA_TOKEN"* ]]
|
||||
}
|
||||
|
||||
@test "missing PAGES_HOST → exit 1" {
|
||||
unset PAGES_HOST
|
||||
@test "missing GIT_PAGES_URL → exit 1" {
|
||||
unset GIT_PAGES_URL
|
||||
run bash scripts/publish.sh "unit-tests"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"PAGES_HOST"* ]]
|
||||
}
|
||||
|
||||
@test "missing GIT_PAGES_PUBLISH_URL → exit 1" {
|
||||
unset GIT_PAGES_PUBLISH_URL
|
||||
run bash scripts/publish.sh "unit-tests"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"GIT_PAGES_PUBLISH_URL"* ]]
|
||||
[[ "$output" == *"GIT_PAGES_URL"* ]]
|
||||
}
|
||||
|
||||
@test "missing GIT_PAGES_PUBLISH_TOKEN → exit 1" {
|
||||
|
||||
@@ -4,7 +4,7 @@ setup() {
|
||||
source tests/helpers/mock-api.sh
|
||||
export GITEA_API_URL="http://localhost:18080"
|
||||
export GITEA_TOKEN="test-token-abc123"
|
||||
export PAGES_HOST="reports.example.com"
|
||||
export GIT_PAGES_URL="https://reports.example.com"
|
||||
export GITHUB_REPOSITORY="test-owner/test-repo"
|
||||
export GITHUB_SHA="abc123def456789012345678901234567890abcd"
|
||||
export GITHUB_RUN_ID="42"
|
||||
|
||||
Reference in New Issue
Block a user