Skip to content

Commit 4684388

Browse files
fix(helm): fix querydoc helm unittests and include them in CI workflow (#1769)
## Overview Fix broken querydoc helm-unittest tests and add them to CI. The tests were introduced in PR #599 (Helm refactor) but never added to CI, so subsequent breakage from PR #683 (Official KMCP Support) went undetected. close #1768 ## Changes ### Fix querydoc deployment test - Include `configmap.yaml` as rendered template during unittest so that `include` function for a checksum annotation works. Also added `template: deployment.yaml` directives required when multiple templates are listed. - Fixed the value`replicaCount` → `replicas` to match the actual key used in deployment manifest. - Updated the image tag to `1.1.10` in unittest to match the AppVersion of the chart. ### Remove obsolete toolserver test `toolserver_test.yaml` referenced `templates/toolserver.yaml` which was deleted in PR #683 when ToolServer CRDs were replaced by Kubernetes Services with `kagent.dev/mcp-service` labels. ### Add querydoc to CI helm-unit-tests job Added `helm unittest helm/tools/querydoc` to the `helm-unit-tests` job in `.github/workflows/ci.yaml` so future breakage is caught automatically. --------- Signed-off-by: TOMOFUMI-KONDO <ugax2kontomo0314@gmail.com>
1 parent bdbe2a7 commit 4684388

4 files changed

Lines changed: 25 additions & 57 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ jobs:
202202
- name: Run helm unit tests
203203
run: |
204204
helm unittest helm/kagent
205+
helm unittest helm/tools/querydoc
205206
206207
ui-tests:
207208
runs-on: ubuntu-latest

helm/tools/querydoc/tests/deployment_test.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
suite: test querydoc deployment
22
templates:
33
- deployment.yaml
4+
- configmap.yaml
45
tests:
56
- it: should render deployment with default values
7+
template: deployment.yaml
68
asserts:
79
- isKind:
810
of: Deployment
@@ -16,23 +18,26 @@ tests:
1618
count: 1
1719

1820
- it: should render deployment with custom replica count
21+
template: deployment.yaml
1922
set:
20-
replicaCount: 2
23+
replicas: 2
2124
asserts:
2225
- equal:
2326
path: spec.replicas
2427
value: 2
2528

2629
- it: should have correct container image
30+
template: deployment.yaml
2731
asserts:
2832
- equal:
2933
path: spec.template.spec.containers[0].name
3034
value: querydoc
3135
- equal:
3236
path: spec.template.spec.containers[0].image
33-
value: ghcr.io/kagent-dev/doc2vec/mcp:1.1.7
37+
value: ghcr.io/kagent-dev/doc2vec/mcp:1.1.10
3438

3539
- it: should use custom image tag when set
40+
template: deployment.yaml
3641
set:
3742
image:
3843
tag: "v2.0.0"
@@ -42,18 +47,21 @@ tests:
4247
value: ghcr.io/kagent-dev/doc2vec/mcp:v2.0.0
4348

4449
- it: should have correct service account name
50+
template: deployment.yaml
4551
asserts:
4652
- equal:
4753
path: spec.template.spec.serviceAccountName
4854
value: RELEASE-NAME-querydoc
4955

5056
- it: should have correct container port
57+
template: deployment.yaml
5158
asserts:
5259
- equal:
5360
path: spec.template.spec.containers[0].ports[0].containerPort
5461
value: 8080
5562

5663
- it: should have correct labels
64+
template: deployment.yaml
5765
asserts:
5866
- equal:
5967
path: metadata.labels["app.kubernetes.io/name"]
@@ -69,11 +77,13 @@ tests:
6977
value: RELEASE-NAME
7078

7179
- it: should not set pod security context by default
80+
template: deployment.yaml
7281
asserts:
7382
- notExists:
7483
path: spec.template.spec.securityContext
7584

7685
- it: should set pod security context when podSecurityContext is provided
86+
template: deployment.yaml
7787
set:
7888
podSecurityContext:
7989
runAsNonRoot: true
@@ -87,22 +97,24 @@ tests:
8797
value: 1000
8898

8999
- it: should set nodeSelector
100+
template: deployment.yaml
90101
set:
91-
nodeSelector:
92-
role: AI
102+
nodeSelector:
103+
role: AI
93104
asserts:
94105
- equal:
95106
path: spec.template.spec.nodeSelector
96107
value:
97108
role: AI
98109

99110
- it: should set tolerations
111+
template: deployment.yaml
100112
set:
101-
tolerations:
102-
- key: role
103-
operator: Equal
104-
value: AI
105-
effect: NoSchedule
113+
tolerations:
114+
- key: role
115+
operator: Equal
116+
value: AI
117+
effect: NoSchedule
106118
asserts:
107119
- contains:
108120
any: true
@@ -111,4 +123,4 @@ tests:
111123
key: role
112124
value: AI
113125
effect: NoSchedule
114-
operator: Equal
126+
operator: Equal

helm/tools/querydoc/tests/toolserver_test.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

helm/tools/querydoc/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
replicaCount: 1
1+
replicas: 1
22

33
image:
44
registry: ghcr.io
@@ -39,7 +39,7 @@ logLevel: info
3939
# MCP server configuration
4040
config:
4141

42-
# Secret configuration
42+
# Secret configuration
4343
openai:
4444
apiKey: ""
4545

0 commit comments

Comments
 (0)