Skip to content

test: coverage backfill for v0.38.0 features#399

Merged
spboyer merged 2 commits into
mainfrom
spboyer-test-coverage-audit-v0-38
Jun 30, 2026
Merged

test: coverage backfill for v0.38.0 features#399
spboyer merged 2 commits into
mainfrom
spboyer-test-coverage-audit-v0-38

Conversation

@spboyer

@spboyer spboyer commented Jun 30, 2026

Copy link
Copy Markdown
Member

Audits and backfills test coverage ahead of v0.38.0. Tests only; no production code changed.

Coverage delta

Package Before After
internal/copilotevents 0.0% 100.0%
internal/telemetry 64.3% 93.6%
internal/mcpmock 67.3% 93.3%
internal/snapshot 62.1% 82.8%
internal/adversarial 67.2% 73.1%
internal/graders/argmatcher 66.2% 88.4%

Overall: 77.5% → 79.2%

Out of scope (intentionally skipped)

Verification

  • go build ./...
  • go vet ./...
  • gofmt -l . empty ✓
  • golangci-lint run 0 issues ✓
  • go test ./... -race -count=1 all pass ✓

Adds focused tests to bring six packages above the 70% bar ahead of the
v0.38.0 release:

- internal/copilotevents      0.0% -> 100.0%
- internal/telemetry         64.3% ->  93.6%
- internal/mcpmock           67.3% ->  93.3%
- internal/snapshot          62.1% ->  82.8%
- internal/adversarial       67.2% ->  73.1%
- internal/graders/argmatcher 66.2% -> 88.4%

Overall coverage: 77.5% -> 79.2%.

Tests only; no production code changed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backfills and expands unit test coverage for several internal packages ahead of the v0.38.0 release, without changing production behavior. The added tests exercise previously untested branches and error paths across telemetry, snapshotting/redaction, MCP mocking, Copilot event helpers, adversarial pack utilities, and arg matcher marshaling.

Changes:

  • Added new test suites to improve coverage of telemetry provider initialization/exporter variants and nil-safety behavior.
  • Added coverage-focused tests for snapshot policy loading/redaction, compare/bisect divergence reporting, and writer helpers.
  • Expanded tests around MCP mock server request handling and arg matcher JSON/YAML edge cases; added Copilot event accessor/bridge tests.
Show a summary per file
File Description
internal/telemetry/provider_test.go Adds coverage for Provider.New exporter variants, SetGlobal behavior, and nil-safe methods.
internal/snapshot/coverage_test.go Adds broad coverage for snapshot redaction policy load/merge modes, redaction walkers, and compare/bisect divergence reporting.
internal/mcpmock/server_more_test.go Adds tests for MCP mock server request handling, parameter validation, fixture loading, and stdio serving behavior.
internal/graders/argmatcher/coverage_test.go Adds JSON marshal/unmarshal and compilation coverage for all matcher kinds and error cases.
internal/copilotevents/events_test.go Adds tests for event content/message accessors and raw event wrapping behavior.
internal/copilotevents/bridge_test.go Adds tests for SDK↔agent event bridging, including unknown/raw event handling.
internal/adversarial/packs_more_test.go Adds a small test for pack task relative path expansion behavior.

Review details

  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +21 to +25
func TestWriterRoot(t *testing.T) {
require.Equal(t, "", (*Writer)(nil).Root())
w := NewWriter("/tmp/snap")
require.Equal(t, "/tmp/snap", w.Root())
}
Comment on lines +144 to +149
_, span := tr.Start(context.Background(), "noop")
span.End()
// And SetGlobal must not panic.
p.SetGlobal()
_ = noop.NewTracerProvider() // sanity import use
}
Windows holds the file handle open briefly after stdouttrace shuts down,
which causes t.TempDir's RemoveAll to fail. Use a manual MkdirTemp with
best-effort cleanup so the test passes consistently on windows-latest.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@spboyer spboyer merged commit 6157165 into main Jun 30, 2026
10 checks passed
@spboyer spboyer deleted the spboyer-test-coverage-audit-v0-38 branch June 30, 2026 16:00
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.

3 participants