diff --git a/pkg/cmd/roachtest/roachtestflags/flags.go b/pkg/cmd/roachtest/roachtestflags/flags.go index 5761e7dc5102..5b6d65e1191f 100644 --- a/pkg/cmd/roachtest/roachtestflags/flags.go +++ b/pkg/cmd/roachtest/roachtestflags/flags.go @@ -365,7 +365,7 @@ var ( List of =. If a certain version is present in the list, the respective binary will be used when a mixed-version test asks for the respective binary, instead of roachprod - stage . Example: 20.1.4=cockroach-20.1,20.2.0=cockroach-20.2.`, + stage . Example: v20.1.4=cockroach-20.1,v20.2.0=cockroach-20.2.`, }) SlackToken string diff --git a/pkg/cmd/roachtest/run.go b/pkg/cmd/roachtest/run.go index 5f1e95592aa4..aaa1bfb840c5 100644 --- a/pkg/cmd/roachtest/run.go +++ b/pkg/cmd/roachtest/run.go @@ -36,6 +36,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/log/logpb" "github.com/cockroachdb/cockroach/pkg/util/stop" "github.com/cockroachdb/cockroach/pkg/util/timeutil" + "github.com/cockroachdb/cockroach/pkg/util/version" "github.com/cockroachdb/errors" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" @@ -304,6 +305,12 @@ func initRunFlagsBinariesAndLibraries(cmd *cobra.Command) error { if roachtestflags.SelectProbability > 0 && roachtestflags.SelectProbability < 1 { fmt.Printf("Matching tests will be selected with probability %.2f\n", roachtestflags.SelectProbability) } + + for override := range roachtestflags.VersionsBinaryOverride { + if _, err := version.Parse(override); err != nil { + return errors.Wrapf(err, "binary version override %s is not a valid version", override) + } + } return nil }