Skip to content

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

fix: name the e2e server log level explicitly instead of borrowing --verbose (PIN-101)

Luigi Agostie5950cdc739b
diff --git a/tests/e2e/docker-compose-multi.yml b/tests/e2e/docker-compose-multi.yml
index 1ca98954..4f83520e 100644
--- a/tests/e2e/docker-compose-multi.yml
+++ b/tests/e2e/docker-compose-multi.yml
@@ -1,3 +1,18 @@
+# Log level for every `pinchtab server` service below: `--log-level debug`, named
+# here rather than inherited. A harness whose logs exist to explain a failing
+# scenario wants maximum detail, and log volume is cheap in a CI artifact. The
+# level is stated in this file because the previous spelling borrowed `--verbose`,
+# whose meaning changed elsewhere (it once meant "log at all", then came to mean
+# "debug"), and the level silently moved with it. `--log-level` wins over any
+# config file, so nothing under tests/e2e/config/ can override it.
+#
+# `--verbose` is kept alongside, and it no longer touches the level: it only adds
+# the startup banner, which is the sole place the log states the guard posture and
+# the allowed-domain list — the fact that explains a scenario failing on a blocked
+# fixture host. The two flags are orthogonal; dropping one does not move the other.
+#
+# The `pinchtab bridge` services take neither flag deliberately: bridge mode never
+# had the discard-logger behaviour these flags were originally added to work around.
x-pinchtab-base: &pinchtab-base
# All pinchtab variants share the same image — only the pinchtab service
# carries `build:` so compose builds it once. The 6 variants differ only
@@ -25,7 +40,7 @@ services:
- ./config/pinchtab.json:/fixture-config/pinchtab.json:ro
- ./fixtures/test-extension:/extensions/test-extension
- ./fixtures/test-extension-api:/extensions/test-extension-api
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab.json /data/e2e-config/pinchtab.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab.json /data/e2e-config/pinchtab.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9999:9999"
healthcheck: *pinchtab-healthcheck
@@ -36,7 +51,7 @@ services:
PINCHTAB_CONFIG: /data/e2e-config/pinchtab-secure.json
volumes:
- ./config/pinchtab-secure.json:/fixture-config/pinchtab-secure.json:ro
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-secure.json /data/e2e-config/pinchtab-secure.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-secure.json /data/e2e-config/pinchtab-secure.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9998:9999"
healthcheck: *pinchtab-healthcheck
@@ -48,7 +63,7 @@ services:
volumes:
- ./config/pinchtab-autoclose.json:/fixture-config/pinchtab-autoclose.json:ro
- ./fixtures/test-extension:/extensions/test-extension
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-autoclose.json /data/e2e-config/pinchtab-autoclose.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-autoclose.json /data/e2e-config/pinchtab-autoclose.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
healthcheck: *pinchtab-healthcheck
pinchtab-medium:
@@ -58,7 +73,7 @@ services:
volumes:
- ./config/pinchtab-medium-permissive.json:/fixture-config/pinchtab-medium-permissive.json:ro
- ./fixtures/test-extension:/extensions/test-extension
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-medium-permissive.json /data/e2e-config/pinchtab-medium-permissive.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-medium-permissive.json /data/e2e-config/pinchtab-medium-permissive.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9994:9999"
healthcheck: *pinchtab-healthcheck
@@ -70,7 +85,7 @@ services:
volumes:
- ./config/pinchtab-full-permissive.json:/fixture-config/pinchtab-full-permissive.json:ro
- ./fixtures/test-extension:/extensions/test-extension
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-full-permissive.json /data/e2e-config/pinchtab-full-permissive.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-full-permissive.json /data/e2e-config/pinchtab-full-permissive.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9995:9999"
healthcheck: *pinchtab-healthcheck
@@ -82,7 +97,7 @@ services:
volumes:
- ./config/pinchtab-network-retain-bodies.json:/fixture-config/pinchtab-network-retain-bodies.json:ro
- ./fixtures/test-extension:/extensions/test-extension
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-network-retain-bodies.json /data/e2e-config/pinchtab-network-retain-bodies.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab-network-retain-bodies.json /data/e2e-config/pinchtab-network-retain-bodies.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9993:9999"
healthcheck: *pinchtab-healthcheck
diff --git a/tests/e2e/docker-compose.yml b/tests/e2e/docker-compose.yml
index 050881b4..d5834372 100644
--- a/tests/e2e/docker-compose.yml
+++ b/tests/e2e/docker-compose.yml
@@ -1,3 +1,18 @@
+# Log level for every `pinchtab server` service below: `--log-level debug`, named
+# here rather than inherited. A harness whose logs exist to explain a failing
+# scenario wants maximum detail, and log volume is cheap in a CI artifact. The
+# level is stated in this file because the previous spelling borrowed `--verbose`,
+# whose meaning changed elsewhere (it once meant "log at all", then came to mean
+# "debug"), and the level silently moved with it. `--log-level` wins over any
+# config file, so nothing under tests/e2e/config/ can override it.
+#
+# `--verbose` is kept alongside, and it no longer touches the level: it only adds
+# the startup banner, which is the sole place the log states the guard posture and
+# the allowed-domain list — the fact that explains a scenario failing on a blocked
+# fixture host. The two flags are orthogonal; dropping one does not move the other.
+#
+# The `pinchtab bridge` services take neither flag deliberately: bridge mode never
+# had the discard-logger behaviour these flags were originally added to work around.
services:
pinchtab:
build:
@@ -9,7 +24,7 @@ services:
- ./config/pinchtab.json:/fixture-config/pinchtab.json:ro
- ./fixtures/test-extension:/extensions/test-extension:ro
- ./fixtures/test-extension-api:/extensions/test-extension-api:ro
- command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab.json /data/e2e-config/pinchtab.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --verbose"]
+ command: ["/bin/sh", "-lc", "mkdir -p /data/e2e-config && cp /fixture-config/pinchtab.json /data/e2e-config/pinchtab.json && exec /usr/local/bin/docker-entrypoint.sh pinchtab server --log-level debug --verbose"]
ports:
- "127.0.0.1:9999:9999"
shm_size: '2gb'
diff --git a/tests/tools/runner/internal/e2e/e2e_test.go b/tests/tools/runner/internal/e2e/e2e_test.go
index a020038c..69df3e5e 100644
--- a/tests/tools/runner/internal/e2e/e2e_test.go
+++ b/tests/tools/runner/internal/e2e/e2e_test.go
@@ -1061,30 +1061,45 @@ func TestEmptyLogSuffixMarksZeroByteArtifacts(t *testing.T) {
}
}
-// The e2e services must run the server verbosely: RunDashboard swaps the default
-// logger for a discard handler otherwise, so the harness captures zero bytes for
-// exactly the failure the artifact exists to explain. Bridge mode has no such
-// swap and is deliberately left alone.
-func TestComposeServerServicesRunVerbose(t *testing.T) {
+// Every e2e server service must NAME its log level rather than inherit one. The
+// level used to be borrowed from --verbose, which once meant "log at all" and later
+// came to mean "debug"; the harness's diagnostic level moved when that definition
+// moved, which is the drift this pins. --verbose is still expected alongside, for
+// the startup banner alone — it is the only place the log states the guard posture
+// and the allowed-domain list. Bridge services take neither flag deliberately.
+func TestComposeServerServicesNameTheirLogLevel(t *testing.T) {
+ const wantFlags = "pinchtab server --log-level debug --verbose"
+
for _, file := range []string{"docker-compose.yml", "docker-compose-multi.yml"} {
path := filepath.Join("..", "..", "..", "..", "e2e", file)
content, err := os.ReadFile(path) // #nosec G304 -- fixed test fixture path.
if err != nil {
t.Fatalf("read %s: %v", file, err)
}
+ body := string(content)
- servers := strings.Count(string(content), "pinchtab server")
- verbose := strings.Count(string(content), "pinchtab server --verbose")
+ servers := 0
+ for _, line := range strings.Split(body, "\n") {
+ if !strings.Contains(line, "command:") || !strings.Contains(line, "pinchtab server") {
+ continue
+ }
+ servers++
+ if !strings.Contains(line, wantFlags) {
+ t.Errorf("%s: a server service does not run %q, so its level is inherited rather than named: %s", file, wantFlags, strings.TrimSpace(line))
+ }
+ }
if servers == 0 {
t.Fatalf("%s: found no pinchtab server services to check", file)
}
- if verbose != servers {
- t.Errorf("%s: %d of %d server services run verbose; the rest capture an empty log", file, verbose, servers)
- }
- for _, line := range strings.Split(string(content), "\n") {
- if strings.Contains(line, "pinchtab bridge") && strings.Contains(line, "--verbose") {
- t.Errorf("%s: bridge service gained --verbose; bridge mode already logs: %s", file, strings.TrimSpace(line))
+ for _, line := range strings.Split(body, "\n") {
+ if !strings.Contains(line, "command:") || !strings.Contains(line, "pinchtab bridge") {
+ continue
+ }
+ for _, flag := range []string{"--verbose", "--log-level"} {
+ if strings.Contains(line, flag) {
+ t.Errorf("%s: bridge service gained %s; bridge mode never had the discard behaviour these flags worked around: %s", file, flag, strings.TrimSpace(line))
+ }
}
}
}
diff --git a/tests/tools/runner/internal/e2e/suite.go b/tests/tools/runner/internal/e2e/suite.go
index 92a7649b..794cceb6 100644
--- a/tests/tools/runner/internal/e2e/suite.go
+++ b/tests/tools/runner/internal/e2e/suite.go
@@ -758,13 +758,15 @@ func formatDuration(d time.Duration) string {
// emptyLogSuffix marks a log artifact that has nothing in it. An empty file
// listed as `logs:` is worse than no listing at all — it sends whoever is
// diagnosing a failure to a file that cannot explain it — so say so on the line
-// that advertises it.
+// that advertises it. The named causes have to be ones that can still happen: a
+// server discarding its logs was the original suspect and is no longer possible,
+// so pointing at it would send a maintainer after a removed cause.
func emptyLogSuffix(path string) string {
info, err := os.Stat(path)
if err != nil || info.Size() > 0 {
return ""
}
- return " (EMPTY — captured nothing; the service may be discarding its logs)"
+ return " (EMPTY — captured nothing; the service may never have started, or its --log-level excludes everything it logged)"
}
func fileExists(path string) bool {