Documentation ¶
Overview ¶
Package clustergentest contains test helpers to test cluster generators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultTLS ¶
CreateDefaultTLS is a helper function to create TLS config with default production settings.
Types ¶
type FactoryErrorOPTestCase ¶
type FactoryErrorOPTestCase struct { Desc string ServiceConfigIn *servicepb.Service // OptsIn is the input ESPv2 Options. // Will be merged with defaults. OptsIn options.ConfigGeneratorOptions // WantFactoryError is the error that occurs when `NewXYZClusterFromOPConfig()` // is called. WantFactoryError string }
FactoryErrorOPTestCase is the shared struct to test a ClusterGenerator with One Platform config. It checks that the factory returns an error.
func (*FactoryErrorOPTestCase) RunTest ¶
func (tc *FactoryErrorOPTestCase) RunTest(t *testing.T, factory clustergen.ClusterGeneratorOPFactory)
RunTest is a test helper to run the test.
type SuccessOPTestCase ¶
type SuccessOPTestCase struct { Desc string ServiceConfigIn *servicepb.Service // OptsIn is the input ESPv2 Options. // Will be merged with defaults. OptsIn options.ConfigGeneratorOptions // WantClusters is the expected output. WantClusters []*clusterpb.Cluster }
SuccessOPTestCase is the shared struct to test a ClusterGenerator with One Platform config. It checks the factory and generator both succeed.
func (*SuccessOPTestCase) RunTest ¶
func (tc *SuccessOPTestCase) RunTest(t *testing.T, factory clustergen.ClusterGeneratorOPFactory)
RunTest is a test helper to run the test.
Click to show internal directories.
Click to hide internal directories.