forked from cloudnative-pg/charts
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Philippe Noël <[email protected]>
- Loading branch information
1 parent
bf80138
commit 770759d
Showing
13 changed files
with
178 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
charts/paradedb/test/paradedb-enterprise/01-paradedb-NCC-1701-D_cluster-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: postgresql.cnpg.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: paradedb-ncc-1701-d | ||
status: | ||
readyInstances: 1 |
12 changes: 12 additions & 0 deletions
12
charts/paradedb/test/paradedb-enterprise/01-paradedb-NCC-1701-D_cluster.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type: paradedb-enterprise | ||
mode: standalone | ||
|
||
cluster: | ||
instances: 1 | ||
storage: | ||
size: 256Mi | ||
imagePullSecrets: | ||
- name: paradedb-enterprise-registry-cred | ||
|
||
backups: | ||
enabled: false |
6 changes: 6 additions & 0 deletions
6
charts/paradedb/test/paradedb-enterprise/02-paradedb_test-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: paradedb-enterprise-test | ||
status: | ||
succeeded: 1 |
46 changes: 46 additions & 0 deletions
46
charts/paradedb/test/paradedb-enterprise/02-paradedb_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: paradedb-enterprise-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 | ||
psql "$DB_URI" <<-EOSQL | ||
CALL paradedb.create_bm25_test_table( | ||
schema_name => 'public', | ||
table_name => 'mock_items' | ||
); | ||
CALL paradedb.create_bm25( | ||
index_name => 'search_idx', | ||
table_name => 'mock_items', | ||
key_field => 'id', | ||
text_fields => paradedb.field('description') || paradedb.field('category'), | ||
numeric_fields => paradedb.field('rating'), | ||
boolean_fields => paradedb.field('in_stock'), | ||
datetime_fields => paradedb.field('created_at'), | ||
json_fields => paradedb.field('metadata'), | ||
range_fields => paradedb.field('weight_range') | ||
); | ||
EOSQL | ||
RESULT=$(psql "$DB_URI" -t) <<-EOSQL | ||
SELECT description | ||
FROM mock_items | ||
WHERE description @@@ '"bluetooth speaker"~1' | ||
LIMIT 1; | ||
EOSQL | ||
echo -$RESULT- | ||
test "$RESULT" = " Bluetooth-enabled speaker" |
54 changes: 54 additions & 0 deletions
54
charts/paradedb/test/paradedb-enterprise/chainsaw-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## | ||
# This test sets up a ParadeDB Enterprise Cluster and ensures that ParadeDB extensions are available. | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: paradedb-enterprise | ||
spec: | ||
timeouts: | ||
apply: 1s | ||
assert: 2m | ||
cleanup: 1m | ||
steps: | ||
- name: Install a standalone ParadeDB Enterprise CNPG Cluster | ||
try: | ||
- script: | ||
content: | | ||
kubectl -n $NAMESPACE create secret docker-registry paradedb-enterprise-registry-cred --docker-server="https://index.docker.io/v1/" --docker-username="$PARADEDB_ENTERPRISE_DOCKER_USERNAME" --docker-password="$PARADEDB_ENTERPRISE_DOCKER_PAT" | ||
helm upgrade \ | ||
--install \ | ||
--namespace $NAMESPACE \ | ||
--values ./01-paradedb-NCC-1701-D_cluster.yaml \ | ||
--wait \ | ||
paradedb-ncc-1701-d ../../ | ||
- assert: | ||
file: ./01-paradedb-NCC-1701-D_cluster-assert.yaml | ||
catch: | ||
- describe: | ||
apiVersion: v1 | ||
kind: Pod | ||
- describe: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
- podLogs: | ||
selector: cnpg.io/cluster=paradedb-ncc-1701-d | ||
- name: Verify ParadeDB Enterprise extensions are installed | ||
timeouts: | ||
apply: 1s | ||
assert: 30s | ||
try: | ||
- apply: | ||
file: 02-paradedb_test.yaml | ||
- assert: | ||
file: 02-paradedb_test-assert.yaml | ||
catch: | ||
- describe: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
- podLogs: | ||
selector: batch.kubernetes.io/job-name=data-test | ||
- name: Cleanup | ||
try: | ||
- script: | ||
content: | | ||
helm uninstall --namespace $NAMESPACE paradedb-ncc-1701-d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters