Skip to content

Commit

Permalink
Undo testing, name tables and indexes differently
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemnoel committed Dec 2, 2024
1 parent a4741a8 commit b25a9bc
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 33 deletions.
10 changes: 5 additions & 5 deletions charts/paradedb/test/paradedb-enterprise/02-paradedb_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ spec:
args:
- |
apk --no-cache add postgresql-client
psql -a "$DB_URI" <<-EOSQL
psql "$DB_URI" <<-EOSQL
CALL paradedb.create_bm25_test_table(
schema_name => 'public',
table_name => 'mock_items'
table_name => 'mock_items_paradedb_enterprise'
);
CREATE INDEX paradedb_enterprise_test_search_idx ON mock_items
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
RESULT=$(psql -a "$DB_URI" -t) <<-EOSQL
RESULT=$(psql "$DB_URI" -t) <<-EOSQL
SELECT description
FROM mock_items
FROM mock_items_paradedb_enterprise
WHERE description @@@ '"bluetooth speaker"~1'
LIMIT 1;
EOSQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ spec:
args:
- |
apk --no-cache add postgresql-client
psql -e "$DB_URI" <<-EOSQL
psql "$DB_URI" <<-EOSQL
CALL paradedb.create_bm25_test_table(
schema_name => 'public',
table_name => 'mock_items'
table_name => 'mock_items_paradedb_minio_backup_restore'
);
CREATE INDEX paradedb_write_search_idx ON mock_items
CREATE INDEX search_idx_paradedb_minio_backup_restore ON mock_items_paradedb_minio_backup_restore
USING bm25 (id, description, category, rating, in_stock, created_at, metadata, weight_range)
WITH (key_field='id');
EOSQL
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ spec:
args:
- |
apk --no-cache add postgresql-client
RESULT=$(psql -e "$DB_URI" -t) <<-EOSQL
RESULT=$(psql "$DB_URI" -t) <<-EOSQL
SELECT description
FROM mock_items
FROM mock_items_paradedb_minio_backup_restore
WHERE description @@@ '"bluetooth speaker"~1'
LIMIT 1;
EOSQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- |
apk --no-cache add postgresql-client kubectl coreutils
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
psql -e "$DB_URI" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
psql "$DB_URI" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
sleep 5
DATE_NO_BAD_TABLE=$(date --rfc-3339=ns)
kubectl create configmap date-no-bad-table --from-literal=date="$DATE_NO_BAD_TABLE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ spec:
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
END_TIME=$(( $(date +%s) + 30 ))
while [ $(date +%s) -lt $END_TIME ]; do
psql -e "$DB_URI" -c "SELECT pg_switch_wal();CHECKPOINT;"
psql "$DB_URI" -c "SELECT pg_switch_wal();CHECKPOINT;"
sleep 5
done
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ spec:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
psql -e "$DB_URI" -c "CREATE TABLE mybadtable (id serial PRIMARY KEY);"
psql "$DB_URI" -c "CREATE TABLE mybadtable (id serial PRIMARY KEY);"
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ spec:
- podLogs:
name: post-init-backup
container: backup-container
# - describe:
# apiVersion: postgresql.cnpg.io/v1
# kind: Cluster
# - podLogs:
# selector: cnpg.io/cluster=paradedb-paradedb
# - describe:
# apiVersion: batch/v1
# kind: Job
# - podLogs:
# selector: batch.kubernetes.io/job-name=backup-checkpoint
- name: Write more data to the database after the backup
try:
- apply:
Expand Down
6 changes: 3 additions & 3 deletions charts/paradedb/test/postgresql-import/01-data_write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ spec:
args:
- |
apk --no-cache add postgresql-client
psql -e "$DB_URI" -c "CREATE DATABASE mygooddb;"
psql -e "$DB_URI/mygooddb" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
psql -e "$DB_URI/mygooddb" -c "INSERT INTO mygoodtable VALUES (314159265);"
psql "$DB_URI" -c "CREATE DATABASE mygooddb;"
psql "$DB_URI/mygooddb" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
psql "$DB_URI/mygooddb" -c "INSERT INTO mygoodtable VALUES (314159265);"
4 changes: 2 additions & 2 deletions charts/paradedb/test/postgresql-import/03-data_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ spec:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
test "$(psql -e "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
test "$(psql -e "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM mygoodtable WHERE id = 314159265)' --csv -q 2>/dev/null)" = "t"
test "$(psql "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
test "$(psql "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM mygoodtable WHERE id = 314159265)' --csv -q 2>/dev/null)" = "t"
4 changes: 2 additions & 2 deletions charts/paradedb/test/postgresql-import/05-data_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ spec:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
test "$(psql -e "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
test "$(psql -e "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM mygoodtable WHERE id = 314159265)' --csv -q 2>/dev/null)" = "f"
test "$(psql "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
test "$(psql "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM mygoodtable WHERE id = 314159265)' --csv -q 2>/dev/null)" = "f"
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ spec:
args:
- |
apk --no-cache add postgresql-client
psql -e "$DB_URI" -c "CREATE DATABASE mygooddb;"
psql -e "$DB_URI/mygooddb" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
psql "$DB_URI" -c "CREATE DATABASE mygooddb;"
psql "$DB_URI/mygooddb" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
test "$(psql -e "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
test "$(psql "${DB_URI}mygooddb" -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"

0 comments on commit b25a9bc

Please sign in to comment.