Skip to content

Commit

Permalink
Make all e2e tests default to 1:1:1 topology (#2307)
Browse files Browse the repository at this point in the history
This is a temporary fix to avoid overloading the CI system.
It should be removed eventually or added explicitly to all tests.
  • Loading branch information
g-gaston authored Jun 1, 2022
1 parent cbec0ae commit adf3fe1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions internal/pkg/api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ func WithExternalEtcdTopology(count int) ClusterFiller {
}
}

func WithEtcdCountIfExternal(count int) ClusterFiller {
return func(c *anywherev1.Cluster) {
if c.Spec.ExternalEtcdConfiguration != nil {
c.Spec.ExternalEtcdConfiguration.Count = count
}
}
}

func WithExternalEtcdMachineRef(kind string) ClusterFiller {
return func(c *anywherev1.Cluster) {
if c.Spec.ExternalEtcdConfiguration == nil {
Expand Down
9 changes: 8 additions & 1 deletion test/framework/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,14 @@ func (e *ClusterE2ETest) generateClusterConfigObjects(opts ...CommandOpt) {
e.RunEKSA(generateClusterConfigArgs, opts...)

clusterFillersFromProvider := e.Provider.ClusterConfigFillers()
clusterConfigFillers := make([]api.ClusterFiller, 0, len(e.clusterFillers)+len(clusterFillersFromProvider))
clusterConfigFillers := make([]api.ClusterFiller, 0, len(e.clusterFillers)+len(clusterFillersFromProvider)+3)
// This defaults all tests to a 1:1:1 configuration. Since all the fillers defined on each test are run
// after these 3, if the tests is explicit about any of these, the defaults will be overwritten
// (@g-gaston) This is a temporary fix to avoid overloading the CI system and we should remove it once we
// stabilize the test runs
clusterConfigFillers = append(clusterConfigFillers,
api.WithControlPlaneCount(1), api.WithWorkerNodeCount(1), api.WithEtcdCountIfExternal(1),
)
clusterConfigFillers = append(clusterConfigFillers, e.clusterFillers...)
clusterConfigFillers = append(clusterConfigFillers, clusterFillersFromProvider...)
e.ClusterConfigB = e.customizeClusterConfig(e.ClusterConfigLocation, clusterConfigFillers...)
Expand Down

0 comments on commit adf3fe1

Please sign in to comment.