Skip to content

Commit 8540756

Browse files
committed
Update tests to work with option.Option
1 parent 4734706 commit 8540756

File tree

28 files changed

+288
-206
lines changed

28 files changed

+288
-206
lines changed

e2e-tests/testdata/echo/endtoend/endtoend.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"encore.dev/rlog"
2020
"encore.dev/types/option"
2121
"encore.dev/types/uuid"
22+
"github.com/google/go-cmp/cmp"
2223
)
2324

2425
var assertNumber = 0
@@ -136,7 +137,10 @@ func GeneratedWrappersEndToEndTest(ctx context.Context) (err error) {
136137
assert(err, nil, "unable to marshal response to JSON")
137138
reqAsJSON, err := json.Marshal(params)
138139
assert(err, nil, "unable to marshal response to JSON")
139-
assert(respAsJSON, reqAsJSON, "Expected the same response from the marshaller test")
140+
if diff := cmp.Diff(string(respAsJSON), string(reqAsJSON)); diff != "" {
141+
assertNumber++
142+
panic(fmt.Sprintf("Assertion Failure %d: %s", assertNumber, diff))
143+
}
140144

141145
// Test the raw endpoint (Unsupported currently in service to service calls)
142146
// {

e2e-tests/testdata/echo/go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module encore.app
22

3-
go 1.21.0
3+
go 1.24.0
44

5-
require encore.dev v1.9.3
5+
require (
6+
encore.dev v1.52.0
7+
github.com/google/go-cmp v0.7.0
8+
)

e2e-tests/testdata/echo/go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
encore.dev v1.9.3 h1:EyAw58b7lBRQipL/p27gRXKwyopwyGsUuIpqZpTIOzw=
2-
encore.dev v1.9.3/go.mod h1:AyQpBJoalNCFScvYfjzLtOJh/KEYue/pNljoz/aA6UQ=
1+
encore.dev v1.52.0 h1:e8LbHiccXLI3M4Oc3HbvWoVy8AyNyBJm7wY7NsPwCd4=
2+
encore.dev v1.52.0/go.mod h1:lK8vSJG6uhYeUwT87/FEpcLdiN98QUcotd3gxRX0xDw=
3+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
4+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
module echo_client
22

3-
go 1.18
3+
go 1.21
4+
5+
require github.com/google/go-cmp v0.7.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
2+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=

e2e-tests/testdata/echo_client/golang/client/goclient.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e-tests/testdata/echo_client/js/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ class TestServiceClient {
456456
rtn.HeaderJson = JSON.parse(mustBeSet("Header `x-json`", resp.headers.get("x-json")))
457457
rtn.HeaderUUID = mustBeSet("Header `x-uuid`", resp.headers.get("x-uuid"))
458458
rtn.HeaderUserID = mustBeSet("Header `x-user-id`", resp.headers.get("x-user-id"))
459-
rtn.HeaderOption = mustBeSet("Header `x-option`", resp.headers.get("x-option"))
459+
rtn.HeaderOption = resp.headers.get("x-option")
460460
return rtn
461461
}
462462

0 commit comments

Comments
 (0)