Quality
This page describes how adotenv is tested and what each check covers. The current coverage figures and known gaps are in the test audit.
Test layers
Section titled “Test layers”- Unit tests for the parser, model, dialects, edits, encoding, formatting, sorting, comparison, portability, structure, positions, references and resolution.
- Property tests on arbitrary UTF-8 input for parsing, dialects, edits,
encoding, formatting, sorting, comparison, portability, structure, examples,
references, resolution and
parse_values. CI runs them with 2,000 cases each. - Integration tests for loading, serde, the CLI and its JSON schemas, the adapters, and the memory use of reference scanning.
- Shared format-contract vectors for positions, text edit order, GitHub escaping, and the check and diff report schemas, with a hash manifest.
- Doctests for the rustdoc examples, the README and every page of this site.
- Builds for
no_std, the minimum supported Rust versions and each feature set.
Continuous integration
Section titled “Continuous integration”The gate is the CI workflow,
which runs on every pull request, every push to main and every release tag.
Its main steps:
cargo fmt --all --checkcargo fmt --manifest-path fuzz/Cargo.toml --all --checkcargo fmt --manifest-path conformance/rust/Cargo.toml --all --checkpython3 scripts/check_docs.pyshellcheck scripts/*.shactionlintcargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --manifest-path conformance/rust/Cargo.toml --all-targets --locked -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --lockedcargo test --workspace --lockedcargo test -p adotenv --features load,serde --lockedcargo audit --deny warningscargo deny checkcargo semver-checks check-release --package adotenv --package adotenv-process \ --package adotenv-config --package adotenv-figment --package adotenv-lint \ --package adotenv-lspcargo package -p adotenv --lockedpython3 conformance/check_adotenv.py --setupThe workflow also:
- builds and tests every feature set: default,
exec,load,serde,load,serde, no default features, and no default features withserde, plus the adapters withload; - runs the tests on Linux, macOS and Windows;
- builds
adotenv,adotenv-process,adotenv-cli,adotenv-lint,adotenv-lsp(default features and--no-default-features) andadotenv-figmentwith Rust 1.81, andadotenv-configwith Rust 1.88; - builds the core for the
thumbv7em-none-eabitarget without default features; - resolves the published workspace dependencies to their lowest compatible
versions on nightly and runs their test suite (
adotenv-lspis excluded becauselsp-types0.97 declares 2018-era minimum versions that do not build under nightly-Z minimal-versions); - checks that every package includes its license files;
- runs the
gungraundet_parsebenchmark smoke test, checks the memory regression gates withadotenv-xtask gateagainst bothdocs/benchmarks/memory.jsonlanddocs/benchmarks/compact-memory.jsonl(adotenv,adotenv-compactandadotenv-compact-entries), and runs the deterministic instruction-count gate (scripts/det-perf-gate.sh).
The docs workflow also builds the mdBook site and runs a headless-browser smoke test for nested navigation, charts, sortable/filterable tables and selector help popovers.
All warnings are errors in CI, except the minimal-versions job, where dependency minimums can fail warning-clean builds.
Diagnostics
Section titled “Diagnostics”Diagnostic codes and spans are stable; message text may change. Recovering parsers retain items and diagnostics. Strict parsing and edit verification do not build diagnostic lists they do not use.
Fuzzing
Section titled “Fuzzing”The repository has seven bounded fuzz targets. Six have public seed corpora:
parser, edits, encoding, resolve, format and differential; the
limits target starts from generated inputs. The differential target compares
Portable value parsing with
the pinned in-memory competitors on the conservative KEY=value grammar, and
runs malformed/recovery inputs through parser invariants without asserting
upstream equivalence where semantics differ. The
fuzz workflow
runs each target for five minutes, weekly and on demand, with bounded time per
input, memory and input length.
cargo +nightly fuzz run parserscripts/dispatch_fuzz.sh starts one workflow run and waits for its result.
Release evidence uses scheduled runs; the rule is in
1.0 readiness. Ad hoc local campaigns are
development checks only.
Conformance
Section titled “Conformance”conformance/manifest.json records pinned observations from real Node,
Python, Compose and Docker env-file implementations. The corpus has 89 cases
and 21 profiles. The runner checks package and source identities, hashes the
inputs and compares literal observations plus a curated Compose resolution
profile.
python3 conformance/check_adotenv.py --setupCompose’s default parser performs interpolation. Literal comparison uses
dollar-free inputs with an empty lookup; the separate compose_resolve profile
compares curated Compose interpolation cases. Portable is not asserted equal
to any upstream implementation.
Coverage and mutation testing
Section titled “Coverage and mutation testing”CI produces a coverage report with cargo llvm-cov and uploads it as an
artifact. There is no coverage threshold, and coverage alone does not block a
release.
Mutation testing runs weekly and on demand in four shards. It targets parser
diagnostics, key validation, edit verification and formatting equivalence,
with a 90-second timeout and two jobs per shard. The 1.4.1 focused campaign
and the subsequent 1.5.4, 1.6.0, 1.6.1, 1.7.x and 1.8.x (plus companion 0.3.x /
0.7.x) per-crate and --in-diff sweeps across all seven published crates are
recorded in the test audit. Survivors are input for targeted regression tests,
not an automatic release blocker.
Full test and mutation runs are resource-heavy. Follow
heavy validation; in particular, do not run
cargo mutants with multiple workers on the shared development host.
cargo mutants --file src/parser.rs --file src/edit.rs --file src/format.rs \ --re 'in (merge_lone_cr|valid_key_in|verify_entry_region|same_meaning)' \ --shard 0/4 --timeout 90 --jobs 2 --gitignore trueSupported Rust versions and semver
Section titled “Supported Rust versions and semver”The minimum supported Rust version is 1.81 across adotenv, adotenv-process,
adotenv-cli, adotenv-lint, adotenv-lsp and adotenv-figment.
adotenv-config follows the minimum of config, currently 1.88. A minimum
version rises only in a minor release.
The public API follows semantic versioning. Enums and structs that may grow
are non-exhaustive, and options are set through builders. CI runs
cargo semver-checks for all six published library crates (adotenv,
adotenv-process, adotenv-config, adotenv-figment, adotenv-lint and
adotenv-lsp) against their latest published versions. Breaking releases list
their changes and a migration guide in the changelog; see
Upgrading to 1.0.
Supply chain
Section titled “Supply chain”deny.toml allows only Apache-2.0, MIT and Unicode-3.0 dependencies, denies
unknown registries and Git sources, and reports duplicate versions as warnings.
Add a reviewed exception only when the dependency or duplicate is intentional.
GitHub Actions are pinned by commit.
Limits
Section titled “Limits”A successful bounded test or fuzz run is not a proof for all inputs. Callers handling untrusted source should limit its size before parsing; see Security and limits.