poc
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m35s
CI Feature / Report Summary (push) Successful in 5s
POC GitOps E2E / e2e (push) Failing after 35s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m35s
CI Feature / Report Summary (push) Successful in 5s
POC GitOps E2E / e2e (push) Failing after 35s
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
setup() {
|
||||
source tests/helpers/mock-api.sh
|
||||
export DISPATCH_POLL_INTERVAL="0.1"
|
||||
export DISPATCH_ID="test123"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
@@ -12,8 +13,7 @@ teardown() {
|
||||
@test "dispatch succeeds: POST 201, poll running x3 then success → exit 0" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"display_title":"POC (test123)","run_number":42,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"completed","conclusion":"success"}}
|
||||
@@ -26,7 +26,7 @@ teardown() {
|
||||
@test "dispatch: poll returns failure conclusion → exit 1" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"status":"running"}]}},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"display_title":"POC (test123)","run_number":42,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"completed","conclusion":"failure"}}
|
||||
]'
|
||||
@@ -38,7 +38,7 @@ teardown() {
|
||||
@test "dispatch: poll returns cancelled conclusion → exit 1" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"status":"running"}]}},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"display_title":"POC (test123)","run_number":42,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"completed","conclusion":"cancelled"}}
|
||||
]'
|
||||
@@ -47,18 +47,18 @@ teardown() {
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "timeout: poll never completes, exceeds timeout_minutes → exit 124" {
|
||||
@test "timeout: no matching run found, exceeds timeout_minutes → exit 124" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}},
|
||||
{"code":200,"body":{"id":1,"status":"running"}}
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}},
|
||||
{"code":200,"body":{"workflow_runs":[]}}
|
||||
]'
|
||||
mock_start
|
||||
run bash scripts/dispatch-workflow.sh "test-owner/test-repo" "test.yml" "main" '{"version":"1.2.3"}' "http://localhost:18080" "test-token-abc123" "0.001"
|
||||
@@ -77,7 +77,7 @@ teardown() {
|
||||
@test "POST dispatch is called with correct URL and payload" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"status":"running"}]}},
|
||||
{"code":200,"body":{"workflow_runs":[{"id":1,"display_title":"POC (test123)","run_number":42,"status":"running"}]}},
|
||||
{"code":200,"body":{"id":1,"status":"completed","conclusion":"success"}}
|
||||
]'
|
||||
mock_start
|
||||
@@ -91,6 +91,7 @@ teardown() {
|
||||
[[ "$body" == *'"ref":"main"'* ]]
|
||||
[[ "$body" == *'"inputs"'* ]]
|
||||
[[ "$body" == *'"version":"1.2.3"'* ]]
|
||||
[[ "$body" == *'"dispatch_id":"test123"'* ]]
|
||||
}
|
||||
|
||||
@test "missing gitea_api_url argument → exit 1 with error message" {
|
||||
@@ -120,15 +121,15 @@ teardown() {
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "dispatch: no workflow run found after dispatch → exit 1" {
|
||||
@test "dispatch: no workflow run found after dispatch → exit 124 (timeout)" {
|
||||
mock_set_sequence '[
|
||||
{"code":201},
|
||||
{"code":200,"body":{"workflow_runs":[]}}
|
||||
]'
|
||||
mock_start
|
||||
run bash scripts/dispatch-workflow.sh "test-owner/test-repo" "test.yml" "main" '{}' "http://localhost:18080" "test-token-abc123"
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"ERROR"* ]]
|
||||
run bash scripts/dispatch-workflow.sh "test-owner/test-repo" "test.yml" "main" '{}' "http://localhost:18080" "test-token-abc123" "0.001"
|
||||
[ "$status" -eq 124 ]
|
||||
[[ "$output" == *"ERROR"* || "$output" == *"Timeout"* ]]
|
||||
}
|
||||
|
||||
@test "missing inputs_json argument → exit 1" {
|
||||
|
||||
Reference in New Issue
Block a user