From 04dca5dada8c2d971ff3b54eeedc5ab6e53a29ac Mon Sep 17 00:00:00 2001 From: James O'Doherty Date: Thu, 4 Jun 2026 22:57:35 -0400 Subject: refactor: decouple namespace operations and improve test coverage - Introduce `namespace.Ops` interface to decouple `Manager` from system-level namespace operations, enabling easier unit testing via mocks. - Add unit tests for `internal/paths` to verify path resolution logic across different environment configurations. - Implement `EnsureBinary` helper in E2E tests to gracefully skip tests when `WG_WRAP_BIN` is not set, allowing `go test ./...` to pass in non-build environments. - Apply project-wide formatting and fix linting issues. --- tests/e2e/arg_integrity_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests/e2e/arg_integrity_test.go') diff --git a/tests/e2e/arg_integrity_test.go b/tests/e2e/arg_integrity_test.go index 497a51d..daace7e 100644 --- a/tests/e2e/arg_integrity_test.go +++ b/tests/e2e/arg_integrity_test.go @@ -20,10 +20,7 @@ func TestArgumentIntegrity(t *testing.T) { for _, payload := range payloads { t.Run(fmt.Sprintf("Payload_%s", payload), func(t *testing.T) { - binaryPath, err := GetBinaryPath() - if err != nil { - t.Skip("Skipping E2E test: wg-wrap binary not found (WG_WRAP_BIN not set)") - } + binaryPath := EnsureBinary(t) cmd := exec.Command(binaryPath, "test-args", payload) out, err := cmd.CombinedOutput() if err != nil { -- cgit v1.2.3