-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactor recursive test cases (#2354)
- Loading branch information
Showing
22 changed files
with
580 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"user": { | ||
"name": "User1", | ||
"id": 1, | ||
"connections": [ | ||
{ | ||
"type": "friend", | ||
"user": { | ||
"name": "User2", | ||
"id": 2, | ||
"connections": [ | ||
{ | ||
"user": { | ||
"name": "User3", | ||
"id": 3 | ||
} | ||
}, | ||
{ | ||
"user": { | ||
"name": "User4", | ||
"id": 4 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: response | ||
--- | ||
{ | ||
"status": 200, | ||
"headers": { | ||
"content-type": "application/json" | ||
}, | ||
"body": { | ||
"data": { | ||
"createUser": { | ||
"name": "NewUser", | ||
"id": 111, | ||
"connections": [ | ||
{ | ||
"type": "friend", | ||
"user": { | ||
"name": "User1", | ||
"id": 1 | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
source: tests/core/spec.rs | ||
expression: formatter | ||
--- | ||
schema @server @upstream(baseURL: "https://jsonplaceholder.typicode.com", httpCache: 42) { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
|
||
input ConnectionInput { | ||
type: String | ||
user: UserInput | ||
} | ||
|
||
input UserInput { | ||
connections: [ConnectionInput] @http(path: "/connections/{{.value.id}}") | ||
id: Int! | ||
name: String! | ||
} | ||
|
||
type Connection { | ||
type: String | ||
user: User | ||
} | ||
|
||
type Mutation { | ||
createUser(user: UserInput): User @http(body: "{{.args.user}}", method: "POST", path: "/user") | ||
} | ||
|
||
type Query { | ||
user(id: Int!): User @http(path: "/users/1") | ||
} | ||
|
||
type User { | ||
connections: [Connection] @http(path: "/connections/{{.value.id}}") | ||
id: Int! | ||
name: String! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
92455fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running 30s test @ http://localhost:8000/graphql
4 threads and 100 connections
412126 requests in 30.02s, 2.07GB read
Requests/sec: 13730.19
Transfer/sec: 70.47MB