Skip to content

Commit

Permalink
test: Upgrade to 0.14.0 & Add test for replication (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemnoel authored Jan 13, 2025
1 parent 465878c commit 80720a4
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/paradedb/paradedb/dev/docs/logo/readme.svg" alt="ParadeDB" width="368px">
<a href="https://paradedb.com"><img src="https://raw.githubusercontent.com/paradedb/paradedb/dev/docs/logo/readme.svg" alt="ParadeDB"></a>
<br>
</h1>

Expand Down
4 changes: 2 additions & 2 deletions charts/paradedb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ icon: https://raw.githubusercontent.com/paradedb/paradedb/main/docs/logo/light.s
type: application

# The Chart version, set in the publish CI workflow from GitHub Actions Variables
# We default to v0.13.2 for testing and local development
version: 0.13.2
# We default to v0.14.0 for testing and local development
version: 0.14.0

sources:
- https://github.com/paradedb/charts
Expand Down
2 changes: 1 addition & 1 deletion charts/paradedb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| recovery.secret.create | bool | `true` | Whether to create a secret for the backup credentials |
| recovery.secret.name | string | `""` | Name of the backup credentials secret |
| type | string | `"paradedb"` | Type of the CNPG database. Available types: * `paradedb` * `paradedb-enterprise` |
| version.paradedb | string | `"0.13.2"` | We default to v0.13.2 for testing and local development |
| version.paradedb | string | `"0.14.0"` | We default to v0.14.0 for testing and local development |
| version.postgresql | string | `"17"` | PostgreSQL major version to use |
| poolers[].name | string | `` | Name of the pooler resource |
| poolers[].instances | number | `1` | The number of replicas we want |
Expand Down
2 changes: 1 addition & 1 deletion charts/paradedb/examples/image-catalog-ref.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: postgresql
mode: standalone
version:
major: "17"
paradedb: "0.13.2"
paradedb: "0.14.0"
cluster:
instances: 1
imageCatalogRef:
Expand Down
2 changes: 1 addition & 1 deletion charts/paradedb/examples/image-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: postgresql
mode: standalone
version:
major: "17"
paradedb: "0.13.2"
paradedb: "0.14.0"
cluster:
instances: 1
backups:
Expand Down
2 changes: 1 addition & 1 deletion charts/paradedb/examples/paradedb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: paradedb
mode: standalone
version:
postgresql: "17"
paradedb: "0.13.2"
paradedb: "0.14.0"
cluster:
instances: 1
backups:
Expand Down
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 @@ -2,9 +2,9 @@ type: paradedb-enterprise
mode: standalone
version:
major: "17"
paradedb: "0.13.2"
paradedb: "0.14.0"
cluster:
instances: 1
instances: 2
storage:
size: 256Mi
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
schema_name => 'public',
table_name => 'mock_items_paradedb_enterprise'
);
CREATE INDEX search_idx_paradedb_enterprise_ ON mock_items_paradedb_enterprise
CREATE INDEX search_idx_paradedb_enterprise ON mock_items_paradedb_enterprise
USING bm25 (id, description, category, rating, in_stock, created_at, metadata, weight_range)
WITH (key_field='id');
EOSQL
Expand All @@ -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_paradedb_enterprise'));
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: paradedb
mode: standalone
version:
major: "17"
paradedb: "0.13.2"
paradedb: "0.14.0"
cluster:
instances: 2
storage:
Expand Down
4 changes: 2 additions & 2 deletions charts/paradedb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ version:
# -- PostgreSQL major version to use
postgresql: "17"
# -- The ParadeDB version, set in the publish CI workflow from the latest paradedb/paradedb GitHub tag
# -- We default to v0.13.2 for testing and local development
paradedb: "0.13.2"
# -- We default to v0.14.0 for testing and local development
paradedb: "0.14.0"

###
# -- Cluster mode of operation. Available modes:
Expand Down

0 comments on commit 80720a4

Please sign in to comment.