Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 2 deletions execution/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.PHONY: test
test:
go test -race ./...
# The idiomatic way to disable test caching explicitly is to use -count=1
go test -race -count=1 ./...

.PHONY: test-quick
test-quick:
go test -count=1 ./...

.PHONY: test
test-no-race:
go test ./...
go test -count=1 ./...

Comment thread
devsergiy marked this conversation as resolved.
Outdated
# updateTestFixtures will update all! golden fixtures
.PHONY: updateTestFixtures
Expand Down
6 changes: 3 additions & 3 deletions execution/engine/federation_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func TestFederationIntegrationTest(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
resp := gqlClient.Query(ctx, setup.GatewayServer.URL, testQueryPath("queries/complex_nesting.graphql"), nil, t)
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"upc":"top-2","name":"Fedora"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","upc":"top-1","body":"How do I turn it on?"}]},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}]}]}}}`
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"upc":"top-2","name":"Fedora"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","body":"How do I turn it on?","upc":"top-1"}]},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}]}]}}}`
assert.Equal(t, compact(expected), string(resp))
Comment thread
devsergiy marked this conversation as resolved.
})

Expand All @@ -418,7 +418,7 @@ func TestFederationIntegrationTest(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
resp := gqlClient.Query(ctx, setup.GatewayServer.URL, testQueryPath("queries/more_complex_nesting.graphql"), nil, t)
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"name":"Fedora","upc":"top-2"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","upc":"top-1","body":"How do I turn it on?"}],"comment":{"__typename":"Question","subject":"Life"}},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}],"comment":{"__typename":"Question","subject":"Life"}}]}}}`
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"upc":"top-2","name":"Fedora"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","body":"How do I turn it on?","upc":"top-1"}],"comment":{"__typename":"Question","subject":"Life"}},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}],"comment":{"__typename":"Question","subject":"Life"}}]}}}`
assert.Equal(t, compact(expected), string(resp))
})

Expand Down Expand Up @@ -454,7 +454,7 @@ func TestFederationIntegrationTest(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)
resp := gqlClient.Query(ctx, setup.GatewayServer.URL, testQueryPath("queries/more_complex_nesting_typename_variant.graphql"), nil, t)
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"name":"Fedora","upc":"top-2"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","upc":"top-1","body":"How do I turn it on?"}]},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}]}]}}}`
expected := `{"data":{"me":{"id":"1234","username":"Me","history":[{"wallet":{"currency":"USD"}},{"location":"Germany","product":{"upc":"top-2","name":"Fedora"}},{"wallet":{"currency":"USD"}}],"reviews":[{"__typename":"Review","attachments":[{"__typename":"Question","body":"How do I turn it on?","upc":"top-1"}]},{"__typename":"Review","attachments":[{"__typename":"Rating","upc":"top-2","body":"The best hat I have ever bought in my life."},{"__typename":"Video","upc":"top-2","size":13.37}]}]}}}`
assert.Equal(t, compact(expected), string(resp))
})

Expand Down
12 changes: 6 additions & 6 deletions execution/engine/testdata/complex_nesting_query_with_art.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"attachments": [
{
"__typename": "Question",
"upc": "top-1",
"body": "How do I turn it on?"
"body": "How do I turn it on?",
"upc": "top-1"
}
]
Comment thread
devsergiy marked this conversation as resolved.
},
Expand Down Expand Up @@ -96,7 +96,7 @@
"raw_input_data": {},
"input": {
"body": {
"query": "{me {id username history {__typename ... on Sale {location product {upc __typename}} ... on Purchase {wallet {currency}}} __typename}}"
"query": "{me {id username history {__typename ... on Purchase {wallet {currency}} ... on Sale {location product {upc __typename}}} __typename}}"
},
"header": {},
"method": "POST",
Expand Down Expand Up @@ -409,7 +409,7 @@
},
"input": {
"body": {
"query": "query($representations: [_Any!]!){_entities(representations: $representations){... on User {__typename reviews {__typename attachments {__typename ... on Question {upc body} ... on Rating {upc body} ... on Video {upc size}}}}}}",
"query": "query($representations: [_Any!]!){_entities(representations: $representations){... on User {__typename reviews {__typename attachments {__typename ... on Question {body upc} ... on Video {upc size} ... on Rating {upc body}}}}}}",
"variables": {
"representations": [
{
Expand All @@ -434,8 +434,8 @@
"attachments": [
{
"__typename": "Question",
"upc": "top-1",
"body": "How do I turn it on?"
"body": "How do I turn it on?",
"upc": "top-1"
}
]
},
Expand Down
Loading