Repository navigation
Make the get goal's repository tests capable of failing - #1678
Merged
Merged
Conversation
This was referenced Aug 9, 2026
slachiewicz
marked this pull request as ready for review
August 9, 2026 19:41
testRemoteRepositoriesAuthentication was not testing anything. Once any run has resolved test:test:1.0, it persists in the local repository the tests share under target/test-classes/unit/get-test/target/local-repo, so on any subsequent run without a clean the artifact is served from there and the test passes even with GetMojo's injectAuthentication call deleted outright. Resolve into a @tempdir local repository instead, so the assertion depends on the transfer actually happening, and cover the two paths that had no test at all: an active proxy from the settings must be applied to the repositories named by remoteRepositories, and nonProxyHosts must exclude a repository from it. The proxy points at a name in a reserved TLD that cannot resolve, so applying it is always observable, and the test asserts the failure mentions that host -- it cannot pass because the artifact was missing or the login was rejected. The nonProxyHosts test asserts a success, so it only distinguishes "honoured" from "proxies never applied" when read together with the proxy test; that is noted on it so the pair is not split up later. With this in place, deleting the three inject calls from GetMojo fails all three tests. Generated-by: Claude Opus 5 (1M context)
slachiewicz
force-pushed
the
agent/mdep-get-test-hardening
branch
from
August 9, 2026 19:56
46046e7 to
192310d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens dependency:get unit tests so they genuinely validate repository authentication/proxy behavior by eliminating false positives caused by artifacts persisting in a shared local test repository.
Changes:
- Isolates resolution into a per-test
@TempDirlocal repository to ensure transfers actually occur. - Adds coverage for proxy application to
remoteRepositoriesand fornonProxyHostsexcluding a repository from proxying. - Refactors test utilities to centralize server URL construction and proxy detection in failure chains.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
testRemoteRepositoriesAuthenticationwas not testing anything. Once any run has resolvedtest:test:1.0, it persists in the local repository the tests share undertarget/test-classes/unit/get-test/target/local-repo, so on any subsequent run without acleanthe artifact is served from there and the test passes withGetMojo'sinjectAuthenticationcall deleted outright.It now resolves into a
@TempDirlocal repository, so the assertion depends on the transfer actually happening. The two paths that had no test at all are covered too:<proxy>from the settings must be applied to the repositories named byremoteRepositories;<nonProxyHosts>must exclude a repository from a proxy that would otherwise match it.The proxy points at a name in a reserved TLD (RFC 2606) that cannot resolve, so applying it is always observable as a failure, and the test asserts the failure message mentions that host — it cannot pass because the artifact was missing or the login was rejected. The
nonProxyHoststest asserts a success, so on its own it cannot tell "honoured" from "proxies never applied"; that is noted in the test so the pair does not get split up later.Verification. Against this branch: 6/6 pass. With the three
injectMirror/injectProxy/injectAuthenticationcalls deleted fromGetMojo,testRemoteRepositoriesAuthentication,testRemoteRepositoriesProxyandtestRemoteRepositoriesNonProxyHostsall fail. So these characterise the behaviour rather than merely agreeing with the current implementation.Test-only; no
src/mainchange. First of three pieces split out of #1677 — merge order #1678 → #1677 → #1679. It stands on its own, and it is what lets the follow-ups show that the mirror/proxy/credential behaviour survives the refactor.Drafted with Claude — please verify