Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ linters:
- gosec
text: G204

- path: ^util/compare_http\.go$
linters:
- gocritic
text: "ifElseChain:"

- path: ^docker/harness/(harness|service)\.go$
linters:
- goconst
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
url: http://127.0.0.1:8083/healthz
expect:
http:
status: 200
status_code: 200
calls:
- service_id: minimal-mocked-called-at-least-once
http:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ summary:
http:
method: GET
url: http://127.0.0.1:8083/healthz
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 200
expected_calls:
calls:
- service_id: minimal-mocked-called-at-least-once
count: 1
http:
method: GET
path: /healthz
response_status_code: 200
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
kind: Environment
version: 1.0.0
name: misspelled-called-at-least-once
name: misspelled-fails-validation
description: one mocked HTTP service that returns 200 OK for /healthz
spec:
services:
- id: misspelled-called-at-least-once
- id: spelled-correctly
kind: http
mode: mocked
address: 127.0.0.1:8083
Expand All @@ -15,4 +15,4 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
kind: Test
version: 1.0.0
name: misspelled-called-at-least-once
description: misspelled service is called at least once (calls count is not specified)
name: misspelled-fails-validation
description: validation fails because the service_id in the expect.calls is misspelled
spec:
request:
http:
method: GET
url: http://127.0.0.1:8083/healthz
expect:
http:
status: 200
status_code: 200
calls:
- service_id: misspelled
http:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@ started_at: 2026-08-19T15:16:47.974744Z
finished_at: 2026-08-19T15:16:47.993394Z
status: error
environment_id: 7398ab887149ec5aa583c564a659a0b0a933ef27bacb675b081a2a752d8a3896
environment_name: misspelled-called-at-least-once
environment_name: misspelled-fails-validation
test_id: ae619f9418f89041a5f6e0e952eae9fb9495e2c271b66739ffd6fae46f9ff30a
test_name: misspelled-called-at-least-once
test_name: misspelled-fails-validation
summary:
error: "invalid test execution input, environment.service.id: misspelled, validation: expected call references unknown environment service"
request:
http:
method: GET
url: http://127.0.0.1:8083/healthz
expected_calls:
- service_id: misspelled
http:
method: GET
path: /healthz
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200

- id: not-called
kind: http
Expand All @@ -28,4 +28,4 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:

expect:
http:
status: 200
status_code: 200

