From 3ccbe95ce98e32cc602b026f87bfb9ba0a494f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=BDborn=C3=BD=20Adam?= Date: Tue, 18 Jul 2023 11:59:26 +0200 Subject: [PATCH] Add tests for run action and preview sync action with shared bucket --- .../expected-code | 1 + .../expected-stdout | 1 + .../source/data/config.json | 18 ++++++++++++++++++ .../run-action-shared-bucket/expected-code | 1 + .../run-action-shared-bucket/expected-stderr | 0 .../expected/data/out/files/.gitkeep | 0 .../expected/data/out/tables/.gitkeep | 0 .../source/data/config.json | 19 +++++++++++++++++++ 8 files changed, 40 insertions(+) create mode 100644 tests/functional/preview-action-shared-bucket/expected-code create mode 100644 tests/functional/preview-action-shared-bucket/expected-stdout create mode 100644 tests/functional/preview-action-shared-bucket/source/data/config.json create mode 100644 tests/functional/run-action-shared-bucket/expected-code create mode 100644 tests/functional/run-action-shared-bucket/expected-stderr create mode 100644 tests/functional/run-action-shared-bucket/expected/data/out/files/.gitkeep create mode 100644 tests/functional/run-action-shared-bucket/expected/data/out/tables/.gitkeep create mode 100644 tests/functional/run-action-shared-bucket/source/data/config.json diff --git a/tests/functional/preview-action-shared-bucket/expected-code b/tests/functional/preview-action-shared-bucket/expected-code new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/tests/functional/preview-action-shared-bucket/expected-code @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/tests/functional/preview-action-shared-bucket/expected-stdout b/tests/functional/preview-action-shared-bucket/expected-stdout new file mode 100644 index 0000000..6c4ed22 --- /dev/null +++ b/tests/functional/preview-action-shared-bucket/expected-stdout @@ -0,0 +1 @@ +{"columns":["id","col2","col3","col4"],"rows":[[{"columnName":"id","value":"1","isTruncated":false},{"columnName":"col2","value":"a","isTruncated":false},{"columnName":"col3","value":"b","isTruncated":false},{"columnName":"col4","value":"c","isTruncated":false}]]} diff --git a/tests/functional/preview-action-shared-bucket/source/data/config.json b/tests/functional/preview-action-shared-bucket/source/data/config.json new file mode 100644 index 0000000..05b74b3 --- /dev/null +++ b/tests/functional/preview-action-shared-bucket/source/data/config.json @@ -0,0 +1,18 @@ +{ + "action": "preview", + "parameters": { + "tableName": "test", + "bucketId": "in.c-test-bucket", + "models": [ + {"code": "SELECT * FROM {{ ref('%model%') }} WHERE \"id\" = 1"} + ], + "authorization": { + "host": "%env(string:SNOWFLAKE_HOST)%", + "warehouse": "%env(string:SNOWFLAKE_WAREHOUSE)%", + "database": "%env(string:SNOWFLAKE_DATABASE)%", + "schema": "%env(string:SNOWFLAKE_SCHEMA)%", + "user": "%env(string:SNOWFLAKE_USER)%", + "#password": "%env(string:SNOWFLAKE_PASSWORD)%" + } + } +} diff --git a/tests/functional/run-action-shared-bucket/expected-code b/tests/functional/run-action-shared-bucket/expected-code new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/tests/functional/run-action-shared-bucket/expected-code @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/tests/functional/run-action-shared-bucket/expected-stderr b/tests/functional/run-action-shared-bucket/expected-stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/functional/run-action-shared-bucket/expected/data/out/files/.gitkeep b/tests/functional/run-action-shared-bucket/expected/data/out/files/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/functional/run-action-shared-bucket/expected/data/out/tables/.gitkeep b/tests/functional/run-action-shared-bucket/expected/data/out/tables/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/functional/run-action-shared-bucket/source/data/config.json b/tests/functional/run-action-shared-bucket/source/data/config.json new file mode 100644 index 0000000..caa9a53 --- /dev/null +++ b/tests/functional/run-action-shared-bucket/source/data/config.json @@ -0,0 +1,19 @@ +{ + "authorization": { + "workspace": { + "host": "%env(string:SNOWFLAKE_HOST)%", + "warehouse": "%env(string:SNOWFLAKE_WAREHOUSE)%", + "database": "%env(string:SNOWFLAKE_DATABASE)%", + "schema": "%env(string:SNOWFLAKE_SCHEMA)%", + "user": "%env(string:SNOWFLAKE_USER)%", + "password": "%env(string:SNOWFLAKE_PASSWORD)%" + } + }, + "parameters": { + "tableName": "test", + "bucketId": "in.c-test-bucket", + "models": [ + {"code": "SELECT * FROM {{ ref('%model%') }} WHERE \"id\" = 1"} + ] + } +}