#190 Improve e2e tests for OpenShift
This commit is contained in:
parent
42ed7dbc6b
commit
0a0483aa77
2
Makefile
2
Makefile
|
|
@ -197,7 +197,7 @@ ifeq ($(KUBERNETES_PROVIDER),minikube)
|
||||||
endif
|
endif
|
||||||
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 \
|
-root=$(CURRENT_DIRECTORY) -kubeconfig=$(HOME)/.kube/config -globalMan deploy/crds/jenkins_$(API_VERSION)_jenkins_crd.yaml \
|
||||||
-namespacedMan deploy/namespace-init.yaml $(TEST_ARGS)
|
-namespacedMan deploy/namespace-init.yaml $(TEST_ARGS)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,10 @@ func TestPlugins(t *testing.T) {
|
||||||
assert.True(t, build.IsGood())
|
assert.True(t, build.IsGood())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPriorityClassNameSetExisting(t *testing.T) {
|
func TestPriorityClass(t *testing.T) {
|
||||||
|
if skipTestPriorityClass {
|
||||||
|
t.Skip()
|
||||||
|
}
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
namespace, ctx := setupTest(t)
|
namespace, ctx := setupTest(t)
|
||||||
defer showLogsAndCleanup(t, ctx)
|
defer showLogsAndCleanup(t, ctx)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,10 @@ import (
|
||||||
"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2"
|
"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) {
|
func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||||
t.Log("Update Jenkins CR")
|
t.Log("Update Jenkins CR")
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,10 @@ import (
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const skipTestSafeRestart = false
|
const (
|
||||||
|
skipTestSafeRestart = false
|
||||||
|
skipTestPriorityClass = true
|
||||||
|
)
|
||||||
|
|
||||||
func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||||
t.Log("Update Jenkins CR: OpenShift")
|
t.Log("Update Jenkins CR: OpenShift")
|
||||||
|
|
@ -32,4 +35,8 @@ func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||||
Value: resources.GetJenkinsSlavesServiceName(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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,10 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
const skipTestSafeRestart = true
|
const (
|
||||||
|
skipTestSafeRestart = true
|
||||||
|
skipTestPriorityClass = true
|
||||||
|
)
|
||||||
|
|
||||||
func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||||
t.Log("Update Jenkins CR: OpenShiftOAuth")
|
t.Log("Update Jenkins CR: OpenShiftOAuth")
|
||||||
|
|
@ -92,4 +95,8 @@ func updateJenkinsCR(t *testing.T, jenkins *v1alpha2.Jenkins) {
|
||||||
Value: resources.GetJenkinsSlavesServiceName(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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue