Documentation ¶
Index ¶
- Constants
- func ExposeIngress(t *testing.T, ctx context.Context, client *k8s.Clientset, config *rest.Config, ...)
- func ExposePod(t *testing.T, ctx context.Context, client *k8s.Clientset, config *rest.Config, ...)
- func GenerateS3BucketName() string
- func GetAWSAccountId() string
- func GetAWSRegion() string
- func GetBicepRecipeRegistry() string
- func GetBicepRecipeVersion() string
- func GetCreationTimestamp() string
- func GetGitPAT() string
- func GetHTTPProxyList(ctx context.Context, client runtime_client.Client, ...) (*contourv1.HTTPProxyList, error)
- func GetMagpieImage() string
- func GetMagpieTag() string
- func GetOIDCIssuer() string
- func GetTerraformPrivateModuleSource() string
- func GetTerraformRecipeModuleServerURL() string
- func IsMapNonIntersecting(notExpectedMap map[string]string, actualMap map[string]string) bool
- func IsMapSubSet(expectedMap map[string]string, actualMap map[string]string) bool
- func MustGetTestData[T any](file string) *T
- func MustUnmarshalFromFile(file string, out any)
- func ReadFixture(filename string) []byte
- func SetDefault() (string, string)
- func WriteBicepParameterFile(t *testing.T, data map[string]any) string
- type ProxyMetadata
- type TestWriter
Constants ¶
const (
RadiusSystemNamespace = "radius-system"
)
Variables ¶
This section is empty.
Functions ¶
func ExposeIngress ¶ added in v0.32.0
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 ¶ added in v0.32.0
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.32.0
func GenerateS3BucketName() string
GenerateS3BucketName generates a unique S3 bucket name.
func GetAWSAccountId ¶ added in v0.32.0
func GetAWSAccountId() string
GetAWSAccountId retrieves the AWS Account ID from the environment and returns it as a string.
func GetAWSRegion ¶ added in v0.32.0
func GetAWSRegion() string
GetAWSRegion returns the AWS region from the environment variable "AWS_REGION".
func GetBicepRecipeRegistry ¶ added in v0.32.0
func GetBicepRecipeRegistry() string
GetBicepRecipeRegistry returns the default recipe registry if one is not set in the environment.
func GetBicepRecipeVersion ¶ added in v0.32.0
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.32.0
func GetCreationTimestamp() string
GetCreationTimestamp returns the elapsed time since the Unix epoch in seconds.
func GetGitPAT ¶ added in v0.33.0
func GetGitPAT() string
GetGitPAT gets the personal access token for the git account private modules are stored.
func GetHTTPProxyList ¶ added in v0.32.0
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 ¶ added in v0.32.0
func GetMagpieImage() string
GetMagpieImage creates a string with the default Docker registry and image tag for MagpieGo.
func GetMagpieTag ¶ added in v0.32.0
func GetMagpieTag() string
GetMagpieTag sets a default image tag and returns a string with the format "magpietag=<imageTag>"
func GetOIDCIssuer ¶ added in v0.32.0
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 GetTerraformPrivateModuleSource ¶ added in v0.33.0
func GetTerraformPrivateModuleSource() string
GetTerraformPrivateModuleSource gets the terraform private git module source to use in tests from the environment variable TF_RECIPE_PRIVATE_GIT_SOURCE.
func GetTerraformRecipeModuleServerURL ¶ added in v0.32.0
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 ¶ added in v0.32.0
IsMapNonIntersecting returns true if the notExpectedMap and actualMap do not have any keys in common
func IsMapSubSet ¶ added in v0.32.0
IsMapSubSet returns true if the expectedMap is a subset of the actualMap
func MustGetTestData ¶
MustGetTestData reads testdata and unmarshals it to the given type, panicking if an error occurs.
func MustUnmarshalFromFile ¶ added in v0.30.0
MustUnmarshalFromFile reads testdata and unmarshals it to the given type, panicking if an error occurs.
func ReadFixture ¶
ReadFixture reads testdata fixtures, panicking if an error occurs.
The prefix `./testdata/` is automatically added to the filename. Tests can 'escape' the testdata directory by prefixing the filename with `../`.
Example:
ReadFixture("foo.json") -> ./testdata/foo.json
func SetDefault ¶ added in v0.32.0
SetDefault sets the default Docker registry and image tag if they are not already set in the environment.
Types ¶
type ProxyMetadata ¶ added in v0.32.0
func GetHTTPProxyMetadata ¶ added in v0.32.0
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 ¶ added in v0.32.0
type TestWriter struct {
// contains filtered or unexported fields
}