Skip to content

Commit 6f1af9e

Browse files
Run both ro and rw integration tests and clarify vartnish closureBackend
1 parent 9c06c2f commit 6f1af9e

3 files changed

Lines changed: 39 additions & 13 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,22 @@ on:
66

77
jobs:
88
integration-tests:
9-
name: Integration Tests
9+
name: Integration Tests (${{ matrix.mode.name }})
1010
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
mode:
15+
- name: read-only
16+
release: ontoserver-ro
17+
isReadOnly: "true"
18+
expectedHook: ontoserver-ro-ontoserver-test-fhir-ro
19+
unexpectedHook: ontoserver-ro-ontoserver-test-fhir-rw
20+
- name: read-write
21+
release: ontoserver-rw
22+
isReadOnly: "false"
23+
expectedHook: ontoserver-rw-ontoserver-test-fhir-rw
24+
unexpectedHook: ontoserver-rw-ontoserver-test-fhir-ro
1125
steps:
1226
- uses: actions/checkout@v4
1327

@@ -30,8 +44,8 @@ jobs:
3044

3145
- name: Install chart
3246
run: |
33-
helm install ontoserver ./charts/ontoserver \
34-
--set ontoserver.deployment.isReadOnly=false \
47+
helm install ${{ matrix.mode.release }} ./charts/ontoserver \
48+
--set ontoserver.deployment.isReadOnly=${{ matrix.mode.isReadOnly }} \
3549
--set ontoserver.managementService.enabled=true \
3650
--set ontoserver.imageCredentials.username=${{ secrets.QUAY_USERNAME }} \
3751
--set ontoserver.imageCredentials.password=${{ secrets.QUAY_PASSWORD }} \
@@ -56,23 +70,33 @@ jobs:
5670
echo "=== Pod description ==="
5771
kubectl describe pods
5872
echo "=== Pod logs ==="
59-
kubectl logs -l app=ontoserver-ontoserver --all-containers=true --tail=100 || true
73+
kubectl logs -l app=${{ matrix.mode.release }}-ontoserver --all-containers=true --tail=100 || true
6074
echo "=== Events ==="
6175
kubectl get events --sort-by='.lastTimestamp'
6276
6377
- name: Run integration tests
64-
run: helm test ontoserver --timeout 10m
78+
run: helm test ${{ matrix.mode.release }} --timeout 10m
79+
80+
- name: Verify mode-specific test hook rendered
81+
run: |
82+
kubectl get job ${{ matrix.mode.expectedHook }}
83+
if kubectl get job ${{ matrix.mode.unexpectedHook }} >/dev/null 2>&1; then
84+
echo "Unexpected Helm test job found: ${{ matrix.mode.unexpectedHook }}"
85+
exit 1
86+
fi
6587
6688
- name: Collect test logs
6789
if: always()
6890
run: |
6991
echo "=== Events ==="
7092
kubectl get events --sort-by='.lastTimestamp'
7193
echo "=== Ontoserver pod logs (all containers) ==="
72-
kubectl logs -l app=ontoserver-ontoserver --all-containers=true --tail=50 || true
94+
kubectl logs -l app=${{ matrix.mode.release }}-ontoserver --all-containers=true --tail=50 || true
7395
echo "=== test-metadata job ==="
74-
kubectl describe job ontoserver-ontoserver-test-metadata || true
96+
kubectl describe job ${{ matrix.mode.release }}-ontoserver-test-metadata || true
7597
echo "=== test-metadata logs ==="
76-
kubectl logs -l job-name=ontoserver-ontoserver-test-metadata --tail=200 || true
77-
echo "=== test-fhir-rw logs ==="
78-
kubectl logs -l job-name=ontoserver-ontoserver-test-fhir-rw --tail=200 || true
98+
kubectl logs -l job-name=${{ matrix.mode.release }}-ontoserver-test-metadata --tail=200 || true
99+
echo "=== mode-specific test job ==="
100+
kubectl describe job ${{ matrix.mode.expectedHook }} || true
101+
echo "=== mode-specific test logs ==="
102+
kubectl logs -l job-name=${{ matrix.mode.expectedHook }} --tail=200 || true

