Skip to content

test: expand unit coverage across 13 packages#64

Merged
luthermonson merged 3 commits into
mainfrom
tests/combined-unit-coverage
May 16, 2026
Merged

test: expand unit coverage across 13 packages#64
luthermonson merged 3 commits into
mainfrom
tests/combined-unit-coverage

Conversation

@luthermonson
Copy link
Copy Markdown
Contributor

Summary

  • Adds ~4,800 lines of unit tests across scheduler, dind, cni, runtime, networking, forgerunner, github, localtunnel, metrics, config, vm, and workflow packages
  • Covers concurrent claim dedup, dispatch client round-trips, tar traversal rejection, streaming paths, command parsing, secret masking, token refresh, webhook rollback, reconnect scheduling, label cardinality, subnet retry/fallback, log cleanup, pull mutex serialization, SSH key material, and config edge cases
  • Fixes blank error discards (_ =) in existing dispatch_test.go
  • Small refactors in networking.go (pickSubnet testability), dind/exec.go (streamToTempFile extraction), and github/appauth.go (concurrent token refresh)

Test plan

  • mage lint passes (0 issues)
  • All new tests pass locally (only pre-existing TestPushHandlerEndToEnd fails on Windows — requires containerd privileges, also fails on main)
  • No changes to production logic beyond minor refactors for testability

…g, and more

Add ~4,700 lines of unit tests covering: concurrent claim dedup and
cancellation (scheduler), dispatch client round-trips, tar extraction
traversal rejection (cni, dind), streaming temp file paths, forgerunner
command parsing and secret masking, GitHub token refresh and webhook
rollback, localtunnel reconnect scheduling, metrics label cardinality,
networking subnet retry/fallback, runtime log cleanup and pull mutex
serialization, VM SSH key material, workflow container coverage, and
config provider/duration edges.

Also fixes blank error discards (_ =) in dispatch_test.go and renames
the concurrent test's fakeDispatchServer to avoid redeclaration.
@luthermonson luthermonson marked this pull request as draft May 8, 2026 04:43
@luthermonson luthermonson marked this pull request as ready for review May 8, 2026 04:43
@luthermonson luthermonson force-pushed the tests/combined-unit-coverage branch from 13494b2 to 402ea20 Compare May 14, 2026 05:30
Resolved conflicts and pre-existing lint failures so this branch can land:

Conflicts (5 files):
- pkg/dind/build_linux_test.go        (add/add — took main's BuildKit-aware version)
- pkg/runtime/logclean_test.go        (content — took main's)
- pkg/scheduler/concurrent_test.go    (add/add — took main's)
- pkg/scheduler/dispatch_test.go      (content — took main's)
- pkg/vm/embed_test.go                (content — took main's)

Main has independently grown test coverage for these files since this
branch was opened — the conflict resolutions favor main throughout
because (a) main is current and references current production code,
and (b) the branch's versions were testing earlier API surfaces (e.g.
pre-BuildKit /build handler in pkg/dind/build_linux_test.go) that no
longer exist after PR #68 etc.

Lint fix:
- Delete pkg/dind/extract_buildcontext_linux_test.go — referenced
  undefined `extractBuildContext` (the function was renamed to
  `extractBuildContextToTempDir` with a different signature on main;
  pkg/dind/buildkit_build_test.go already covers the new signature
  including path-traversal rejection).

Verified locally: `CGO_ENABLED=0 go test ./...` passes for every
package in the module on this Windows host.
@luthermonson luthermonson merged commit 59a8388 into main May 16, 2026
4 checks passed
@luthermonson luthermonson deleted the tests/combined-unit-coverage branch May 16, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant