Commit 12905c5
authored
refactor(app):
* refactor(app): add `pending()` helper for mock body
in timeout tests, we construct mock bodies that are backed by a
`Pending<T>` future that will never yield any data.
this introduces a small `pending()` helper to the `MockBody` type used
in test code in the outbound proxy.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app): add `error()` helper for mock body
in metrics tests, we construct mock bodies that will yield an error
when polled, to examine how telemetry measures certain edge cases.
this introduces a small `error()` helper to the `MockBody` type used
in test code in the outbound proxy.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app): add `grpc_status()` helper for mock body
in metrics tests, we construct mock bodies that will yield an gRPC
status code in its trailers section
when polled, to examine how telemetry measures gRPC responses.
this refactors the `trailers()` function to more narrowly focus on the
test coverage needed, to help reduce boilerplate in test code.
Signed-off-by: katelyn martin <[email protected]>
---------
Signed-off-by: katelyn martin <[email protected]>MockBody convenience functions for test code (#3349)1 parent 4dc979f commit 12905c5
File tree
5 files changed
+38
-56
lines changed- linkerd/app/outbound/src
- http/logical
- policy/route
- backend/metrics
- metrics
- tests
5 files changed
+38
-56
lines changedLines changed: 4 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
107 | 105 | | |
108 | 106 | | |
109 | 107 | | |
| |||
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 151 | + | |
158 | 152 | | |
159 | 153 | | |
160 | 154 | | |
| |||
193 | 187 | | |
194 | 188 | | |
195 | 189 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 190 | + | |
201 | 191 | | |
202 | 192 | | |
203 | 193 | | |
| |||
267 | 257 | | |
268 | 258 | | |
269 | 259 | | |
270 | | - | |
271 | | - | |
272 | | - | |
| 260 | + | |
273 | 261 | | |
274 | 262 | | |
275 | 263 | | |
| |||
Lines changed: 4 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 95 | + | |
98 | 96 | | |
99 | 97 | | |
100 | 98 | | |
| |||
264 | 262 | | |
265 | 263 | | |
266 | 264 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 265 | + | |
272 | 266 | | |
273 | 267 | | |
274 | 268 | | |
| |||
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 307 | + | |
318 | 308 | | |
319 | 309 | | |
320 | 310 | | |
| |||
388 | 378 | | |
389 | 379 | | |
390 | 380 | | |
391 | | - | |
392 | | - | |
393 | | - | |
| 381 | + | |
394 | 382 | | |
395 | 383 | | |
396 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 134 | + | |
139 | 135 | | |
140 | 136 | | |
141 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
122 | | - | |
123 | | - | |
124 | | - | |
| 120 | + | |
125 | 121 | | |
126 | 122 | | |
127 | 123 | | |
| |||
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 202 | + | |
209 | 203 | | |
210 | 204 | | |
211 | 205 | | |
| |||
252 | 246 | | |
253 | 247 | | |
254 | 248 | | |
255 | | - | |
256 | | - | |
257 | | - | |
| 249 | + | |
258 | 250 | | |
259 | 251 | | |
260 | 252 | | |
| |||
286 | 278 | | |
287 | 279 | | |
288 | 280 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 281 | + | |
292 | 282 | | |
293 | 283 | | |
294 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
104 | 124 | | |
105 | 125 | | |
106 | | - | |
| 126 | + | |
107 | 127 | | |
108 | 128 | | |
109 | 129 | | |
| |||
0 commit comments