test: fix vacuous is_err() assertions in runtime extension tests#1568
Merged
jamesadevine merged 1 commit intoJul 21, 2026
Merged
Conversation
Upgrade 6 bare is_err() calls (node, python, dotnet) to unwrap_err() with message-content assertions. Each test now verifies the correct error variant fires — the right field name and cause are included — so a future regression that returns a different error (or no error) would be caught rather than silently accepted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
marked this pull request as ready for review
July 21, 2026 13:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Suite Reduction:
src/runtimes/extension testsWhat was wrong
Six tests across the node, python, and dotnet runtime extensions used bare
assert!(ext.declarations(...).is_err()). A bareis_err()assertion only confirms that some error was returned — it would pass even if a completely unrelated error fired (e.g. a parse error, a panic converted to anyhow, or an unrelated validation failure). None of these tests verified the error was actually the expected one for the scenario they described.Changes
src/runtimes/node/extension.rstest_validate_invalid_feed_url_rejectedis_err()→unwrap_err()+ assert message containshttps://scheme text andruntimes.node.feed-urlsrc/runtimes/node/extension.rstest_validate_version_injection_rejectedis_err()→unwrap_err()+ assert message containsADO expressionandruntimes.node.versionsrc/runtimes/python/extension.rstest_validate_invalid_feed_url_rejectedis_err()→unwrap_err()+ assert message containshttps://andruntimes.python.feed-urlsrc/runtimes/python/extension.rstest_validate_version_injection_rejectedis_err()→unwrap_err()+ assert message containsADO expressionandruntimes.python.versionsrc/runtimes/dotnet/extension.rstest_validate_invalid_feed_url_rejectedis_err()→unwrap_err()+ assert message containsADO expressionandruntimes.dotnet.feed-urlsrc/runtimes/dotnet/extension.rstest_validate_version_injection_rejectedis_err()→unwrap_err()+ assert message containsADO expressionandruntimes.dotnet.versionVerification
cargo test: all tests pass ✅Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.