Skip to content

Commit 34b09d4

Browse files
authored
Merge pull request #1648 from gruntwork-io/fix/helm-test-failures
Update bitnami/nginx chart version in helm tests
2 parents 2d7fd80 + fdd70aa commit 34b09d4

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

modules/helm/install_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
const (
3030
remoteChartSource = "https://charts.bitnami.com/bitnami"
3131
remoteChartName = "nginx"
32-
remoteChartVersion = "13.2.23"
32+
remoteChartVersion = "22.4.0"
3333
)
3434

3535
// Test that we can install a remote chart (e.g bitnami/nginx)
@@ -48,11 +48,13 @@ func TestRemoteChartInstall(t *testing.T) {
4848
defer k8s.DeleteNamespace(t, kubectlOptions, namespaceName)
4949
k8s.CreateNamespace(t, kubectlOptions, namespaceName)
5050

51-
// Override service type to node port
51+
// Override service type to node port and disable PDB (requires policy/v1 API
52+
// which may not be available on older k8s clusters)
5253
options := &Options{
5354
KubectlOptions: kubectlOptions,
5455
SetValues: map[string]string{
5556
"service.type": "NodePort",
57+
"pdb.create": "false",
5658
},
5759
Version: remoteChartVersion,
5860
}
@@ -160,9 +162,11 @@ func waitForRemoteChartPods(t *testing.T, kubectlOptions *k8s.KubectlOptions, re
160162
remoteChartName, releaseName,
161163
),
162164
}
163-
k8s.WaitUntilNumPodsCreated(t, kubectlOptions, filters, podCount, 30, 10*time.Second)
165+
// Use longer timeout (60 retries * 10s = 10 min) to handle slower CI environments
166+
// and potential resource contention when multiple helm tests run in parallel
167+
k8s.WaitUntilNumPodsCreated(t, kubectlOptions, filters, podCount, 60, 10*time.Second)
164168
pods := k8s.ListPods(t, kubectlOptions, filters)
165169
for _, pod := range pods {
166-
k8s.WaitUntilPodAvailable(t, kubectlOptions, pod.Name, 30, 10*time.Second)
170+
k8s.WaitUntilPodAvailable(t, kubectlOptions, pod.Name, 60, 10*time.Second)
167171
}
168172
}

modules/helm/upgrade_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ func TestRemoteChartInstallUpgradeRollback(t *testing.T) {
4040
defer k8s.DeleteNamespace(t, kubectlOptions, namespaceName)
4141
k8s.CreateNamespace(t, kubectlOptions, namespaceName)
4242

43-
// Override service type to node port
43+
// Override service type to node port and disable PDB (requires policy/v1 API
44+
// which may not be available on older k8s clusters)
4445
options := &Options{
4546
KubectlOptions: kubectlOptions,
4647
SetValues: map[string]string{
4748
"service.type": "NodePort",
49+
"pdb.create": "false",
4850
},
4951
Version: remoteChartVersion,
5052
}
@@ -69,6 +71,7 @@ func TestRemoteChartInstallUpgradeRollback(t *testing.T) {
6971
options.SetValues = map[string]string{
7072
"replicaCount": "2",
7173
"service.type": "NodePort",
74+
"pdb.create": "false",
7275
}
7376
// Test that passing extra arguments doesn't error, by changing default timeout
7477
options.ExtraArgs = map[string][]string{"upgrade": []string{"--timeout", "5m1s"}}

test/helm_keda_remote_example_template_snapshot_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,6 @@ func TestHelmKedaRemoteExampleTemplateRenderedPackageDiff(t *testing.T) {
173173
output := helm.RenderRemoteTemplate(t, options, "https://kedacore.github.io/charts", releaseName, []string{})
174174

175175
// run the diff and assert the number of diffs matches the number of diffs in the snapshot
176-
require.Equal(t, 24, helm.DiffAgainstSnapshot(t, options, output, releaseName))
176+
// (namespace diffs + intentional value changes for replicas/memory)
177+
require.Equal(t, 27, helm.DiffAgainstSnapshot(t, options, output, releaseName))
177178
}

0 commit comments

Comments
 (0)