Commit ebb0cad
committed
test(rust): put back the environment variable a test borrows
`with_var` ended by removing the variable rather than restoring what it held. The Rust legs
run against a mock with `GrpcClient__Endpoint` already set, so a test that borrowed it took it
away from every `client::` test in the same binary, and all four legs went red:
called `Result::unwrap()` on an `Err` value: Config { source: Invalid { source: Uri {
source: InvalidUri(Empty), uri: "" ... } } }
It now saves the value and puts it back from a `Drop` guard, so a failing test restores too.
Restoring is not enough on its own: the `client::` tests are not serialised against this
module, so a hardcoded endpoint could be read by one of them mid-flight. The test borrows
`GrpcClient__UserAgent` instead, which nothing else depends on, and asserts on
`ClientConfigArgs::from_env`, so it needs no endpoint at all. What it dropped, args becoming a
parsed configuration, is covered in the transport's own tests.
cargo test -p armonik --all-features --lib client::env: 6 passed, 0 failed.
cargo fmt --all --check: clean.1 parent ae435e3 commit ebb0cad
1 file changed
Lines changed: 33 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
176 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
177 | 196 | | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
181 | | - | |
182 | | - | |
183 | | - | |
| 200 | + | |
184 | 201 | | |
185 | 202 | | |
186 | 203 | | |
| |||
271 | 288 | | |
272 | 289 | | |
273 | 290 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
281 | 300 | | |
282 | | - | |
| 301 | + | |
283 | 302 | | |
284 | | - | |
| 303 | + | |
285 | 304 | | |
286 | 305 | | |
0 commit comments