functional

package
v0.27.0-rc4 Latest Latest
Warning

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

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

README

Documentation

Index

Constants

View Source
const (
	RadiusSystemNamespace = "radius-system"
)

Variables

This section is empty.

Functions

func ExposeIngress

func ExposeIngress(t *testing.T, ctx context.Context, client *k8s.Clientset, config *rest.Config, remotePort int, stopChan chan struct{}, portChan chan int, errorChan chan error)

ExposeIngress creates a port-forward session and sends the (assigned) local port to portChan. It exposes a pod in the RadiusSystemNamespace with the selector "app.kubernetes.io/component=envoy" on the given remotePort and returns the port number and an error if any.

func ExposePod

func ExposePod(t *testing.T, ctx context.Context, client *k8s.Clientset, config *rest.Config, namespace string, selector string, remotePort int, stopChan chan struct{}, portChan chan int, errorChan chan error)

ExposePod creates a port-forward session. It finds a pod matching the given selector, creates an API Server URL, sets up a port-forwarder, and sends the assigned port to the portChan channel.

func GenerateS3BucketName added in v0.26.0

func GenerateS3BucketName() string

GenerateS3BucketName generates a unique S3 bucket name.

func GetAWSAccountId

func GetAWSAccountId() string

GetAWSAccountId retrieves the AWS Account ID from the environment and returns it as a string.

func GetAWSRegion

func GetAWSRegion() string

GetAWSRegion returns the AWS region from the environment variable "AWS_REGION".

func GetBicepRecipeRegistry

func GetBicepRecipeRegistry() string

GetBicepRecipeRegistry returns the default recipe registry if one is not set in the environment.

func GetBicepRecipeVersion

func GetBicepRecipeVersion() string

GetBicepRecipeVersion returns the version of the Bicep recipe to be used, either from the environment variable or the default value "latest".

func GetCreationTimestamp added in v0.26.0

func GetCreationTimestamp() string

GetCreationTimestamp returns the elapsed time since the Unix epoch in seconds.

func GetHTTPProxyList

func GetHTTPProxyList(ctx context.Context, client runtime_client.Client, namespace, application string) (*contourv1.HTTPProxyList, error)

GetHTTPProxyList returns a list of HTTPProxies for the specified application. It returns an error if the list cannot be retrieved.

func GetMagpieImage

func GetMagpieImage() string

GetMagpieImage creates a string with the default Docker registry and image tag for MagpieGo.

func GetMagpieTag

func GetMagpieTag() string

GetMagpieTag sets a default image tag and returns a string with the format "magpietag=<imageTag>"

func GetOIDCIssuer

func GetOIDCIssuer() string

GetOIDCIssuer gets the OIDC Issuer URI from the environment variable FUNCTEST_OIDC_ISSUER or a default value if the environment variable is empty.

func GetTerraformRecipeModuleServerURL

func GetTerraformRecipeModuleServerURL() string

GetTerraformRecipeModuleServerURL gets the terraform module server to use in tests from the environment variable TF_RECIPE_MODULE_SERVER_URL. If the environment variable is not set, it uses the default value for local testing (http://localhost:8999).

The data is returned in bicep parameter format using the parameter name 'moduleServer'. The return value of this function can be used as a parameter to 'rad deploy'.

Example:

moduleServer=http://localhost:8999.

func IsMapNonIntersecting

func IsMapNonIntersecting(notExpectedMap map[string]string, actualMap map[string]string) bool

IsMapNonIntersecting returns true if the notExpectedMap and actualMap do not have any keys in common

func IsMapSubSet

func IsMapSubSet(expectedMap map[string]string, actualMap map[string]string) bool

IsMapSubSet returns true if the expectedMap is a subset of the actualMap

func NewTestLogger

func NewTestLogger(t *testing.T) *log.Logger

NewTestLogger creates a new logger that writes to the testing.T object.

func SetDefault

func SetDefault() (string, string)

SetDefault sets the default Docker registry and image tag if they are not already set in the environment.

func WriteBicepParameterFile

func WriteBicepParameterFile(t *testing.T, data map[string]any) string

WriteBicepParameterFile writes a Bicep parameter file to a temporary file and returns the path to the file. The temporary file will be removed when the test finishes.

Types

type ProxyMetadata

type ProxyMetadata struct {
	Hostname string
	Status   string
}

func GetHTTPProxyMetadata

func GetHTTPProxyMetadata(ctx context.Context, client runtime_client.Client, namespace, application string) (*ProxyMetadata, error)

GetHTTPProxyMetadata finds the fqdn set on the root HTTPProxy of the specified application and the current status (e.g. "Valid", "Invalid"). It returns an error if the root proxy is not found.

type TestWriter

type TestWriter struct {
	// contains filtered or unexported fields
}

func (TestWriter) Write

func (tw TestWriter) Write(p []byte) (n int, err error)

TestWriter.Write writes the given byte slice to the test log.

Directories

Path Synopsis
daprrp

Jump to

Keyboard shortcuts

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