Commit Graph
14 Commits
Author SHA1 Message Date
Amit Kumar Ojha 6af5cc7d0b easyenv: add test coverage for typed env var getters (#1749)
## 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
2026-07-08 16:30:43 -04:00
Brandon Thomas 27cc125089 trace id logging (#1725) 2026-07-03 02:28:22 -04:00
Brandon Thomas 64d66aa9f0 Batched Seedance 2.0 Job Polling (#1214) 2026-03-24 17:20:31 -04:00
Brandon Thomas ce0448edca move rust code back to root directory 2025-02-11 21:58:04 -05:00
Brandon Thomas 495b161cae move storyteller-rust files into subdir for merge 2025-02-11 21:09:22 -05:00
Brandon Thomas 5599ce2383 fix backfill query, improve logging 2024-09-03 00:25:14 -04:00
Brandon Thomas 97a3310b59 cleanup imports 2024-05-16 07:04:48 -07:00
Brandon Thomas 8d22697855 better environment variable errors 2024-01-28 03:36:17 -05:00
Brandon Thomas 26794b3d2e CLI tool to upload media files and save them to the DB 2023-10-19 21:52:32 -04:00
Brandon Thomas 9e0bee8fba Substitute config absolute paths with magic substitution strings 2023-10-17 21:37:20 -04:00
Brandon Thomas 3fc0f45942 "storyteller root" directory in development 2023-10-17 21:04:54 -04:00
Brandon Thomas 1ef7ae1009 Better env var support 2023-10-17 16:31:53 -04:00
Brandon Thomas 83dc262249 make lints and tests pass again 2023-09-26 02:13:16 -04:00
Brandon Thomas 1d3885c367 vendor in easyenv.rs (a crate I wrote) 2023-09-26 02:03:25 -04:00