mirror of
https://github.com/bitnami/charts.git
synced 2026-03-01 06:58:20 +08:00
[bitnami/mariadb] test: ✅ Improve reliability of ginkgo tests (#29467)
* [bitnami/mariadb] test: ✅ Improve reliability of ginkgo tests Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com> * Update CHANGELOG.md Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> --------- Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com> Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com> Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
committed by
GitHub
parent
a67fc1332a
commit
c6cae80e8a
@@ -10,6 +10,7 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
batchv1 "k8s.io/api/batch/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
)
|
||||
@@ -34,6 +35,7 @@ var _ = Describe("MariaDB", Ordered, func() {
|
||||
It("should have access to the created database", func() {
|
||||
|
||||
getAvailableReplicas := func(ss *appsv1.StatefulSet) int32 { return ss.Status.AvailableReplicas }
|
||||
getRestartedAtAnnotation := func(pod *v1.Pod) string { return pod.Annotations["kubectl.kubernetes.io/restartedAt"] }
|
||||
getSucceededJobs := func(j *batchv1.Job) int32 { return j.Status.Succeeded }
|
||||
getOpts := metav1.GetOptions{}
|
||||
|
||||
@@ -70,18 +72,15 @@ var _ = Describe("MariaDB", Ordered, func() {
|
||||
return c.BatchV1().Jobs(namespace).Get(ctx, createDBJobName, getOpts)
|
||||
}, timeout, PollingInterval).Should(WithTransform(getSucceededJobs, Equal(int32(1))))
|
||||
|
||||
By("scaling down to 0 replicas")
|
||||
ss, err = utils.StsScale(
|
||||
ctx, c, ss, 0)
|
||||
By("rollout restart the statefulset")
|
||||
_, err = utils.StsRolloutRestart(ctx, c, ss)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
Eventually(func() (*appsv1.StatefulSet, error) {
|
||||
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
|
||||
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, BeZero()))
|
||||
|
||||
By("scaling up to the original replicas")
|
||||
ss, err = utils.StsScale(ctx, c, ss, origReplicas)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for i := int(origReplicas) - 1; i >= 0; i-- {
|
||||
Eventually(func() (*v1.Pod, error) {
|
||||
return c.CoreV1().Pods(namespace).Get(ctx, fmt.Sprintf("%s-%d", stsName, i), getOpts)
|
||||
}, timeout, PollingInterval).Should(WithTransform(getRestartedAtAnnotation, Not(BeEmpty())))
|
||||
}
|
||||
|
||||
Eventually(func() (*appsv1.StatefulSet, error) {
|
||||
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 19.0.5 (2024-08-26)
|
||||
## 19.0.6 (2024-09-17)
|
||||
|
||||
* [bitnami/mariadb] Fix deprecation warnings in checks ([#29021](https://github.com/bitnami/charts/pull/29021))
|
||||
* [bitnami/mariadb] test: :white_check_mark: Improve reliability of ginkgo tests ([#29467](https://github.com/bitnami/charts/pull/29467))
|
||||
|
||||
## <small>19.0.5 (2024-08-27)</small>
|
||||
|
||||
* [bitnami/mariadb] Fix deprecation warnings in checks (#29021) ([213786f](https://github.com/bitnami/charts/commit/213786f3f87836b41e2e70fcedd007f08a4a012f)), closes [#29021](https://github.com/bitnami/charts/issues/29021)
|
||||
|
||||
## <small>19.0.4 (2024-08-14)</small>
|
||||
|
||||
|
||||
@@ -34,4 +34,4 @@ maintainers:
|
||||
name: mariadb
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/mariadb
|
||||
version: 19.0.5
|
||||
version: 19.0.6
|
||||
|
||||
Reference in New Issue
Block a user