mirror of
https://github.com/jenkinsci/kubernetes-operator.git
synced 2026-10-17 21:35:38 +02:00
feat: add matrix tests for bats and replace the old devoptics plugin in tests (#1102)
This commit is contained in:
+15
-17
@@ -68,8 +68,12 @@ diag() {
|
||||
run try "at most 20 times every 10s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
|
||||
assert_success
|
||||
|
||||
run try "at most 20 times every 5s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
|
||||
run try "at most 20 times every 5s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"backup\")].ready' is 'true'"
|
||||
assert_success
|
||||
|
||||
run ${KUBECTL} logs -l jenkins-cr=jenkins --tail=-1
|
||||
assert_success
|
||||
assert_output --partial 'Jenkins is fully up and running'
|
||||
}
|
||||
|
||||
#bats test_tags=phase:helm,scenario:vanilla
|
||||
@@ -161,6 +165,9 @@ diag() {
|
||||
chart/jenkins-operator --wait
|
||||
assert_success
|
||||
assert ${HELM} status default
|
||||
|
||||
# Additional sleep to wait for the upgrade to start deploy a new version
|
||||
sleep 15
|
||||
}
|
||||
|
||||
#bats test_tags=phase:helm,scenario:vanilla
|
||||
@@ -177,30 +184,21 @@ diag() {
|
||||
}
|
||||
|
||||
#bats test_tags=phase:helm,scenario:vanilla
|
||||
@test "1.13 Helm: check Jenkins operator pods status" {
|
||||
[[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
|
||||
run verify "there is 1 deployment named 'default-jenkins-operator'"
|
||||
assert_success
|
||||
|
||||
run verify "there is 1 pod named 'default-jenkins-operator-'"
|
||||
assert_success
|
||||
|
||||
run try "at most 20 times every 10s to get pods named 'default-jenkins-operator-' and verify that '.status.containerStatuses[?(@.name==\"jenkins-operator\")].ready' is 'true'"
|
||||
assert_success
|
||||
}
|
||||
|
||||
#bats test_tags=phase:helm,scenario:vanilla
|
||||
@test "1.14 Helm: check Jenkins Pod status" {
|
||||
@test "1.13 Helm: check Jenkins Pod status" {
|
||||
[[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
|
||||
run try "at most 20 times every 10s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
|
||||
assert_success
|
||||
|
||||
run try "at most 20 times every 5s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
|
||||
run try "at most 20 times every 5s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"backup\")].ready' is 'true'"
|
||||
assert_success
|
||||
|
||||
run ${KUBECTL} logs -l jenkins-cr=jenkins --tail=-1
|
||||
assert_success
|
||||
assert_output --partial 'Jenkins is fully up and running'
|
||||
}
|
||||
|
||||
#bats test_tags=phase:helm,scenario:vanilla
|
||||
@test "1.15 Helm: clean" {
|
||||
@test "1.14 Helm: clean" {
|
||||
run ${HELM} uninstall default --wait
|
||||
assert_success
|
||||
# Wait for the complete removal
|
||||
|
||||
@@ -128,7 +128,7 @@ func createJenkinsCRSafeRestart(name, namespace string, seedJob *[]v1alpha2.Seed
|
||||
{Name: "audit-trail", Version: "361.v82cde86c784e"},
|
||||
{Name: "simple-theme-plugin", Version: "176.v39740c03a_a_f5"},
|
||||
{Name: "github", Version: "1.38.0"},
|
||||
{Name: "devoptics", Version: "2.0", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/2.0/devoptics.hpi"},
|
||||
{Name: "cloudbees-disk-usage-simple", Version: "239.v6a_f1a_c1c8046", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/cloudbees-disk-usage-simple/239.v6a_f1a_c1c8046/cloudbees-disk-usage-simple.hpi"},
|
||||
},
|
||||
PriorityClassName: priorityClassName,
|
||||
NodeSelector: map[string]string{"kubernetes.io/os": "linux"},
|
||||
|
||||
@@ -151,7 +151,7 @@ func RenderJenkinsCR(name, namespace string, seedJob *[]v1alpha2.SeedJob, groovy
|
||||
{Name: "audit-trail", Version: "361.v82cde86c784e"},
|
||||
{Name: "simple-theme-plugin", Version: "176.v39740c03a_a_f5"},
|
||||
{Name: "github", Version: "1.38.0"},
|
||||
{Name: "devoptics", Version: "2.0", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/devoptics/2.0/devoptics.hpi"},
|
||||
{Name: "cloudbees-disk-usage-simple", Version: "239.v6a_f1a_c1c8046", DownloadURL: "https://jenkins-updates.cloudbees.com/download/plugins/cloudbees-disk-usage-simple/239.v6a_f1a_c1c8046/cloudbees-disk-usage-simple.hpi"},
|
||||
},
|
||||
PriorityClassName: priorityClassName,
|
||||
NodeSelector: map[string]string{"kubernetes.io/os": "linux"},
|
||||
|
||||
Reference in New Issue
Block a user