File tree Expand file tree Collapse file tree 10 files changed +1260
-5
lines changed Expand file tree Collapse file tree 10 files changed +1260
-5
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,9 @@ jobs:
103103 # Build and test go
104104 - << : *test
105105 name : Go on Kubernetes
106- script : make test-e2e-go
106+ script :
107+ - make test-e2e-go
108+ - make test-integration
107109
108110 # Build and test ansible and test ansible using molecule
109111 - << : *test
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ test-markdown test/markdown:
190190test-sanity test/sanity : tidy build/operator-sdk lint
191191 ./hack/tests/sanity-check.sh
192192
193- TEST_PKGS: =$(shell go list ./... | grep -v -P 'github.com/operator-framework/operator-sdk/(hack|test/e2e ) ')
193+ TEST_PKGS: =$(shell go list ./... | grep -v -P 'github.com/operator-framework/operator-sdk/(hack/ |test/) ')
194194test-unit test/unit : # # Run the unit tests
195195 $(Q ) go test -coverprofile=coverage.out -covermode=count -count=1 -short ${TEST_PKGS}
196196
@@ -213,8 +213,8 @@ test-subcommand-scorecard:
213213test-subcommand-olm-install :
214214 ./hack/tests/subcommand-olm-install.sh
215215
216- # E2E tests.
217- .PHONY : test-e2e test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm
216+ # E2E and integration tests.
217+ .PHONY : test-e2e test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm test-integration
218218
219219test-e2e : test-e2e-go test-e2e-ansible test-e2e-ansible-molecule test-e2e-helm # # Run the e2e tests
220220
@@ -229,3 +229,6 @@ test-e2e-ansible-molecule: image-build-ansible
229229
230230test-e2e-helm : image-build-helm
231231 ./hack/tests/e2e-helm.sh
232+
233+ test-integration :
234+ ./hack/tests/integration.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -eu
4+
5+ source hack/lib/image_lib.sh
6+
7+ export OSDK_INTEGRATION_IMAGE=" quay.io/example/memcached-operator:v0.0.1"
8+
9+ # Build the operator image.
10+ pushd test/test-framework
11+ operator-sdk build " $OSDK_INTEGRATION_IMAGE "
12+ # If using a kind cluster, load the image into all nodes.
13+ load_image_if_kind " $OSDK_INTEGRATION_IMAGE "
14+ popd
15+
16+ # Install OLM on the cluster if not installed.
17+ olm_latest_exists=0
18+ if ! operator-sdk alpha olm status > /dev/null 2>&1 ; then
19+ operator-sdk alpha olm install
20+ olm_latest_exists=1
21+ fi
22+
23+ # Integration tests will use default loading rules for the kubeconfig if
24+ # KUBECONFIG is not set.
25+ go test -v ./test/integration
26+
27+ # Uninstall OLM if it was installed for test purposes.
28+ if eval " (( $olm_latest_exists ))" ; then
29+ operator-sdk alpha olm uninstall
30+ fi
31+
32+ echo -e " \n=== Integration tests succeeded ===\n"
You can’t perform that action at this time.
0 commit comments