calls:
- service_id: not-called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ summary:
http:
method: GET
url: http://127.0.0.1:8082/healthz
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 200
expected_calls:
- service_id: not-called
calls:
- service_id: called
count: 1
http:
method: GET
path: /healthz
response_status_code: 200
deviations:
- field: calls.not-called.count
expected: "at least 1"
Expand Down
13 changes: 9 additions & 4 deletions cli/data/crud-test/gateway-calls-entitlements.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ spec:
request:
http:
method: GET
url: http://127.0.0.1:8082/check
url: http://127.0.0.1:9000/check
expect:
http:
status: 200
body: '{"status":"ok"}'
status_code: 200
body_json: '{"status":"ok"}'
calls:
- service_id: entitlements
count: 1
http:
method: GET
path: /healthz
path: /healthz
headers:
"Accept-Encoding":
- gzip
"E2Engine-Test-Execution-Id":
- operator: nonempty
10 changes: 7 additions & 3 deletions cli/data/crud-test/http-real-mocked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ summary:
request:
http:
method: GET
url: http://127.0.0.1:8082/check
url: http://127.0.0.1:9000/check
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 200
body_json: '{"status":"ok"}'
expected_calls:
calls:
- service_id: entitlements
count: 1
http:
method: GET
path: /healthz
path: /healthz
response_status_code: 200
4 changes: 2 additions & 2 deletions cli/data/crud-test/real-with-mocked-dependency.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200
headers:
Content-Type:
- application/json
body: '{"status":"ok"}'
body_json: '{"status":"ok"}'
24 changes: 11 additions & 13 deletions cli/data/crud-testsuite/e2e.tse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ tests:
request:
http:
method: GET
url: http://127.0.0.1:8082/check
url: http://127.0.0.1:9000/check
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 200
body_json: '{"status":"ok"}'
expected_calls:
calls:
- service_id: entitlements
count: 1
http:
method: GET
path: /healthz
- service_id: gateway
http:
method: GET
path: /check
response_status_code: 200
- id: f5497dfbbf8392b4828f5323c07e4b5cc8026790caca7b3065350413bebbd4e3
started_at: 2026-08-19T15:16:47.974744Z
finished_at: 2026-08-19T15:16:47.993394Z
Expand All @@ -50,20 +50,18 @@ tests:
request:
http:
method: GET
url: http://127.0.0.1:8082/error
url: http://127.0.0.1:9000/error
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 500
body_json: '{"error":"simulated error response"}'
expected_calls:
- service_id: gateway
http:
method: GET
path: /error
deviations:
- field: status_code
expected: "200"
actual: "500"
- field: body
- field: body_json
expected: '{"status":"ok"}'
actual: '{"error":"simulated error response"}'
10 changes: 3 additions & 7 deletions cli/data/crud-testsuite/gateway-calls-entitlements.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ spec:
request:
http:
method: GET
url: http://127.0.0.1:8082/check
url: http://127.0.0.1:9000/check
expect:
http:
status: 200
body: '{"status":"ok"}'
status_code: 200
body_json: '{"status":"ok"}'
calls:
- service_id: entitlements
count: 1
http:
method: GET
path: /healthz
- service_id: gateway
http:
method: GET
path: /check
12 changes: 5 additions & 7 deletions cli/data/crud-testsuite/gateway-error.te.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ summary:
request:
http:
method: GET
url: http://127.0.0.1:8082/error
url: http://127.0.0.1:9000/error
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 500
body_json: '{"error":"simulated error response"}'
expected_calls:
- service_id: gateway
http:
method: GET
path: /error
deviations:
- field: status_code
expected: "200"
actual: "500"
- field: body
- field: body_json
expected: '{"status":"ok"}'
actual: '{"error":"simulated error response"}'
11 changes: 3 additions & 8 deletions cli/data/crud-testsuite/gateway-error.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ spec:
request:
http:
method: GET
url: http://127.0.0.1:8082/error
url: http://127.0.0.1:9000/error
expect:
http:
status: 200
body: '{"status":"ok"}'
calls:
- service_id: gateway
http:
method: GET
path: /error
status_code: 200
body_json: '{"status":"ok"}'
12 changes: 6 additions & 6 deletions cli/data/crud-testsuite/http-real-mocked.te.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ summary:
request:
http:
method: GET
url: http://127.0.0.1:8082/check
url: http://127.0.0.1:9000/check
headers:
"E2engine-Test-Execution-Id":
- "c1079d334b1a17b4a5fa7588a90d045ed01ea241c53ab51afa0d8b8620837e7b"
response:
http:
status_code: 200
body_json: '{"status":"ok"}'
expected_calls:
calls:
- service_id: entitlements
count: 1
http:
method: GET
path: /healthz
- service_id: gateway
http:
method: GET
path: /check
response_status_code: 200
4 changes: 2 additions & 2 deletions cli/data/crud-testsuite/real-with-mocked-dependency.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ spec:
path: /healthz
then:
http:
status: 200
status_code: 200
headers:
Content-Type:
- application/json
body: '{"status":"ok"}'
body_json: '{"status":"ok"}'
4 changes: 3 additions & 1 deletion cli/data/direct/direct-mocked-grpc.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@
{
"when": {
"grpc": {
"service": "entitlements.v1.EntitlementsService",
"method": "CheckEntitlement",
"message": {
"customer_id": "customer-1"
"operator": "equals",
"value": "{\"customer_id\": \"customer-1\"}"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions cli/data/direct/direct-mocked-grpc.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ spec:
fixtures:
- when:
grpc:
service: entitlements.v1.EntitlementsService
method: CheckEntitlement
message:
customer_id: customer-1
message: '{"customer_id": "customer-1"}'
then:
grpc:
status: OK
Expand Down
Loading
Loading