Skip to content

Commit 25a0b34

Browse files
committed
add cometbft tests
[static] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
1 parent d767131 commit 25a0b34

File tree

2 files changed

+77
-9
lines changed

2 files changed

+77
-9
lines changed

cluster/helm/splice-cometbft/tests/cometbft_deployment_test.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
suite: "cometbft deployment"
55
templates:
66
- deployment.yaml
7-
- pvc.yaml
87
release:
98
# Set for testing labels
109
name: global-domain-3
@@ -35,15 +34,18 @@ tests:
3534
- equal:
3635
path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0]
3736
value: "cometbft"
38-
- it: "deploys a PVC"
39-
template: pvc.yaml
37+
- equal:
38+
path: spec.template.spec.volumes[4].persistentVolumeClaim.claimName
39+
value: global-domain-3-cometbft-cometbft-data
40+
- it: "uses custom pvcName in deployment when set"
41+
template: deployment.yaml
42+
set:
43+
db:
44+
pvcName: "custom-pvc-name"
4045
documentSelector:
4146
path: kind
42-
value: PersistentVolumeClaim
47+
value: Deployment
4348
asserts:
4449
- equal:
45-
path: metadata.name
46-
value: global-domain-3-cometbft-cometbft-data
47-
- equal:
48-
path: metadata.annotations["helm.sh/resource-policy"]
49-
value: keep
50+
path: spec.template.spec.volumes[4].persistentVolumeClaim.claimName
51+
value: custom-pvc-name
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
suite: "cometbft pvc"
5+
templates:
6+
- pvc.yaml
7+
release:
8+
# Set for testing labels
9+
name: global-domain-3
10+
set:
11+
node:
12+
identifier: "global-domain-3-cometbft"
13+
tests:
14+
- it: "deploys a PVC"
15+
template: pvc.yaml
16+
documentSelector:
17+
path: kind
18+
value: PersistentVolumeClaim
19+
asserts:
20+
- equal:
21+
path: metadata.name
22+
value: global-domain-3-cometbft-cometbft-data
23+
- equal:
24+
path: metadata.annotations["helm.sh/resource-policy"]
25+
value: keep
26+
- it: "uses custom pvcName in PVC when set"
27+
template: pvc.yaml
28+
set:
29+
db:
30+
pvcName: "custom-pvc-name"
31+
documentSelector:
32+
path: kind
33+
value: PersistentVolumeClaim
34+
asserts:
35+
- equal:
36+
path: metadata.name
37+
value: custom-pvc-name
38+
- it: "does not include dataSource in PVC when not set"
39+
template: pvc.yaml
40+
documentSelector:
41+
path: kind
42+
value: PersistentVolumeClaim
43+
asserts:
44+
- isNull:
45+
path: spec.dataSource
46+
- it: "includes dataSource in PVC when set"
47+
template: pvc.yaml
48+
set:
49+
db:
50+
dataSource:
51+
kind: VolumeSnapshot
52+
name: my-snapshot
53+
apiGroup: snapshot.storage.k8s.io
54+
documentSelector:
55+
path: kind
56+
value: PersistentVolumeClaim
57+
asserts:
58+
- equal:
59+
path: spec.dataSource.kind
60+
value: VolumeSnapshot
61+
- equal:
62+
path: spec.dataSource.name
63+
value: my-snapshot
64+
- equal:
65+
path: spec.dataSource.apiGroup
66+
value: snapshot.storage.k8s.io

0 commit comments

Comments
 (0)