Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test(e2e-runner): pin that the repo's own .dockerignore keeps .tools/, dist/ and pinchtab-dev out of the build context

Luigi Agosti2b57a081ea83
diff --git a/tests/tools/runner/internal/e2e/dockerignore_repo_test.go b/tests/tools/runner/internal/e2e/dockerignore_repo_test.go
new file mode 100644
index 00000000..97691bc8
--- /dev/null
+++ b/tests/tools/runner/internal/e2e/dockerignore_repo_test.go
@@ -0,0 +1,40 @@
+package e2e
+
+import (
+ "bufio"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+)
+
+func TestTheRepoDockerignoreKeepsLocalToolchainsAndBuildOutputsOutOfTheContext(t *testing.T) {
+ path := filepath.Join("..", "..", "..", "..", "..", dockerIgnoreFile)
+
+ excluded, err := contextExcludedDirs(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, dir := range []string{".tools", "dist"} {
+ if !excluded[dir] {
+ t.Errorf("%s does not exclude %s/; the build context ships it and the smoke-image digest follows its contents", path, dir)
+ }
+ }
+
+ file, err := os.Open(path) // #nosec G304 -- the repo's own .dockerignore
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer func() { _ = file.Close() }()
+ entries := map[string]bool{}
+ scanner := bufio.NewScanner(file)
+ for scanner.Scan() {
+ entries[strings.TrimSpace(scanner.Text())] = true
+ }
+ if err := scanner.Err(); err != nil {
+ t.Fatal(err)
+ }
+ if !entries["pinchtab-dev"] {
+ t.Errorf("%s does not exclude the pinchtab-dev binary", path)
+ }
+}