Draft
Increase test coverage from 29.6% to 78.8% (target: 70%)#10
Conversation
Co-authored-by: zparnold <5190984+zparnold@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Increase test coverage to 70 percent
Increase test coverage from 29.6% to 78.8% (target: 70%)
Feb 24, 2026
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 coverage was at 29.6% with no tests for
pkg/k8sand sparse coverage inpkg/apiandpkg/cleanup. Brings total coverage to 78.8% by introducing fake Kubernetes client injection and comprehensive test suites across all packages.Core enabler: fake k8s client injection
pkg/k8s/client.go: changedclientsetfield from*kubernetes.Clientsettokubernetes.Interface(backward-compatible) and addedNewClientFromInterface()constructor — allows tests to injectk8s.io/client-go/kubernetes/fakewithout hitting a real cluster.New / expanded test coverage
pkg/k8s(0% → 80.1%):portToInt32boundary cases;GetPodStatusfor all pod phases including CrashLoopBackOff;CreateSandboxvariants (RuntimeClass, ImagePullSecrets, CA cert mount, env vars, all command forms);DeleteSandbox(normal + not-found);WaitForPodReadytimeout;DiscoverRuntimeBySessionID/RuntimeID(found, missing, no-label cases)pkg/api(27.2% → 84.8%): Full handler lifecycle via fake k8s —StartRuntime,StopRuntime,PauseRuntime,ResumeRuntimesuccess paths; all error/validation branches;LoggingMiddlewarein debug mode;rewriteCookiePathandcreateProxyResponseRewriteredge cases; VSCode proxy routingpkg/cleanup(21.0% → 87.7%):Start/Stopwith context cancellation;runCleanupwith failed-pod and idle-pod cleanup;LastActivityTimevsCreatedAtidle threshold logicpkg/types(83.3% → 100%):FlexibleCommand.String()and invalid JSON unmarshal error pathThreshold enforcement
Updated coverage gate from 25% → 70% in both
Makefileand.github/workflows/ci.yml.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
runtime-rt-vscode.test.svc.cluster.local/tmp/go-build4041447183/b001/api.test /tmp/go-build4041447183/b001/api.test -test.paniconexit0 -test.gocoverdir=/tmp/go-build4041447183/b001/gocoverdir -test.timeout=10m0s -test.coverprofile=/tmp/go-build4041447183/b001/_cover_.out go1.24.12 -coveragecfg=/tmp/go-build234948492/b001/coveragecfg -c=4 -nolocalimports -importcfg /tmp/go-build234948492/b001/importcfg -pack -o .test -trimpath ux_amd64/compile -p /v1/fake imerchan=1,gotestjsonbuildtext=1-stringintconv ux_amd64/compile(dns block)/tmp/go-build1794031033/b001/api.test /tmp/go-build1794031033/b001/api.test -test.paniconexit0 -test.gocoverdir=/tmp/go-build1794031033/b001/gocoverdir -test.timeout=10m0s -test.coverprofile=/tmp/go-build1794031033/b001/_cover_.out d/rbac/v1/fake/dINVALID,NEW d/rbac/v1/fake/f-j ux_amd64/compileDROP -p github.com/golan-test.paniconexit0 -lang=go1.17 ux_amd64/compile-test.timeout=10m0s -uns�� 48687320/b612/gocoverdir /tmp/go-build1848687320/b028/vet-nolocalimports -data-downloader -c=4 fake -importcfg -data-downloader(dns block)/tmp/go-build185634227/b659/api.test /tmp/go-build185634227/b659/api.test -test.paniconexit0 -test.gocoverdir=/tmp/go-build185634227/b659/gocoverdir -test.timeout=10m0s -test.coverprofile=/tmp/go-build185634227/b659/_cover_.out 8687320/b527/_pkg_.a -trimpath(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.