#190 Improve e2e tests for OpenShift

This commit is contained in:
Tomasz Sęk 2020-04-13 19:10:59 +02:00
parent 42ed7dbc6b
commit 0a0483aa77
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
5 changed files with 25 additions and 5 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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")

View File

@ -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")
@ -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
}
}

View File

@ -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")
@ -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
}
}