testutil

package
v0.0.0-...-69a3ef4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSRole

func AWSRole() string

AWSRole returns the AWS IAM role from the environment variable.

func CheckAWSEnvVarsForECS

func CheckAWSEnvVarsForECS(t *testing.T)

CheckAWSEnvVarsForECS checks that the required environment variables are defined for testing against AWS ECS.

func CheckAWSEnvVarsForECSAndSecretsManager

func CheckAWSEnvVarsForECSAndSecretsManager(t *testing.T)

CheckAWSEnvVarsForECSAndSecretsManager checks that the required environment variables are defined for testing against both AWS ECS and Secrets Manager.

func CheckAWSEnvVarsForSecretsManager

func CheckAWSEnvVarsForSecretsManager(t *testing.T)

CheckAWSEnvVarsForSecretsManager checks that the required environment variables are defined for testing against AWS Secrets Manager.

func CheckEnvVars

func CheckEnvVars(t *testing.T, envVars ...string)

CheckEnvVars checks that the required environment variables are set.

func CleanupSecrets

func CleanupSecrets(ctx context.Context, t *testing.T, c cocoa.SecretsManagerClient)

CleanupSecrets cleans up all existing secrets used in a test.

func CleanupTaskDefinitions

func CleanupTaskDefinitions(ctx context.Context, t *testing.T, c cocoa.ECSClient)

CleanupTaskDefinitions cleans up all existing task definitions used in a test.

func CleanupTasks

func CleanupTasks(ctx context.Context, t *testing.T, c cocoa.ECSClient)

CleanupTasks cleans up all tasks used in the Cocoa cluster.

func CreateSecret

CreateSecret is a convenience function for creating a Secrets Manager secret and verifying that the result is successful and populates the secret ARN.

func ECSCapacityProvider

func ECSCapacityProvider() string

ECSCapacityProvider returns the ECS capacity provider from the environment variable.

func ECSClusterName

func ECSClusterName() string

ECSClusterName returns the ECS cluster name from the environment variable.

func ECSExecutionRole

func ECSExecutionRole() string

ECSExecutionRole returns the ECS execution role from the environment variable.

func ECSTaskRole

func ECSTaskRole() string

ECSTaskRole returns the ECS task role from the environment variable.

func NewSecretName

func NewSecretName(t *testing.T) string

NewSecretName creates a new test secret name with a common prefix, the given test's name, and a random string.

func NewTaskDefinitionFamily

func NewTaskDefinitionFamily(t *testing.T) string

NewTaskDefinitionFamily makes a new test family for a task definition with a common prefix, the given name, and a random string.

func RegisterTaskDefinition

RegisterTaskDefinition is a convenience function for registering an ECS task definition and verifying that the result is successful and populates the task definition ARN.

func SecretPrefix

func SecretPrefix() string

SecretPrefix returns the prefix name for secrets from the environment variable.

func TaskDefinitionPrefix

func TaskDefinitionPrefix() string

TaskDefinitionPrefix returns the prefix name for task definitions from the environment variable.

func ValidIntegrationAWSOptions

func ValidIntegrationAWSOptions(ctx context.Context, hc *http.Client) awsutil.ClientOptions

ValidIntegrationAWSOptions returns valid options to create an AWS client that can make actual requests to AWS for integration testing. Credentials and the region will be extracted from the standard environment variables.

func ValidNonIntegrationAWSOptions

func ValidNonIntegrationAWSOptions() awsutil.ClientOptions

ValidNonIntegrationAWSOptions returns valid options to create an AWS client that doesn't make any actual requests to AWS.

func ValidRegisterTaskDefinitionInput

func ValidRegisterTaskDefinitionInput(t *testing.T) ecs.RegisterTaskDefinitionInput

ValidRegisterTaskDefinitionInput returns a valid set of options for registering an ECS task definition.

Types

type NoopECSPodDefinitionCache

type NoopECSPodDefinitionCache struct {
	Tag string
}

NoopECSPodDefinitionCache is an implementation of cocoa.ECSPodDefinitionCache that no-ops for all cache modification operations.

func (*NoopECSPodDefinitionCache) Delete

Delete is a no-op.

func (*NoopECSPodDefinitionCache) GetTag

func (c *NoopECSPodDefinitionCache) GetTag() string

GetTag returns the cache tag field.

func (*NoopECSPodDefinitionCache) Put

Put is a no-op.

type NoopSecretCache

type NoopSecretCache struct {
	Tag string
}

NoopSecretCache is an implementation of cocoa.SecretCache that no-ops for all cache modification operations.

func (*NoopSecretCache) Delete

Delete is a no-op.

func (*NoopSecretCache) GetTag

func (c *NoopSecretCache) GetTag() string

GetTag returns the cache tag field.

func (*NoopSecretCache) Put

Put is a no-op.

Jump to

Keyboard shortcuts

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