Skip to content

Commit 144090e

Browse files
committed
fix(test): fix Story 1-9 cross-story regression tests
Two tests in workflow_api_test.go were broken by later story changes: - TestGetWorkflowStatus_NotFound: asserted errResp["error"] which was removed when ADR-0009 refactor switched to RFC 7807 format (fields: type/detail/status) Fix: update assertions to RFC 7807 fields - TestSubmitWorkflow_Success: used 'uses: echo@v1' which was never a registered node; additionally 'on:'/'vars:' fields caused schema validation failures after Story 2-2 tightened validation rules Fix: use minimal valid YAML with 'uses: run@v1' + 'with.command:' Also: minor YAML formatting normalization in docker-compose files (spaces in arrays)
1 parent d047260 commit 144090e

6 files changed

Lines changed: 17 additions & 20 deletions

File tree

deployments/docker-compose-https.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
- waterflow
2323
volumes:
2424
- ./scripts:/scripts
25-
entrypoint: ["/bin/sh"]
25+
entrypoint: [ "/bin/sh" ]
2626
command: /scripts/setup-postgres.sh
2727

2828
# Temporal Server (required for Waterflow)
@@ -43,7 +43,7 @@ services:
4343
volumes:
4444
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
4545
healthcheck:
46-
test: ["CMD", "nc", "-z", "localhost", "7233"]
46+
test: [ "CMD", "nc", "-z", "localhost", "7233" ]
4747
interval: 5s
4848
timeout: 3s
4949
start_period: 30s
@@ -67,7 +67,7 @@ services:
6767
- waterflow
6868
volumes:
6969
- ./scripts:/scripts
70-
entrypoint: ["/bin/sh"]
70+
entrypoint: [ "/bin/sh" ]
7171
command: /scripts/create-namespace.sh
7272

7373
# Temporal UI
@@ -94,7 +94,7 @@ services:
9494
volumes:
9595
- postgresql-data:/var/lib/postgresql/data
9696
healthcheck:
97-
test: ["CMD-SHELL", "pg_isready -U temporal"]
97+
test: [ "CMD-SHELL", "pg_isready -U temporal" ]
9898
interval: 5s
9999
timeout: 5s
100100
retries: 10

deployments/docker-compose.test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
- waterflow-test-network
4545
volumes:
4646
- ./scripts:/scripts
47-
entrypoint: ["/bin/sh"]
47+
entrypoint: [ "/bin/sh" ]
4848
command: /scripts/setup-postgres.sh
4949

5050
# Temporal Server
@@ -93,7 +93,7 @@ services:
9393
- waterflow-test-network
9494
volumes:
9595
- ./scripts:/scripts
96-
entrypoint: ["/bin/sh"]
96+
entrypoint: [ "/bin/sh" ]
9797
command: /scripts/create-namespace.sh
9898

9999
# Waterflow Server

examples/configs/secure-docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ services:
255255
- backend
256256
volumes:
257257
- ../../deployments/scripts:/scripts
258-
entrypoint: ["/bin/sh"]
258+
entrypoint: [ "/bin/sh" ]
259259
command: /scripts/setup-postgres.sh
260260

261261
# ========================================
@@ -326,7 +326,7 @@ services:
326326
- backend
327327
volumes:
328328
- ../../deployments/scripts:/scripts
329-
entrypoint: ["/bin/sh"]
329+
entrypoint: [ "/bin/sh" ]
330330
command: /scripts/create-namespace.sh
331331

332332
# ========================================

internal/api/workflow_api_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,14 @@ func TestSubmitWorkflow_Success(t *testing.T) {
5252
// Prepare request
5353
reqBody := SubmitWorkflowRequest{
5454
YAML: `name: test-workflow
55-
on:
56-
workflow_dispatch:
57-
vars:
58-
env: dev
5955
jobs:
6056
test:
6157
runs-on: test-queue
6258
steps:
6359
- name: Test Step
64-
uses: echo@v1
60+
uses: run@v1
6561
with:
66-
message: "Hello"`,
62+
command: echo "Hello"`,
6763
Vars: map[string]interface{}{
6864
"override": "value",
6965
},
@@ -185,12 +181,13 @@ func TestGetWorkflowStatus_NotFound(t *testing.T) {
185181

186182
assert.Equal(t, http.StatusNotFound, w.Code)
187183

184+
// Response is in RFC 7807 format (changed by ADR-0009 refactor)
188185
var errResp map[string]interface{}
189186
err := json.Unmarshal(w.Body.Bytes(), &errResp)
190187
assert.NoError(t, err)
191-
assert.Contains(t, errResp, "error")
192-
errorObj := errResp["error"].(map[string]interface{})
193-
assert.Equal(t, "not_found", errorObj["code"])
188+
assert.Contains(t, errResp, "type")
189+
assert.Contains(t, errResp, "detail")
190+
assert.Equal(t, float64(http.StatusNotFound), errResp["status"])
194191
}
195192

196193
// TestListWorkflows_Success tests successful list query

test/acceptance/docker-compose.acceptance.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
- acceptance-network
3939
volumes:
4040
- ../../deployments/scripts:/scripts
41-
entrypoint: ["/bin/sh"]
41+
entrypoint: [ "/bin/sh" ]
4242
command: /scripts/setup-postgres.sh
4343

4444
# Temporal Server

test/e2e/docker-compose.e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
- waterflow-e2e-network
4545
volumes:
4646
- ../../deployments/scripts:/scripts
47-
entrypoint: ["/bin/sh"]
47+
entrypoint: [ "/bin/sh" ]
4848
command: /scripts/setup-postgres.sh
4949

5050
# Temporal Server
@@ -93,7 +93,7 @@ services:
9393
- waterflow-e2e-network
9494
volumes:
9595
- ../../deployments/scripts:/scripts
96-
entrypoint: ["/bin/sh"]
96+
entrypoint: [ "/bin/sh" ]
9797
command: /scripts/create-namespace.sh
9898

9999
# Waterflow Server

0 commit comments

Comments
 (0)