Repository navigation
test(e2e): cover matchIPv4 IP-selection helper - #961
Merged
Merged
Conversation
## Summary Adds unit test coverage for the previously-untested `matchIPv4` helper in `e2e/framework/server_utils.go`. ## Context `matchIPv4` is a pure helper used by `getIP` / `ServeAgent` (the test-only HTTP server that serves the locally-built devsy agent binary to non-Linux CI runners, setting `DEVSY_AGENT_URL`). It selects an IPv4 address whose classful default mask is `/24` (class C, `ffffff00`) or `/8` (class A, `ff000000`) — class B (`/16`) is deliberately skipped — so the agent server binds to a reachable LAN address. It had **zero** test coverage (no `server_utils_test.go` existed), and its subtle behavior (ignoring the configured subnet mask and using only the IP's classful default mask; returning the network address for `*net.IPNet`) is easy to regress. ## Edge cases covered - `*net.IPNet` class C (`192.168.1.0/24`) → selected - `*net.IPNet` class A (`10.0.0.0/8`) → selected - `*net.IPNet` class B (`172.16.0.0/16`) → **not** selected (the gap the helper exists to enforce) - `*net.IPAddr` class C → selected - IPv6 (`fd00::1/64`) → not selected - Unknown `net.Addr` type (`*net.UDPAddr`) → not selected Tests exercise the real `matchIPv4` code path (no mocks). ## Logs inspected Reviewed CI runs for the `up-workspaces` suite. The failing `up-workspaces` run (#31305514055) was environmental (`signal: killed` / OOM), not a code bug, so this run instead closes a real test-coverage gap in the e2e framework rather than patching flakiness. ## Verification - `task cli:format` — clean - `task cli:lint:ci` — `0 issues` (new-from-patch against origin/main) - `go test ./e2e/framework/...` (incl. `TestMatchIPv4*`) — **PASS** - `task cli:test` — unit tests pass; the only failures are the known pre-existing `pkg/git` `TestRepoClone*` (stale assertion on origin/main, untouched by this change) and the Ginkgo `e2e` suites that require Docker/the devsy binary (environmental, not run as unit tests). This PR was created by an AI agent as part of an automated daily e2e review job.
✅ Deploy Preview for images-devsy-sh canceled.
|
✅ Deploy Preview for devsydev canceled.
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 6 |
| Duplication | 0 |
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Signed-off-by: GitHub <noreply@github.com>
skevetter
marked this pull request as ready for review
August 9, 2026 17:01
skevetter
enabled auto-merge (squash)
August 9, 2026 17:01
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.
Summary
Adds unit test coverage for the previously-untested
matchIPv4helper ine2e/framework/server_utils.go.Context
matchIPv4is a pure helper used bygetIP/ServeAgent(the test-only HTTP server that serves the locally-built devsy agent binary to non-Linux CI runners, settingDEVSY_AGENT_URL). It selects an IPv4 address whose classful default mask is/24(class C,ffffff00) or/8(class A,ff000000) — class B (/16) is deliberately skipped — so the agent server binds to a reachable LAN address. It had zero test coverage (noserver_utils_test.goexisted), and its subtle behavior (ignoring the configured subnet mask and using only the IP's classful default mask; returning the network address for*net.IPNet) is easy to regress.Edge cases covered
*net.IPNetclass C (192.168.1.0/24) → selected*net.IPNetclass A (10.0.0.0/8) → selected*net.IPNetclass B (172.16.0.0/16) → not selected (the gap the helper exists to enforce)*net.IPAddrclass C → selectedfd00::1/64) → not selectednet.Addrtype (*net.UDPAddr) → not selectedTests exercise the real
matchIPv4code path (no mocks).Logs inspected
Reviewed CI runs for the
up-workspacessuite. The failingup-workspacesrun (#31305514055) was environmental (signal: killed/ OOM), not a code bug, so this run instead closes a real test-coverage gap in the e2e framework rather than patching flakiness.Verification
task cli:format— cleantask cli:lint:ci—0 issues(new-from-patch against origin/main)go test ./e2e/framework/...(incl.TestMatchIPv4*) — PASStask cli:test— unit tests pass; the only failures are the known pre-existingpkg/gitTestRepoClone*(stale assertion on origin/main, untouched by this change) and the Ginkgoe2esuites that require Docker/the devsy binary (environmental, not run as unit tests).This PR was created by an AI agent as part of an automated daily e2e review job.