From f6fc5ce8670747cef94fa62813065fb28ca30f75 Mon Sep 17 00:00:00 2001 From: Matthew McNeely Date: Mon, 18 May 2026 17:01:31 -0400 Subject: [PATCH] dgraphtest: add WithStartupArg for arbitrary Alpha flags Adds ClusterConfig.WithStartupArg(arg, value) to pass additional flags to the Alpha startup command. Can be called multiple times to accumulate flags. Intended as an escape hatch for flags not yet modelled as first-class ClusterConfig options. Co-Authored-By: Claude Sonnet 4.6 --- dgraphtest/config.go | 8 ++++++++ dgraphtest/dgraph.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/dgraphtest/config.go b/dgraphtest/config.go index 02c8c8b47b3..34d4be6bd1f 100644 --- a/dgraphtest/config.go +++ b/dgraphtest/config.go @@ -106,6 +106,7 @@ type ClusterConfig struct { lambdaURL string featureFlags []string customPlugins bool + startupArgs []string snapShotAfterEntries uint64 snapshotAfterDuration time.Duration repoDir string @@ -243,6 +244,13 @@ func (cc ClusterConfig) WithGraphqlLambdaURL(url string) ClusterConfig { return cc } +// WithStartupArg appends an extra flag to the Alpha startup command in the form +// --arg=value. It may be called multiple times to accumulate additional flags. +func (cc ClusterConfig) WithStartupArg(arg, value string) ClusterConfig { + cc.startupArgs = append(cc.startupArgs, fmt.Sprintf("--%s=%s", arg, value)) + return cc +} + // WithMcp sets the mcp flag for alpha func (cc ClusterConfig) WithMCP() ClusterConfig { cc.mcp = true diff --git a/dgraphtest/dgraph.go b/dgraphtest/dgraph.go index 9c004ac6895..bb670b91077 100644 --- a/dgraphtest/dgraph.go +++ b/dgraphtest/dgraph.go @@ -304,6 +304,8 @@ func (a *alpha) cmd(c *LocalCluster) []string { acmd = append(acmd, "--mcp") } + acmd = append(acmd, c.conf.startupArgs...) + return acmd }