Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

e2e: Run operator locally with go run #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,18 @@ main() {

NODE_NAME=$(kubectl get nodes --no-headers=true -o=name)

# Build the operator container image.
# This would build a container with tag storageos/cluster-operator:test,
# which is used in the e2e test setup below.
make image/cluster-operator

# Move the operator container inside Kind container so that the image is
# available to the docker in docker environment.
if [ "$1" = "kind" ]; then
x=$(docker ps -f name=kind-1-control-plane -q)
docker save storageos/cluster-operator:test > cluster-operator.tar
docker cp cluster-operator.tar $x:/cluster-operator.tar

# containerd load image from tar archive (KinD with containerd).
docker exec $x bash -c "ctr -n k8s.io images import --base-name docker.io/storageos/cluster-operator:test /cluster-operator.tar"
fi

if [ "$2" = "olm" ]; then
# Build the operator container image.
# This would build a container with tag storageos/cluster-operator:test,
# which is used in the e2e test setup below.
make image/cluster-operator

# Move the operator container inside Kind container so that the image is
# available to the docker in docker environment.
if [ "$1" = "kind" ]; then
kind load docker-image storageos/cluster-operator:test --name kind-1
fi

# Lint the OLM CSV bundle.
make olm-lint

Expand Down Expand Up @@ -294,13 +289,13 @@ main() {
# NOTE: Append this test command with `|| true` to debug by inspecting the
# resource details. Also comment `defer ctx.Cleanup()` in the cluster to
# avoid resouce cleanup.
operator-sdk test local ./test/e2e --go-test-flags "-v -tags csi" --namespace storageos-operator
operator-sdk test local ./test/e2e --up-local --go-test-flags "-v -tags csi" --namespace storageos-operator
operator-sdk-e2e-cleanup

operator-sdk test local ./test/e2e --go-test-flags "-v -tags csideployment" --namespace storageos-operator
operator-sdk test local ./test/e2e --up-local --go-test-flags "-v -tags csideployment" --namespace storageos-operator
operator-sdk-e2e-cleanup

operator-sdk test local ./test/e2e --go-test-flags "-v -tags intree" --namespace storageos-operator
operator-sdk test local ./test/e2e --up-local --go-test-flags "-v -tags intree" --namespace storageos-operator
operator-sdk-e2e-cleanup

# echo "**** Resource details for storageos-operator namespace ****"
Expand Down
12 changes: 0 additions & 12 deletions test/e2e/util/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ func SetupOperator(t *testing.T, ctx *framework.TestCtx) {
t.Fatalf("failed to initialize cluster resources: %v", err)
}
t.Log("Initialized cluster resources")

namespace, err := ctx.GetNamespace()
if err != nil {
t.Fatal(err)
}

f := framework.Global

err = e2eutil.WaitForDeployment(t, f.KubeClient, namespace, "storageos-cluster-operator", 1, RetryInterval, Timeout)
if err != nil {
t.Fatal(err)
}
}

// ClusterStatusCheck checks the values of cluster status based on a given
Expand Down