clustergentest

package
v0.0.0-...-32f485c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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

func CreateDefaultTLS(t *testing.T, hostname string, isH2 bool) *corepb.TransportSocket

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

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

RunTest is a test helper to run the test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL