testing

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemNamespace = "eventing-test-ns"
	SecretName      = "test-secret-name"

	NewClientId = "TestNewClientId"
	OldUsername = "TestOldUsername"
	NewUsername = "TestNewUsername"
	OldPassword = "TestOldPassword"
	NewPassword = "TestNewPassword"

	ReceiverCpuLimit        = "501m"
	ReceiverCpuRequest      = "301m"
	ReceiverMemoryLimit     = "129Mi"
	ReceiverMemoryRequest   = "51Mi"
	ReceiverReplicas        = "4"
	DispatcherReplicas      = "3"
	DispatcherRetryInitial  = "5000"
	DispatcherRetry         = "500000"
	DispatcherCpuLimit      = "500m"
	DispatcherCpuRequest    = "300m"
	DispatcherMemoryLimit   = "128Mi"
	DispatcherMemoryRequest = "50Mi"
	BrokerString            = "test-broker-string"

	TestEKConfig = `
receiver:
  cpuRequest: ` + ReceiverCpuRequest + `
  memoryRequest: ` + ReceiverMemoryRequest + `
  cpuLimit: ` + ReceiverCpuLimit + `
  memoryLimit: ` + ReceiverMemoryLimit + `
  replicas: ` + ReceiverReplicas + `
dispatcher:
  cpuRequest: ` + DispatcherCpuRequest + `
  memoryRequest: ` + DispatcherMemoryRequest + `
  cpuLimit: ` + DispatcherCpuLimit + `
  memoryLimit: ` + DispatcherMemoryLimit + `
  replicas: ` + DispatcherReplicas + `
  retryInitialIntervalMillis: ` + DispatcherRetryInitial + `
  retryTimeMillis: ` + DispatcherRetry + `
  retryExponentialBackoff: true
kafka:
  brokers: ` + BrokerString + `
  enableSaramaLogging: false
  topic:
    defaultNumPartitions: 4
    defaultReplicationFactor: 1 # Cannot exceed the number of Kafka Brokers!
    defaultRetentionMillis: 604800000  # 1 week
  adminType: kafka # One of "kafka", "azure", "custom"
`

	OldSaramaConfig = `
Net:
  TLS:
    Enable: true
  SASL:
    Enable: true
    Mechanism: PLAIN
    Version: 1
    User: ` + OldUsername + `
    Password: ` + OldPassword + `
Metadata:
  RefreshFrequency: 300000000000
`

	NewSaramaConfig = `
Version: 2.3.0
Net:
  TLS:
    Enable: true
  SASL:
    Enable: true
    Mechanism: PLAIN
    Version: 1
    User: ` + NewUsername + `
    Password: ` + NewPassword + `
Metadata:
  RefreshFrequency: 300000000000
ClientID: ` + NewClientId + `
`

	OldAuthNamespace = "TestOldNamespace"
	OldAuthPassword  = "TestOldPassword"
	OldAuthSaslType  = "TestOldAuthSaslType"
	OldAuthUsername  = "TestOldAuthUsername"

	NewAuthNamespace = "TestNewNamespace"
	NewAuthPassword  = "TestNewPassword"
	NewAuthSaslType  = "TestNewAuthSaslType"
	NewAuthUsername  = "TestNewAuthUsername"
)

Variables

This section is empty.

Functions

func GetTestSaramaConfigMap

func GetTestSaramaConfigMap(saramaConfig string, configuration string) *corev1.ConfigMap

Returns A ConfigMap Containing The Desired Sarama Config YAML

func GetTestSaramaConfigMapNamespaced

func GetTestSaramaConfigMapNamespaced(name, namespace, saramaConfig, configuration string) *corev1.ConfigMap

Returns A ConfigMap Containing The Desired Sarama Config YAML, Name And Namespace

func GetTestSaramaSecret

func GetTestSaramaSecret(name string, username string, password string, namespace string, saslType string) *corev1.Secret

Returns A Secret Containing The Desired Fields

func SetTestEnvironment

func SetTestEnvironment(t *testing.T)

Sets the environment variables that are necessary for common components

Types

This section is empty.

Jump to

Keyboard shortcuts

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