Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Ivantsov committed Dec 16, 2024
1 parent dc97ee9 commit 59405ce
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/main/charts/confluence/templates/service-synchrony.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if and (eq .Values.synchrony.service.type "NodePort") .Values.synchrony.service.nodePort}}
nodePort: {{ .Values.synchrony.service.nodePort }}
{{- end }}
- port: {{ .Values.synchrony.ports.hazelcast }}
targetPort: hazelcast
protocol: TCP
Expand Down
8 changes: 7 additions & 1 deletion src/test/java/test/ServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ void service_port_type(Product product) throws Exception {
product + ".service.port", "1234",
product + ".service.type", "NodePort",
product + ".service.nodePort", "30001",
product + ".service.sshNodePort", "30002"
product + ".service.sshNodePort", "30002",
"synchrony.enabled", "true"

));

Expand All @@ -48,6 +49,11 @@ void service_port_type(Product product) throws Exception {
assertThat(service.getPort("ssh"))
.hasValueSatisfying(node -> assertThat(node.path("nodePort")).hasValueEqualTo(30002));
}
if (product.name().equals("confluence")) {
final var synchronyService = resources.get(Kind.Service, Service.class, product.getHelmReleaseName());
assertThat(synchronyService.getPort("http"))
.hasValueSatisfying(node -> assertThat(node.path("nodePort")).hasValueEqualTo(30001));
}
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 7840cc3e79fba7837aee076a182650b787c8f53f1919ec199b7adc3e7b1abccb
checksum/config-jvm: 8587a9721b627f0dfd7a359dbee53d0a010f75d293f03f5a160104dc9d15101a
labels:
app.kubernetes.io/name: bamboo-agent
app.kubernetes.io/instance: unittest-bamboo-agent
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/expected_helm_output/bamboo/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ data:
annotations: {}
contextPath: null
loadBalancerIP: null
nodePort: null
port: 80
sessionAffinity: None
sessionAffinityConfig:
Expand Down Expand Up @@ -450,7 +451,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 3adff5bd3002b33d2f9ede62864902898e58a0ede65de2c485424c36e855f629
checksum/config-jvm: c41bc799b8b23af6a3170c4635ef9fa71edb855f1d47e25eaa8e8acfa9ca43e1
labels:
helm.sh/chart: bamboo-1.22.1
app.kubernetes.io/name: bamboo
Expand Down
7 changes: 5 additions & 2 deletions src/test/resources/expected_helm_output/bitbucket/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,13 @@ data:
annotations: {}
contextPath: null
loadBalancerIP: null
nodePort: null
port: 80
sessionAffinity: None
sessionAffinityConfig:
clientIP:
timeoutSeconds: null
sshNodePort: null
sshPort: 7999
type: ClusterIP
setPermissions: true
Expand All @@ -249,6 +251,7 @@ data:
enabled: false
host: null
loadBalancerIP: null
nodePort: null
port: 22
type: LoadBalancer
startupProbe:
Expand Down Expand Up @@ -593,7 +596,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 325d0f8b0fb850d725ad0e9b17f9ffb5afe1e87176215d4c59afaa987034fbc4
checksum/config-jvm: 2749f9462255f51e691b5c20440ba6926c4e36eede24448f852a4c9b9f3293fc
labels:
app.kubernetes.io/name: bitbucket-mesh
app.kubernetes.io/instance: unittest-bitbucket
Expand Down Expand Up @@ -714,7 +717,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 904ee5cdf24aa3f20010c1bd0a75de5c1755f2b4a68fb2361e1e36e8b8464eec
checksum/config-jvm: 769b21f2174a73dca3bd26f10a6ebcf67d6c70b9481a618d4d0808d6e40799d2
labels:
helm.sh/chart: bitbucket-1.22.1
app.kubernetes.io/name: bitbucket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ data:
annotations: {}
contextPath: null
loadBalancerIP: null
nodePort: null
port: 80
sessionAffinity: None
sessionAffinityConfig:
Expand Down Expand Up @@ -362,6 +363,7 @@ data:
service:
annotations: {}
loadBalancerIP: null
nodePort: null
port: 80
type: ClusterIP
setPermissions: true
Expand Down Expand Up @@ -637,7 +639,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 0be7e4380d8a71217f79c8ea3e714e9bbc003d9eb19cfe363980fe2f04087fbf
checksum/config-jvm: 12b2bf4a8a471b4be5acc06995810c8331609e8aa3f237e44dd62e27888f85df
labels:
helm.sh/chart: confluence-1.22.1
app.kubernetes.io/name: confluence
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/expected_helm_output/crowd/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ data:
annotations: {}
contextPath: /crowd
loadBalancerIP: null
nodePort: null
port: 80
sessionAffinity: None
sessionAffinityConfig:
Expand Down Expand Up @@ -374,7 +375,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 87bf8a70efc8e508ac8cef16c7ec7ed9a4383fbd561d0775996a538f82bda1ef
checksum/config-jvm: 959bd1ffef2f05dc8025f24a6c7e5af1d8c91b90d88d64f7b9e22b80d3553ec3
labels:
helm.sh/chart: crowd-1.22.1
app.kubernetes.io/name: crowd
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/expected_helm_output/jira/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ data:
annotations: {}
contextPath: null
loadBalancerIP: null
nodePort: null
port: 80
sessionAffinity: None
sessionAffinityConfig:
Expand Down Expand Up @@ -401,7 +402,7 @@ spec:
template:
metadata:
annotations:
checksum/config-jvm: 9874e836468ba673419d9305856e7570c1c7e752338d664e62b9d32180107b9a
checksum/config-jvm: 3294c8cdaf5ff4579163b6eaad63d6ce37838bc0101e7b903b1d2913c5a882a9
labels:
helm.sh/chart: jira-1.22.1
app.kubernetes.io/name: jira
Expand Down

0 comments on commit 59405ce

Please sign in to comment.