From c1b99e3ec9ecdd90fe65e2ffddc275b7c8fa553e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Oct 2025 22:27:34 +0000 Subject: [PATCH] fix: correct binary path in e2e tests to use bin directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated e2e test to look for binary in bin/netkit instead of root - Added bin directory creation in e2e test build fallback - Fixed misleading comment in GitHub Actions workflow (fetchr -> netkit) This ensures consistency with the Makefile build target which places the binary in bin/netkit, resolving CI failures where the binary couldn't be found in the expected location. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/e2e.yml | 2 +- test/e2e/e2e_test.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 074ab17..2b2697f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -38,7 +38,7 @@ jobs: - name: Download Go modules run: go mod download - - name: Build fetchr binary + - name: Build netkit binary run: make build - name: Run Go end-to-end tests diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 71e1d96..41fe516 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -157,13 +157,18 @@ type netkitCmd struct { // startProxyServer starts the netkit proxy server with the given arguments func startProxyServer(t *testing.T, args ...string) *netkitCmd { - // Build binary path - we assume the binary is in the root directory - binaryPath := filepath.Join("..", "..", "netkit") + // Build binary path - we assume the binary is in the bin directory + binaryPath := filepath.Join("..", "..", "bin", "netkit") // Check if binary exists if _, err := os.Stat(binaryPath); os.IsNotExist(err) { // Try to build it t.Log("Netkit binary not found, building it") + // Ensure bin directory exists + binDir := filepath.Join("..", "..", "bin") + if err := os.MkdirAll(binDir, 0755); err != nil { + t.Fatalf("Failed to create bin directory: %v", err) + } buildCmd := exec.Command("go", "build", "-o", binaryPath, "../../cmd/netkit") if err := buildCmd.Run(); err != nil { t.Fatalf("Failed to build netkit binary: %v", err)