-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests for Snowflake database (close #117) - WIP
- Loading branch information
1 parent
0ae72da
commit 330d4c8
Showing
5 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Note Ruby-flavored :s at start of YAML properties. Not required | ||
:targets: | ||
- name: "My Snowflake database" | ||
type: snowflake | ||
account: snowplow | ||
region: | ||
database: SQLRUNNER | ||
warehouse: SQLRUNNER_WH | ||
username: xxx | ||
password: xxx | ||
host: | ||
port: | ||
ssl: true # Snowflake connection is always secured by TLS | ||
variables: | ||
test_schema: sql_runner_tests | ||
timeFormat: "2006_01_02" | ||
steps: | ||
- name: Create schema and table | ||
queries: | ||
- name: Create schema and table | ||
file: snowflake-sql/good/1.sql | ||
template: true | ||
- name: Parallel load | ||
queries: | ||
- name: Parallel load 1 | ||
file: snowflake-sql/good/2a.sql | ||
template: true | ||
- name: Parallel load 2 | ||
file: snowflake-sql/good/2b.sql | ||
template: true | ||
- name: Create view | ||
queries: | ||
- name: Create view | ||
file: snowflake-sql/good/3.sql | ||
template: true |
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,9 @@ | ||
-- Test file: 1.sql | ||
|
||
DROP SCHEMA IF EXISTS {{.test_schema}} CASCADE; | ||
|
||
CREATE SCHEMA {{.test_schema}}; | ||
|
||
CREATE TABLE {{.test_schema}}.table1 ( | ||
age int | ||
); |
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,3 @@ | ||
-- Test file: 2a.sql | ||
|
||
INSERT INTO {{.test_schema}}.table1 VALUES (18); |
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,3 @@ | ||
-- Test file: 2b.sql | ||
|
||
INSERT INTO {{.test_schema}}.table1 VALUES (32); |
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,4 @@ | ||
-- Test file: 3.sql | ||
|
||
CREATE VIEW {{.test_schema}}.view_{{nowWithFormat .timeFormat}} AS | ||
SELECT AVG(age)::int AS average_age FROM {{.test_schema}}.table1; |