Commit 9f49e35
authored
chore(bottlecap): cross-platform test and code cleanups (#1211)
## Overview
Portable test and code cleanups in bottlecap. No behavior change on
Linux.
- `.gitattributes`: force LF for `*.sh` / `*.bash`. Shell scripts now
check out with LF on every platform, so a CRLF-prone checkout (e.g.
Windows) still executes cleanly inside Linux Docker containers.
- `bottlecap/src/tags/lambda/tags.rs`, the three
`tags::lambda::tags::tests::test_resolve_*` tests:
- Switch from a hard-coded `/tmp/...` path to `std::env::temp_dir()`.
Removes a bootstrap race between tests that were implicitly sharing a
filesystem side effect through the same path.
- Render paths with `to_string_lossy()` so a non-UTF-8 temp dir does not
panic the test.
- `test_resolve_runtime` now cleans up the file it created.
- `bottlecap/src/metrics/enhanced/statfs.rs`:
- `statfs_info` is `fn` on both targets. It's an internal helper; `pub`
was only present on the non-Windows branch.
- The existing `#[cfg(target_os = "windows")]` stub now uses
`io::Error::other(..)` (per `clippy::io_other_error`) and prefixes its
unused `path` with `_`.
> Origin: these commits were split out of #1193 after review feedback,
so the portable cleanups can land independently of the broader
Windows-build discussion.
## Testing
- `cargo check` on Linux: clean.
- `cargo test --lib tags::lambda::tags::`: 8 passed, 0 failed.
> *"Turns out 'make the tests not race on Windows' is also 'make the
tests not race on Linux'."*, Claude 🤖1 parent e8bf40c commit 9f49e35
3 files changed
Lines changed: 20 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
| |||
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
371 | | - | |
372 | | - | |
| 370 | + | |
| 371 | + | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
| |||
378 | 377 | | |
379 | 378 | | |
380 | 379 | | |
381 | | - | |
| 380 | + | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
| 387 | + | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
| 392 | + | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
| 405 | + | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
0 commit comments