File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,6 @@ e2e-test:
5454
5555e2e-job :
5656 ./scripts/run-e2e-job.sh
57+
58+ e2e-test-minikube :
59+ ./scripts/e2e-tests.sh minikube
Original file line number Diff line number Diff line change 11#! /bin/bash
2- set -e
2+ set -eu
33
4- TEST_NAMESPACE=" openshift-marketplace"
4+ ARG1=${1-}
5+ if [ " $ARG1 " = " minikube" ]; then
6+ TEST_NAMESPACE=" marketplace"
7+ else
8+ TEST_NAMESPACE=" openshift-marketplace"
9+ fi
510
611# Run the tests through the operator-sdk
712echo " Running operator-sdk test"
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import (
1515 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1616)
1717
18+ var coAPINotPresent = true
19+
1820func TestMain (m * testing.M ) {
1921 test .MainEntry (m )
2022}
@@ -24,7 +26,9 @@ func TestMarketplace(t *testing.T) {
2426 initTestingFramework (t )
2527
2628 // Run Test Groups
27- t .Run ("cluster-operator-status-test-group" , testgroups .ClusterOperatorTestGroup )
29+ if coAPINotPresent {
30+ t .Run ("cluster-operator-status-test-group" , testgroups .ClusterOperatorTestGroup )
31+ }
2832 t .Run ("operator-source-test-group" , testgroups .OperatorSourceTestGroup )
2933 t .Run ("no-setup-test-group" , testgroups .NoSetupTestGroup )
3034}
@@ -74,8 +78,13 @@ func initTestingFramework(t *testing.T) {
7478 configv1 .SchemeGroupVersion .Group , configv1 .SchemeGroupVersion .Version ),
7579 },
7680 }
81+
82+ // We are assuming that ClusterOperator API will always be added successfully
83+ // on an OpenShift cluster. This is to allow the tests be run on non-OpenSHift
84+ // clusters
7785 err = test .AddToFrameworkScheme (configv1 .Install , clusterOperator )
7886 if err != nil {
79- t .Fatalf ("failed to add ClusterOperator custom resource scheme to framework: %v" , err )
87+ t .Logf ("failed to add ClusterOperator custom resource scheme to framework: %v. ClusterOperator test will not run." , err )
88+ coAPINotPresent = false
8089 }
8190}
You can’t perform that action at this time.
0 commit comments