Skip to content

Commit

Permalink
#190 Improve e2e tests for OpenShift
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszsek committed Apr 13, 2020
1 parent 42ed7db commit 0a0483a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ ifeq ($(KUBERNETES_PROVIDER),minikube)
endif
endif

@RUNNING_TESTS=1 go test -parallel=1 "./test/e2e/" -tags "$(BUILDTAGS) cgo" -v -timeout 45m -run "$(E2E_TEST_SELECTOR)" \
@RUNNING_TESTS=1 go test -parallel=1 "./test/e2e/" -tags "$(BUILDTAGS) cgo" -v -timeout 60m -run "$(E2E_TEST_SELECTOR)" \
-root=$(CURRENT_DIRECTORY) -kubeconfig=$(HOME)/.kube/config -globalMan deploy/crds/jenkins_$(API_VERSION)_jenkins_crd.yaml \
-namespacedMan deploy/namespace-init.yaml $(TEST_ARGS)

Expand Down
5 changes: 4 additions & 1 deletion test/e2e/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ func TestPlugins(t *testing.T) {
assert.True(t, build.IsGood())
}

func TestPriorityClassNameSetExisting(t *testing.T) {
func TestPriorityClass(t *testing.T) {
if skipTestPriorityClass {
t.Skip()
}
t.Parallel()
namespace, ctx := setupTest(t)
defer showLogsAndCleanup(t, ctx)
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/mode_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2"
)

const skipTestSafeRestart = false
const (
skipTestSafeRestart = false
skipTestPriorityClass = false
)

func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
t.Log("Update Jenkins CR")
Expand Down
9 changes: 8 additions & 1 deletion test/e2e/mode_openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import (
corev1 "k8s.io/api/core/v1"
)

const skipTestSafeRestart = false
const (
skipTestSafeRestart = false
skipTestPriorityClass = true
)

func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
t.Log("Update Jenkins CR: OpenShift")
Expand All @@ -32,4 +35,8 @@ func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
Value: resources.GetJenkinsSlavesServiceName(jenkins),
},
)

if len(jenkins.Spec.Master.Plugins) == 4 && jenkins.Spec.Master.Plugins[3].Name == "devoptics" {
jenkins.Spec.Master.Plugins = jenkins.Spec.Master.Plugins[0:3] // remove devoptics plugin
}
}
9 changes: 8 additions & 1 deletion test/e2e/mode_openshift_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const skipTestSafeRestart = true
const (
skipTestSafeRestart = true
skipTestPriorityClass = true
)

func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
t.Log("Update Jenkins CR: OpenShiftOAuth")
Expand Down Expand Up @@ -92,4 +95,8 @@ func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
Value: resources.GetJenkinsSlavesServiceName(jenkins),
},
)

if len(jenkins.Spec.Master.Plugins) == 4 && jenkins.Spec.Master.Plugins[3].Name == "devoptics" {
jenkins.Spec.Master.Plugins = jenkins.Spec.Master.Plugins[0:3] // remove devoptics plugin
}
}

0 comments on commit 0a0483a

Please sign in to comment.