-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
grpc.yml
101 lines (101 loc) · 3.1 KB
/
grpc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
desc: Test using gRPC
runners:
greq:
addr: ${TEST_GRPC_ADDR-:grpc.example.com:443}
tls: true
skipVerify: true
bufDirs:
- ../
vars:
names:
- alice
- bob
- charlie
steps:
unary:
desc: Request using Unary RPC
greq:
grpctest.GrpcTestService/Hello:
headers:
authentication: tokenhello
multivalues:
- a
- b
message:
name: "{{ vars.names[0] }}"
num: 3
request_time: 2022-06-25T05:24:43.861872Z
test: |
steps.unary.res.status == 0 && steps.unary.res.message.message == 'hello'
field_types:
desc: Request using Unary RPC with several field types
greq:
grpctest.GrpcTestService/HelloFields:
message:
field_bytes: "{{ toBase64('hello') }}" # Base64 encoding to pass bytes type
test: |
steps.field_types.res.status == 0 && fromBase64(steps.field_types.res.message.field_bytes) == 'hello'
error_message:
desc: Get gRPC error message
greq:
grpctest.GrpcTestService/Hello:
headers:
error: 'error'
message:
name: "{{ vars.names[0] }}"
num: 3
request_time: 2022-06-25T05:24:43.861872Z
test: |
current.res.status == 1 && current.res.message == 'request canceled'
server_streaming:
desc: Request using Server streaming RPC
greq:
grpctest.GrpcTestService/ListHello:
headers:
authentication: tokenlisthello
message:
name: "{{ vars.names[1] }}"
num: 4
request_time: 2022-06-25T05:24:43.861872Z
test: |
steps.server_streaming.res.status == 0 && len(steps.server_streaming.res.messages) == 2 && steps.server_streaming.res.messages[1].num == 34
client_streaming:
desc: Request using Client streaming RPC
greq:
grpctest.GrpcTestService/MultiHello:
headers:
authentication: tokenmultihello
messages:
-
name: "{{ vars.names[0] }}"
num: 5
request_time: 2022-06-25T05:24:43.861872Z
-
name: "{{ vars.names[1] }}"
num: 6
request_time: 2022-06-25T05:24:43.861872Z
test: |
steps.client_streaming.res.status == 0 && steps.client_streaming.res.message.num == 35
bidirectional_streaming:
desc: Request using Bidirectional streaming RPC
greq:
grpctest.GrpcTestService/HelloChat:
headers:
authentication: tokenhellochat
messages:
-
name: "{{ vars.names[0] }}"
num: 7
request_time: 2022-06-25T05:24:43.861872Z
- receive # receive server message
-
name: "{{ vars.names[1] }}"
num: 8
request_time: 2022-06-25T05:24:43.861872Z
-
name: "{{ vars.names[2] }}"
num: 9
request_time: 2022-06-25T05:24:43.861872Z
- close # close connection
test: |
steps.bidirectional_streaming.res.status == 0 && steps.bidirectional_streaming.res.message.num == 34 && len(steps.bidirectional_streaming.res.messages) == 1