chore(deps): update rust crate axum-test to v20 - autoclosed#67
chore(deps): update rust crate axum-test to v20 - autoclosed#67renovate[bot] wants to merge 1 commit into
Conversation
51e8e87 to
997de3c
Compare
997de3c to
de90908
Compare
There was a problem hiding this comment.
Summary
This PR updates the axum-test dev dependency from version 18.x to 20.x. This is a major version upgrade that includes breaking API changes.
Verdict: Needs changes — The test code uses an outdated API pattern that, while still compiling, should be updated to match the new v20 API.
Research notes
I reviewed the API documentation for both axum-test v18.7.0 and v20.1.0:
- v18.7.0:
TestServer::new()returnedResult<Self>and required error handling with?or.unwrap() - v20.1.0:
TestServer::new()returnsSelfdirectly (panics on failure). The fallible version is nowtry_new()which returnsResult<Self>
Reference: https://docs.rs/axum-test/20.1.0/axum_test/struct.TestServer.html#method.new
The change was made to simplify the common case where server creation failures are exceptional and should panic rather than be handled gracefully in tests.
Suggested next steps
-
Blocking: Update all
TestServer::new(app).unwrap()calls toTestServer::new(app)intests/integration_tests.rs- the.unwrap()is now redundant and should be removed for clarity. -
Consider running the full test suite after the update to ensure compatibility with the new version (though the existing usage pattern should continue to work).
General findings
The Cargo.lock shows this is a well-scoped dependency update with mostly transitive dependency changes. The core change is:
axum-test: 18.7.0 → 20.1.0- Removes
smallvecdependency from axum-test - Updates various transitive dependencies (tokio, hyper, futures, etc.)
No breaking changes to your actual test logic are expected since you're using .unwrap() which masks the return type difference. However, the code should be cleaned up to use the new API properly.
General findings (auto-demoted from inline due to pre-validation)
- Non-blocking
tests/integration_tests.rs:169— In axum-test v20,TestServer::new()returnsSelfdirectly instead ofResult<Self>. The.unwrap()call is now redundant.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
|
|
||
| [dev-dependencies] | ||
| axum-test = "18.0" | ||
| axum-test = "20.0" |
There was a problem hiding this comment.
Non-blocking: Consider pinning to a more specific version or using "20.1" to match what's in Cargo.lock.
Why it matters: You're specifying "20.0" but Cargo.lock has 20.1.0. While semver-compatible, being explicit helps with reproducibility and makes it clear which minor version you've tested against.
Suggested fix: Either:
axum-test = "20.1"(recommend if you want to stay current)- Or keep as-is and rely on Cargo.lock for exact versions (acceptable practice)
de90908 to
b0a478e
Compare
There was a problem hiding this comment.
Summary
This PR updates the axum-test dev-dependency from v18.7.0 to v20.1.0, a major version upgrade that includes breaking API changes. The most significant change is that TestServer::new() no longer returns a Result - it panics on failure instead. This means all 11 .unwrap() calls in the test file are now invalid and will cause compilation errors.
Verdict: Blocked - requires code changes to remove unnecessary .unwrap() calls before this can merge.
Research notes
-
axum-test v19.0.0 changelog: https://github.com/JosephLenton/axum-test/releases/tag/19.0.0
- "
new()constructor no longer returns a Result, and instead panics on failure" - "Added
try_new()to allow people to continue to catch the Result if needed"
- "
-
docs.rs v18.7.0 shows
TestServer::new(app)?returningResult<Self> -
docs.rs v20.1.0 shows
TestServer::new(app)returningSelfdirectly (panics on failure)
Suggested next steps
- Remove all
.unwrap()calls fromtests/integration_tests.rswhereTestServer::new()is called (11 locations total) - Run
cargo testto verify tests compile and pass - Optionally consider using
TestServer::try_new()if explicit error handling is preferred in any test
General findings
The dependency update itself appears sound - axum-test v20.1.0 is compatible with axum v0.8.9 which is already in use. The Cargo.lock shows appropriate transitive dependency updates (tokio, hyper, serde_json, etc.). No security concerns identified with the updated packages.
General findings (auto-demoted from inline due to pre-validation)
- Blocking
tests/integration_tests.rs:169— In axum-test v19+,TestServer::new()no longer returns aResult- it panics on failure. Calling.unwrap()on the return value will cause a compilation error becauseTestServerdoesn't have anunwrap()method.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:199— Same issue as line 169 -TestServer::new()no longer returns aResultin axum-test v19+, so.unwrap()is invalid.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:242— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:276— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:310— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:366— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:401— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:436— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:494— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:523— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
- Blocking
tests/integration_tests.rs:804— Same issue - remove.unwrap()sinceTestServer::new()now returnsTestServerdirectly.- (demoted: path "tests/integration_tests.rs" is not in the PR diff)
This PR contains the following updates:
18.0→20.0Release Notes
JosephLenton/axum-test (axum-test)
v19.1.0Compare Source
TestServer::scheme, as it never actually worked with http requests only mocked requests.TestRequest::scheme, as it never actually worked with http requests only mocked requests.HOSTheader, which matches the behaviour with Hyper based HTTP services.v19.0.0TestServer,TestServerBuilder, andTestServerConfig.new()constructor no longer returns a Result, and instead panics on failure.try_new()to allow people to continue to catch the Result if needed.TestResponseassertion functions now return&self, allowing calls to be chained!TestServer::save_cookies()andTestServer::do_not_save_cookies()commands.old-json-diff.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.