Repository navigation
Conversation
Coverage Report for CI Build 42350797805Coverage increased (+0.1%) to 87.967%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Load a synthetic purpose from the config file and require the running relay to forward it to a gateway that supports only that purpose. Catch a dropped configuration setting that parsing and prober unit tests cannot. Bind the test gateway before sending traffic and use an explicit deadline. This removes the startup sleep and exposes listener failures.
60b34a2 to
504fd42
Compare
|
force pushed to removing a race condition in the test and reduce the time it takes to run |
AdityaKaushal17
left a comment
There was a problem hiding this comment.
Tested locally on the PR head (504fd42) on macOS, default features:
cargo test -p payjoin-mailroom: 78 unit tests and 4 integration tests pass, including test_extra_allowed_purpose_from_config.
cargo fmt --all -- --check: no diffs.
cargo clippy -p payjoin-mailroom --all-targets -- -D warnings: no warnings.
To check that the new test covers the config path, I misspelled the extra_allowed_purposes key in the test's TOML. The test then failed at integration.rs:237 with left: 404, right: 200, so without the setting the relay rejects the purpose, which is what the test should catch. I restored the file afterwards.
One observation, not blocking: the misspelled key loaded without any error. Config and OhttpRelayConfig don't use #[serde(deny_unknown_fields)], so a typo in a setting is silently ignored. I'm happy to open a separate issue for that if it's useful.
A misspelled key in the config file, such as `extra_allowed_purpose`, was silently dropped and its setting fell back to the default (payjoin#2084). Deserialize through serde_ignored to collect the keys no setting reads, and fail if any of them come from the file. Environment variables are not checked, because every PJ_ variable is read, including ones meant for other tools. A section for a feature this build does not include, such as [acme] without the acme feature, is reported with the name of that feature. This builds on the load() split from payjoin#2091. Claude-Session: https://claude.ai/code/session_01AMHTByaVgjBz8ZQGt3yRaX
Load a synthetic purpose from the config file and require the running relay to forward it to a gateway that supports only that purpose. Catch a dropped configuration setting that parsing and prober unit tests cannot. Follow up regression test for #2026
claude x kimi reviewed the prior pr and came up with this
Pull Request Checklist
Please confirm the following before requesting review: