Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
29493: roachtest: add acceptance/cluster-init r=tschottdorf a=petermattis

Move the init-mode acceptance tests to a new acceptance/cluster-init
roachtest. Fixes a TODO about sending the "init" command to nodes other
than node 1. This was previously a limitation due to the --join flag
settings.

Fixes cockroachdb#29489

Release note: None

29576: roachtest: fix acceptance/decommission on remote clusters r=tschottdorf a=petermattis

The test was using the local binary path for running CLI commands, which
works on local clusters but not on remote ones.

Fixes cockroachdb#29570

Release note: None

Co-authored-by: Peter Mattis <petermattis@gmail.com>
  • Loading branch information
craig[bot] and petermattis committed Sep 5, 2018
3 parents b87fec6 + dc18e9b + dc516c0 commit 3e62ce0
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 248 deletions.
189 changes: 0 additions & 189 deletions pkg/acceptance/init_test.go

This file was deleted.

36 changes: 0 additions & 36 deletions pkg/acceptance/util.go

This file was deleted.

24 changes: 3 additions & 21 deletions pkg/acceptance/util_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ import (
"github.com/cockroachdb/cockroach/pkg/acceptance/cluster"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/stop"
"github.com/pkg/errors"
)

const (
dockerTest = "runMode=docker"
)

var stopper = stop.NewStopper()

// RunDocker runs the given acceptance test using a Docker cluster.
func RunDocker(t *testing.T, testee func(t *testing.T)) {
t.Run(dockerTest, testee)
Expand All @@ -43,27 +46,6 @@ func RunDocker(t *testing.T, testee func(t *testing.T)) {
// and we sometimes call RunDocker multiple times in tests.
var reStripTestEnumeration = regexp.MustCompile(`#\d+$`)

// runTestWithCluster runs the passed in test against the configuration
// specified by the flags. If any options are specified, they may mutate the
// test config before it runs.
func runTestWithCluster(
t *testing.T,
testFunc func(context.Context, *testing.T, cluster.Cluster, cluster.TestConfig),
options ...func(*cluster.TestConfig),
) {
cfg := ReadConfigFromFlags()
ctx := context.Background()

for _, opt := range options {
opt(&cfg)
}

cluster := StartCluster(ctx, t, cfg)
log.Infof(ctx, "cluster started successfully")
defer cluster.AssertAndStop(ctx, t)
testFunc(ctx, t, cluster, cfg)
}

// StartCluster starts a cluster from the relevant flags. All test clusters
// should be created through this command since it sets up the logging in a
// unified way.
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func registerAcceptance(r *registry) {
{"build-info", runBuildInfo},
{"cli/node-status", runCLINodeStatus},
{"decommission", runDecommissionAcceptance},
{"cluster-init", runClusterInit},
{"event-log", runEventLog},
{"gossip/peerings", runGossipPeerings},
{"gossip/restart", runGossipRestart},
Expand Down
Loading

0 comments on commit 3e62ce0

Please sign in to comment.