Skip to content

Commit

Permalink
fix(test): helm/bats + chore(blog): add 0.8.1 release note (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
brokenpip3 committed Jul 8, 2024
1 parent 3a5b7f6 commit 24eac18
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ helm-release-latest: helm
.PHONY: helm-e2e
IMAGE_NAME := quay.io/$(QUAY_ORGANIZATION)/$(QUAY_REGISTRY):$(GITCOMMIT)-amd64

helm-e2e: helm container-runtime-build-amd64 ## Runs helm e2e tests, you can use EXTRA_ARGS
helm-e2e: helm container-runtime-build-amd64 backup-kind-load ## Runs helm e2e tests, you can use EXTRA_ARGS
kind load docker-image ${IMAGE_NAME} --name $(KIND_CLUSTER_NAME)
@echo "+ $@"
RUNNING_TESTS=1 go test -parallel=1 "./test/helm/" -ginkgo.v -tags "$(BUILDTAGS) cgo" -v -timeout 60m -run "$(E2E_TEST_SELECTOR)" -image-name=$(IMAGE_NAME) $(E2E_TEST_ARGS)
Expand Down
8 changes: 5 additions & 3 deletions test/bats/1-deploy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ diag() {
--set operator.image=${OPERATOR_IMAGE} \
--set jenkins.latestPlugins=true \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=false \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
--set jenkins.seedJobs[0].id=seed-job \
Expand Down Expand Up @@ -154,9 +155,10 @@ diag() {
--set operator.image=${OPERATOR_IMAGE} \
--set jenkins.latestPlugins=true \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=false \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
chart/jenkins-operator
chart/jenkins-operator --wait
assert_success
assert ${HELM} status default
}
Expand Down Expand Up @@ -199,10 +201,10 @@ diag() {

#bats test_tags=phase:helm,scenario:vanilla
@test "1.15 Helm: clean" {
run ${HELM} uninstall default
run ${HELM} uninstall default --wait
assert_success
# Wait for the complete removal
sleep 30
sleep 10

run verify "there is 0 pvc named 'jenkins backup'"
assert_success
Expand Down
8 changes: 5 additions & 3 deletions test/bats/2-deploy-with-more-options.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ setup() {
--set jenkins.latestPlugins=true \
--set jenkins.nodeSelector.batstest=yep \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=false \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
jenkins-operator/jenkins-operator --version=$(get_latest_chart_version)
Expand Down Expand Up @@ -103,9 +104,10 @@ setup() {
--set jenkins.latestPlugins=true \
--set jenkins.nodeSelector.batstest=yep \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=false \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
chart/jenkins-operator
chart/jenkins-operator --wait
assert_success
assert ${HELM} status options
}
Expand Down Expand Up @@ -160,9 +162,9 @@ setup() {
@test "2.14 Helm: clean" {
[[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"

run ${HELM} uninstall options
run ${HELM} uninstall options --wait
assert_success
sleep 30
sleep 10

run verify "there is 0 pvc named 'jenkins backup'"
assert_success
Expand Down
12 changes: 9 additions & 3 deletions test/bats/3-deploy-with-webhook.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ setup() {
--set operator.image=${OPERATOR_IMAGE} \
--set jenkins.latestPlugins=true \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=true \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
--set webhook.enabled=true \
--set cert-manager.enabled=true \
--set cert-manager.startupapicheck.enabled=true \
jenkins-operator/jenkins-operator --version=$(get_latest_chart_version)
assert_success
assert ${HELM} status webhook
Expand Down Expand Up @@ -88,10 +91,13 @@ setup() {
--set operator.image=${OPERATOR_IMAGE} \
--set jenkins.latestPlugins=true \
--set jenkins.image="jenkins/jenkins:2.452.2-lts" \
--set jenkins.imagePullPolicy="IfNotPresent" \
--set jenkins.backup.makeBackupBeforePodDeletion=true \
--set jenkins.backup.image=quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test \
--set webhook.enabled=true \
chart/jenkins-operator
--set cert-manager.enabled=true \
--set cert-manager.startupapicheck.enabled=true \
chart/jenkins-operator --wait
assert_success
assert ${HELM} status webhook
sleep 10
Expand Down Expand Up @@ -137,9 +143,9 @@ setup() {
@test "3.12 Helm: clean" {
[[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"

run ${HELM} uninstall webhook
run ${HELM} uninstall webhook --wait
assert_success
sleep 30
sleep 20

run verify "there is 0 pvc named 'jenkins backup'"
assert_success
Expand Down
4 changes: 3 additions & 1 deletion test/helm/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ var _ = Describe("Jenkins Controller", func() {
cmd := exec.Command("../../bin/helm", "upgrade", "jenkins", "../../chart/jenkins-operator", "--namespace", namespace.Name, "--debug",
"--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name),
"--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.452.2-lts"),
"--set-string", fmt.Sprintf("operator.image=%s", *imageName), "--install")
"--set-string", fmt.Sprintf("operator.image=%s", *imageName),
"--set-string", fmt.Sprintf("backup.image=%s", "quay.io/jenkins-kubernetes-operator/backup-pvc:e2e-test"),
"--set-string", fmt.Sprintf("jenkins.imagePullPolicy=%s", "IfNotPresent"), "--install")
output, err := cmd.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), string(output))

Expand Down
38 changes: 35 additions & 3 deletions website/content/en/blog/news/release-0-8-1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
---
title: "Lorem ipsum"
linkTitle: "Temporary title"
title: "v0.8.1"
linkTitle: "v0.8.1"
date: 2024-04-07
description: >
TODO: change this
v0.8.1 has been released
---

# New in this Release

## Jenkins

* Updated the base plugins and Jenkins LTS to the latest version.
* Exposed `terminationGracePeriodSeconds` for the Jenkins master.

## Backup

* From version `4.1`, the backup temporary directory is created in the backup PVC, so the temporary tar file is moved immediately after the tar process ends. This improves speed and reliability. Size your backup PVC accordingly. See the [documentation](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuring-backup-and-restore/#pvc-storage-size) section `PVC Storage Size`.
* From version `4.1`, each backup component (backup, restore, run) logs everything to stdout/stderr, improving understanding in case of issues and providing a backup and restore timeline. You can have a preview of the logs from the [PR](https://github.com/jenkinsci/kubernetes-operator/pull/1023) description.
* From version `4.1`, a lock file for backup and restore processes is implemented to prevent multiple backups in case of operator crash/restart. See this [section](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuring-backup-and-restore/#Customizing-pvc-backup-behaviour) of the docs.

If you do not wish to use these new features, you can use the old `v0.2.6` tag.

## CI / Chart

* Cert-manager CRDs are no longer shipped by default.
* Improved Ginkgo tests by implementing matrix testing.
* Enhanced BATS tests to cover more scenarios.


## Bug Fixes

* Fix incorrect double restore in the reconciliation loop
* Fixed `configurationAsCode` and `groovyScripts` arrays in the Helm chart.
* Ensured consistent `imagePullPolicy` for the backup container.
* Stopped using deprecated `jnlpUrl` for getting seed agents node secret.
* Fixed the website build CI.

Thanks to all contributors who made this release possible!

0 comments on commit 24eac18

Please sign in to comment.