core: pin that a darner.toml that does not parse is refused #636
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!636
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:config-parse-failure-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
The problem on main: nothing. This is a tests-only change (no production line is edited).
What it pins: the parse branch of
Config::load_fromis the only branch with no test:That
?is the entire guarantee that a brokendarner.tomlcannot silently become the document defaults — a misspelt key, a wrong type or a bad string would otherwise change where every run looks and say nothing. Every other branch had a test (a missing default file, a missing explicit file, a directory at either path, both symlink paths, and the successful parse ofdarner.example.toml), but nothing ever fedload_froma file that fails to parse, so aunwrap_or_default()or a dropped#[serde(deny_unknown_fields)]would keep the whole module green.This change adds one test that writes a temp
darner.tomland loads it throughConfig::load_from.How it was tested
59b1686(one commit onc8258f9).cargo test --locked -p darner-core --lib— 51 passed, 0 failed.config::tests::a_config_file_that_does_not_parse_is_refused: a file that is not TOML and a file with a wrongly typed field are bothErr, and the message names the file it was reading; the existing "a missing default file is optional" behaviour is asserted beside it so the two halves are pinned together.unwrap_or_default(): the new test fails, and every other test in the module stays green — which is the gap itself.cargo clippy --locked -p darner-core --all-targets -- -D warningspasses.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --locked -p darner-core --libis green (51 passed); the whole-workspace run is not green on this machine for the pre-existingdarner-gpureasons (#224, #150), which this does not touch.deny_unknown_fieldsis on, which this test does not assert specifically.Checklist
main.docs/asset-policy.md(cargo xtask policy: passes).Checked for overlap
crates/darner-core/src/config.rs(unused-helper cleanup); this change only adds to the test module. No open or closed issue mentions a malformeddarner.toml.[pr-tests] core: pin that a darner.toml that does not parse is refusedto core: pin that a darner.toml that does not parse is refusedView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.