-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathgrpc.yml.runbook.golden
102 lines (102 loc) · 3.37 KB
/
grpc.yml.runbook.golden
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
102
-- -testdata-book-grpc.yml --
desc: Captured of grpc.yml run
runners:
greq:
addr: ${TEST_GRPC_ADDR-:grpc.example.com:443}
bufDirs:
- ../
skipVerify: true
tls: true
steps:
- greq:
grpctest.GrpcTestService/Hello:
headers:
authentication: tokenhello
multivalues:
- a
- b
message:
name: alice
num: 3
request_time: "2022-06-25T05:24:43.861872Z"
test: |
current.res.headers["content-type"][0] == "application/grpc"
&& current.res.headers["hello"][0] == "header"
&& current.res.trailers["hello"][0] == "trailer"
&& compare(current.res.message, {"create_time":"2022-06-25T05:24:43.861872Z","message":"hello","num":32})
&& current.res.status == 0
- greq:
grpctest.GrpcTestService/HelloFields:
message:
field_bytes: aGVsbG8=
test: |
current.res.headers["content-type"][0] == "application/grpc"
&& compare(current.res.message, {"field_bytes":"aGVsbG8="})
&& current.res.status == 0
- greq:
grpctest.GrpcTestService/Hello:
headers:
error: error
message:
name: alice
num: 3
request_time: "2022-06-25T05:24:43.861872Z"
test: |
current.res.trailers["content-type"][0] == "application/grpc"
&& current.res.status == 1
- greq:
grpctest.GrpcTestService/ListHello:
headers:
authentication: tokenlisthello
message:
name: bob
num: 4
request_time: "2022-06-25T05:24:43.861872Z"
test: |
compare(current.res.messages[0], {"create_time":"2022-06-25T05:24:43.861872Z","message":"hello","num":33})
&& compare(current.res.messages[1], {"create_time":"2022-06-25T05:24:44.382783Z","message":"hello","num":34})
&& current.res.headers["content-type"][0] == "application/grpc"
&& current.res.headers["listhello"][0] == "header"
&& current.res.trailers["listhello"][0] == "trailer"
&& current.res.status == 0
- greq:
grpctest.GrpcTestService/MultiHello:
headers:
authentication: tokenmultihello
messages:
- name: alice
num: 5
request_time: "2022-06-25T05:24:43.861872Z"
- name: bob
num: 6
request_time: "2022-06-25T05:24:43.861872Z"
test: |
compare(current.res.message, {"create_time":"2022-06-25T05:24:45.382783Z","message":"hello","num":35})
&& current.res.headers["content-type"][0] == "application/grpc"
&& current.res.headers["multihello"][0] == "header"
&& current.res.trailers["multihello"][0] == "trailer"
&& current.res.status == 0
- greq:
grpctest.GrpcTestService/HelloChat:
headers:
authentication: tokenhellochat
messages:
- name: alice
num: 7
request_time: "2022-06-25T05:24:43.861872Z"
- receive
- name: bob
num: 8
request_time: "2022-06-25T05:24:43.861872Z"
- name: charlie
num: 9
request_time: "2022-06-25T05:24:43.861872Z"
- close
test: |
current.res.headers["content-type"][0] == "application/grpc"
&& current.res.headers["hellochat"][0] == "header"
&& compare(current.res.messages[0], {"create_time":"2022-06-25T05:24:46.382783Z","message":"hello","num":34})
&& current.res.trailers["hellochat"][0] == "trailer"
&& current.res.trailers["hellochat-second"][0] == "trailer"
&& current.res.trailers["hellochat-second"][1] == "trailer"
&& current.res.status == 0