Skip to content

Commit

Permalink
Rebase test
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemnoel committed Jan 7, 2025
1 parent 465878c commit 890adcf
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Cluster
metadata:
name: paradedb-ncc-1701-d
status:
readyInstances: 1
readyInstances: 2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version:
major: "17"
paradedb: "0.13.2"
cluster:
instances: 1
instances: 2
storage:
size: 256Mi
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ spec:
LIMIT 1;
EOSQL
echo -$RESULT-
test "$RESULT" = " Bluetooth-enabled speaker"
if [ "$RESULT" = " Bluetooth-enabled speaker" ]; then
echo "Test for description search passed."
else
echo "Test for description search failed."
exit 1
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: batch/v1
kind: Job
metadata:
name: paradedb-enterprise-index-test
status:
succeeded: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: batch/v1
kind: Job
metadata:
name: paradedb-enterprise-index-test
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: data-test
env:
- name: DB_URI
valueFrom:
secretKeyRef:
name: paradedb-ncc-1701-d-app
key: uri
image: alpine:3.19
command: ['sh', '-c']
args:
- |
apk --no-cache add postgresql-client
DB_URI="${DB_URI/paradedb-ncc-1701-d-rw/paradedb-ncc-1701-d-ro}"
RESULT=$(psql "$DB_URI" -t) <<-EOSQL
SELECT description
FROM mock_items_paradedb_enterprise
WHERE description @@@ '"bluetooth speaker"~1'
LIMIT 1;
EOSQL
echo -$RESULT-
if [ "$RESULT" = " Bluetooth-enabled speaker" ]; then
echo "Test for description search on replicas passed."
else
echo "Test for description search on replicas failed."
exit 1
fi
SIZE_RESULT=$(psql "$DB_URI" -t) <<-EOSQL
SELECT pg_size_pretty(pg_relation_size('search_idx'));
EOSQL
echo -$SIZE_RESULT-
if [ "$SIZE_RESULT" != " 0 bytes" ]; then
echo "Test for index size on replicas passed."
else
echo "Test for index size on replicas failed."
exit 1
fi
19 changes: 19 additions & 0 deletions charts/paradedb/test/paradedb-enterprise/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ spec:
kind: Job
- podLogs:
selector: cnpg.io/cluster=paradedb-ncc-1701-d
- podLogs:
selector: batch.kubernetes.io/job-name=paradedb-enterprise-test
- name: Verify index replication
timeouts:
apply: 1s
assert: 30s
try:
- apply:
file: 03-paradedb_replication_test.yaml
- assert:
file: 03-paradedb_replication_test-assert.yaml
catch:
- describe:
apiVersion: batch/v1
kind: Job
- podLogs:
selector: cnpg.io/cluster=paradedb-ncc-1701-d
- podLogs:
selector: batch.kubernetes.io/job-name=paradedb-enterprise-index-test
- name: Cleanup
try:
- script:
Expand Down

0 comments on commit 890adcf

Please sign in to comment.