Skip to content

Commit

Permalink
Merge pull request #97 from AbdYsn/e2e-k8s-support
Browse files Browse the repository at this point in the history
Support test-e2e-k8s rule
  • Loading branch information
pliurh authored Apr 12, 2021
2 parents d2bf826 + 6ee759f commit af80821
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ test-e2e-conformance:
test-e2e: generate vet manifests skopeo
mkdir -p ${ENVTEST_ASSETS_DIR}
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/master/hack/setup-envtest.sh
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); source hack/env.sh; go test ./test/e2e/... -coverprofile cover.out -v
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); source hack/env.sh; go test ./test/e2e/... -timeout 60m -coverprofile cover.out -v

test-e2e-k8s: export NAMESPACE=sriov-network-operator
test-e2e-k8s: test-e2e

test-%: generate vet manifests
mkdir -p ${ENVTEST_ASSETS_DIR}
Expand Down
1 change: 1 addition & 0 deletions hack/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export OPERATOR_NAME=sriov-network-operator
export RESOURCE_PREFIX=${RESOURCE_PREFIX:-openshift.io}
export ENABLE_ADMISSION_CONTROLLER=${ENABLE_ADMISSION_CONTROLLER:-"true"}
export CLUSTER_TYPE=${CLUSTER_TYPE:-openshift}
export NAMESPACE=${NAMESPACE:-"openshift-sriov-network-operator"}
6 changes: 4 additions & 2 deletions test/e2e/e2e_tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import (
var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
var testNamespace string

// Define utility constants for object names and testing timeouts/durations and intervals.
const (
testNamespace = "openshift-sriov-network-operator"

timeout = time.Second * 30
duration = time.Second * 300
interval = time.Second * 1
Expand All @@ -44,6 +43,9 @@ const (
func TestSriovTests(t *testing.T) {
RegisterFailHandler(Fail)

testNamespace = os.Getenv("NAMESPACE")
Expect(testNamespace).NotTo(Equal(""))

RunSpecsWithDefaultAndCustomReporters(t,
"E2E Suite",
[]Reporter{printer.NewlineReporter{}})
Expand Down

0 comments on commit af80821

Please sign in to comment.