charts/ontoserver-extras/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,12 @@ When Varnish fronts a scaled StatefulSet Ontoserver cluster, two additional sett
178178

179179
**`varnish.graceSeconds`** — Seconds to serve stale cached content when the backend is temporarily unavailable (default `30s`). This covers rolling updates of the Ontoserver StatefulSet: while a pod is being replaced, Varnish continues serving its last-known response rather than returning a 503. Set to `0` to disable grace mode.
180180

181-
**`varnish.closureBackend`** — The [`$closure` FHIR operation](https://www.hl7.org/fhir/conceptmap-operation-closure.html) is stateful and must always reach the same Ontoserver instance. When set, Varnish routes all `POST /fhir/ConceptMap/$closure` requests to this specific backend hostname, bypassing the cache and the normal load-balanced backend. Set to the stable DNS name of pod-0 via the headless service (e.g. `RELEASE-statefulset-0.RELEASE-ontoserver-headless`). Empty string (the default) disables dedicated `$closure` routing.
181+
**`varnish.closureBackend`** — Optional dedicated backend for the [`$closure` FHIR operation](https://www.hl7.org/fhir/conceptmap-operation-closure.html), which is stateful and must always reach the same Ontoserver instance. When set, Varnish routes all `POST /fhir/ConceptMap/$closure` requests to this specific backend hostname, bypassing the cache and the normal load-balanced backend. Set it to the stable DNS name of pod-0 via the headless service (e.g. `RELEASE-statefulset-0.RELEASE-ontoserver-headless`). Empty string (the default) disables dedicated `$closure` routing.
182182

183183
> [!IMPORTANT]
184-
> When Varnish is the entry point for a scaled StatefulSet deployment (i.e. `ontoserver.gateway.backendServiceNameOverride` or `ontoserver.ingress` routes traffic to the Varnish service), you **must** set `varnish.closureBackend`. Without it, `$closure` requests are load-balanced across all pods and will fail intermittently because each pod maintains its own independent closure table state.
184+
> You usually do **not** need `varnish.closureBackend` when using the `ontoserver` chart's Gateway or Ingress. In that setup, the `ontoserver` chart already routes `/fhir/ConceptMap/$closure` directly to `RELEASE-ontoserver-pod0-service` before the catchall route to Varnish, so `$closure` bypasses Varnish entirely.
185+
>
186+
> Set `varnish.closureBackend` only when clients send `$closure` requests to Varnish directly, bypassing the `ontoserver` chart's Gateway/Ingress path-based routing. That is a niche setup, such as port-forwarding or exposing Varnish through a separate ingress/proxy in front of the Ontoserver chart. Without `varnish.closureBackend`, Varnish forwards `$closure` to its normal backend service, which load-balances across all Ontoserver pods and breaks the stateful closure table.
185187
>
186188
> Set it to the stable pod-0 DNS name:
187189
> ```yaml

charts/ontoserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ Ready-to-use ArgoCD Application manifests are in [`examples/argocd/`](../../exam
478478

479479
The ArgoCD examples use multi-source Applications with both the `ontoserver` and `ontoserver-extras` charts as sources, wired together so that enabling Varnish automatically routes the Ingress through it. See the [extras chart README](../../charts/ontoserver-extras/README.md#deploying-alongside-the-ontoserver-chart) for the wiring details.
480480

481-
> **Note:** The GitHub Actions CI integration tests use a similar k3d setup (single agent, no load balancer, Traefik disabled) to run `helm install` followed by `helm test`. See [`.github/workflows/ci.yml`](../.github/workflows/ci.yml) for details.
481+
> **Note:** The GitHub Actions integration workflow uses a similar k3d setup (single agent, no load balancer, Traefik disabled) to run `helm install` followed by `helm test` in both read-only and read-write modes. See [`.github/workflows/integration-tests.yml`](../.github/workflows/integration-tests.yml) for details.
482482

483483
## Parameters
484484

0 commit comments

Comments
 (0)