From 12b2274815a637b7d736ca5d460a6bc1575529b1 Mon Sep 17 00:00:00 2001 From: Stan Rosenberg Date: Mon, 23 Dec 2024 22:42:48 -0500 Subject: [PATCH] roachtest: primitive `dry-run` mode for mixedversion tests If `MVT_DRY_RUN_MODE` env. var. is set, print the mixedversion test plan and exit. Epic: none Release note: None --- .../roachtest/roachtestutil/mixedversion/mixedversion.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go b/pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go index a81f7156a1d0..940bbeaf20d6 100644 --- a/pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go +++ b/pkg/cmd/roachtest/roachtestutil/mixedversion/mixedversion.go @@ -151,6 +151,9 @@ const ( // - MVT_UPGRADE_PATH=24.1.5,24.2.0,current // - MVT_UPGRADE_PATH=24.1,24.2,current upgradePathOverrideEnv = "MVT_UPGRADE_PATH" + + // Dump the test plan and return, i.e., skipping the actual execution of the test. + dryRunEnv = "MVT_DRY_RUN" ) var ( @@ -774,6 +777,11 @@ func (t *Test) Run() { t.logger.Printf("mixed-version test:\n%s", plan.PrettyPrint()) + if override := os.Getenv(dryRunEnv); override != "" { + t.logger.Printf("skipping test run in dry-run mode") + return + } + // Mark the deployment mode and versions, so they show up in the github issue. This makes // it easier to group failures together without having to dig into the test logs. t.rt.AddParam("mvtDeploymentMode", string(plan.deploymentMode))