mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-25 10:39:37 +00:00
6af5cc7d0b
## Summary easyenv had no test coverage for boolean, num, string, or duration getters, despite being used across every service and job in the workspace. adds 34 tests covering the optional/required/or_default triad for each type.tests use unique env var names per test instead of adding `serial_test` dev-dep — `env::set_var` is process-global so cargo's default parallel execution can race. cleanup via a `Drop` guard (`EnvVarGuard`, in `tests_common.rs`) so a panicking test doesn't leak state into its neighbors. ## follow-up left `pathbuf.rs` for a separate PR — it depends on `storyteller_root::get_substituted_path` which needs more setup than belongs in this diff. ## behaviors these tests pin down but don't change - boolean parsing only accepts `true` / `TRUE` / `false` / `FALSE` — `"1"`, `"0"`, `"yes"`, `"no"` return `ParseError` - duration parses whole seconds only, no `"5s"` style suffixes worth flagging in case either is intentional and someone wants to loosen these separately. ## verification - `cargo test --package easyenv --test-threads=8` — 34/34 pass, no flakes across 20 consecutive runs - `cargo clippy --package easyenv -- -D warnings` — clean