Files
qdrant-helm/test/integration/random_api_key.bats
Bastian Hofmann 264b4cfe96 Fix and improve probes (#79)
* Fix probes when Qdrant is served over TLS

This also improves the integration test runtime and reliability by not installing a fresh cluster for every test but upgrading it with the new config.

Fixes https://github.com/qdrant/qdrant-helm/issues/77

* Deactivate liveness and startup probes by default

Since these probes restart the pod on failure, they can disrupt the health of the Qdrant cluster unnecessarily and cause more problems then actually help. Having a readinessProbe is usually enough.

* Fix tests

* Try to fix connection issues
2023-09-29 12:31:54 +02:00

23 lines
1.2 KiB
Bash

setup_file() {
helm upgrade --install qdrant charts/qdrant --set apiKey=true -n qdrant-helm-integration --wait
kubectl rollout status statefulset qdrant -n qdrant-helm-integration
}
@test "random api key works" {
apiKey=$(kubectl -n qdrant-helm-integration get secret qdrant-apikey -o jsonpath="{.data.api-key}" | base64 --decode)
[ ${#apiKey} -eq 32 ]
run kubectl exec -n default curl -- curl -s http://qdrant.qdrant-helm-integration:6333/collections -H "api-key: ${apiKey}" --fail-with-body
[ $status -eq 0 ]
[[ "${output}" =~ .*\"status\":\"ok\".* ]]
}
@test "random api key stays the same after upgrade" {
apiKeyBeforeUpgrade=$(kubectl -n qdrant-helm-integration get secret qdrant-apikey -o jsonpath="{.data.api-key}" | base64 --decode)
helm upgrade qdrant charts/qdrant --set apiKey=true -n qdrant-helm-integration --wait
kubectl rollout status statefulset qdrant -n qdrant-helm-integration
apiKeyAfterUpgrade=$(kubectl -n qdrant-helm-integration get secret qdrant-apikey -o jsonpath="{.data.api-key}" | base64 --decode)
[ "${apiKeyBeforeUpgrade}" = "${apiKeyAfterUpgrade}" ]
[ ${#apiKeyBeforeUpgrade} -eq 32 ]
[ ${#apiKeyAfterUpgrade} -eq 32 ]
}