test/

directory
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0

README

Integration Tests

Tests that need a Kubernetes cluster with Steward installed.

Preparation

Prepare Test Client
STEWARD_TEST_CLIENT=$(kubectl apply -f test-client.yaml -o=name) && \
    export STEWARD_TEST_CLIENT="${STEWARD_TEST_CLIENT#*/}"
Prepare Test Tenant

This setup is optional. If no test tenant is created it will be created automatically by the test and cleaned up after the test completed.

If you want to keep the tenant after the test prepare one manually and clean it up manually after the tests.

TENANT_NAME=$(kubectl -n $STEWARD_TEST_CLIENT create -f test-tenant.yaml -o=name) && \
    export TENANT_NAME=${TENANT_NAME#*/}
# wait until tenant namespace is created
export STEWARD_TEST_TENANT=$(kubectl -n "$STEWARD_TEST_CLIENT" get tenants.steward.sap.com "${TENANT_NAME}" -o=jsonpath='{.status.tenantNamespaceName}')
echo "$STEWARD_TEST_TENANT"
Running Framework Tests

Framework tests test the test framework itself.

Running the test framework tests:

( cd framework && go test ./... -count=1 -tags=frameworktest -v -- --kubeconfig "$KUBECONFIG" )

Running Tests

Integration Tests
( cd integrationtest && go test ./... -count=1 -tags=e2e -v -- --kubeconfig "$KUBECONFIG" )
( cd crds && go test ./... -count=1 -tags=e2e -v -- --kubeconfig "$KUBECONFIG" )
Load Tests
( cd loadtest && go test ./... -count=1 -tags=loadtest -v -- --kubeconfig "$KUBECONFIG" )

Cleanup

kubectl delete namespace "$STEWARD_TEST_CLIENT"

Directories

Path Synopsis
crds

Jump to

Keyboard shortcuts

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