Skip to content

Commit 95ac501

Browse files
committed
testing: use env var for configuring debugaddress for tests
Unix socket support for --debugaddr was added later what means the test suite can not be used to test old versions of releases anymore. This makes debug address configurable via env variable so that old versions can just ignore it without crashing. Signed-off-by: Tonis Tiigi <[email protected]>
1 parent dd06922 commit 95ac501

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cmd/buildkitd/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ func main() {
193193
Value: groupValue(defaultConf.GRPC.GID),
194194
},
195195
cli.StringFlag{
196-
Name: "debugaddr",
197-
Usage: "debugging address (eg. 0.0.0.0:6060)",
198-
Value: defaultConf.GRPC.DebugAddress,
196+
Name: "debugaddr",
197+
Usage: "debugging address (eg. 0.0.0.0:6060)",
198+
Value: defaultConf.GRPC.DebugAddress,
199+
EnvVar: "BUILDKITD_DEBUGADDR",
199200
},
200201
cli.StringFlag{
201202
Name: "tlscert",

util/testutil/workers/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ func runBuildkitd(
7373
address := getBuildkitdAddr(tmpdir)
7474
debugAddress := getBuildkitdDebugAddr(tmpdir)
7575

76-
args = append(args, "--root", tmpdir, "--addr", address, "--debugaddr", debugAddress, "--debug")
76+
args = append(args, "--root", tmpdir, "--addr", address, "--debug")
7777
cmd := exec.Command(args[0], args[1:]...) //nolint:gosec // test utility
7878
cmd.Env = append(
7979
os.Environ(),
8080
"BUILDKIT_DEBUG_EXEC_OUTPUT=1",
8181
"BUILDKIT_DEBUG_PANIC_ON_ERROR=1",
82+
"BUILDKITD_DEBUGADDR="+debugAddress,
8283
"TMPDIR="+filepath.Join(tmpdir, "tmp"))
8384
if v := os.Getenv("GO_TEST_COVERPROFILE"); v != "" {
8485
coverDir := filepath.Join(filepath.Dir(v), "helpers")

0 commit comments

Comments
 (0)