Skip to content

Commit

Permalink
fix: Test external databases as well (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrongmeal authored May 1, 2023
1 parent 42bf263 commit 36763ef
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
20 changes: 20 additions & 0 deletions testdata/sqllogictests_bigquery/validation.slt
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Validation tests for big query external database and external tables

# External database validation

# Validation test with wrong key
statement error
CREATE EXTERNAL DATABASE wrong_key
FROM bigquery OPTIONS (
service_account_key = '{"random": "key"}',
project_id = '${GCP_PROJECT_ID}',
);

# Validation test with non-existent project
statement error
CREATE EXTERNAL DATABASE non_existant_project
FROM bigquery OPTIONS (
service_account_key = '${GCP_SERVICE_ACCOUNT_KEY}',
project_id = '${GCP_PROJECT_ID}-bad-project',
);

# External table validation

# Validation test with empty key
statement error
CREATE EXTERNAL TABLE empty_key
Expand Down
27 changes: 27 additions & 0 deletions testdata/sqllogictests_mysql/validation.slt
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Validation tests for mysql external database and external tables

# External database validation

# Validation test error with the wrong password
statement error
CREATE EXTERNAL DATABASE wrong_password
FROM mysql
OPTIONS (
connection_string = 'mysql://root:[email protected]:3307/glaredb_test',
);

statement error
CREATE EXTERNAL DATABASE non_existant_user
FROM mysql
OPTIONS (
connection_string = 'mysql://[email protected]:3307/glaredb_test',
);

# Validation test error with the wrong host
statement error
CREATE EXTERNAL DATABASE wrong_host
FROM mysql
OPTIONS (
connection_string = 'mysql://root@non-existant:3307/glaredb_test',
);

# External table validation

# Validation test error with the wrong password
statement error
CREATE EXTERNAL TABLE wrong_password
Expand Down
29 changes: 28 additions & 1 deletion testdata/sqllogictests_postgres/validation.slt
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Validation tests for postgres external database and external tables

# External database validation

# Validation test error with the wrong password
statement error
CREATE EXTERNAL DATABASE wrong_password
FROM postgres
OPTIONS (
connection_string = 'host=localhost port=5432 user=glaredb password=wrong-password dbname=glaredb_test sslmode=disable',
);

statement error
CREATE EXTERNAL DATABASE non_existant_user
FROM postgres
OPTIONS (
connection_string = 'host=localhost port=5432 user=missing password=password dbname=glaredb_test sslmode=disable',
);

# Validation test error with the wrong host
statement error
CREATE EXTERNAL DATABASE wrong_host
FROM postgres
OPTIONS (
connection_string = 'host=non-existant port=5432 user=glaredb password=password dbname=glaredb_test sslmode=disable',
);

# External table validation

# Validation test error with the wrong password
statement error
CREATE EXTERNAL TABLE wrong_password
Expand Down Expand Up @@ -39,7 +66,7 @@ CREATE EXTERNAL TABLE missing_table
table = 'missing_table'
);

# Validation test error with the wrong table name
# Validation test error with the wrong schema name
statement error
CREATE EXTERNAL TABLE missing_schema
FROM postgres
Expand Down

0 comments on commit 36763ef

Please sign in to comment.