Skip to content

Commit 2b546dd

Browse files
committed
Fix expected data type in integration_test
1 parent db08608 commit 2b546dd

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ services:
44
image: cimg/postgres:17.0
55
environment:
66
- POSTGRES_USER=root
7+
- POSTGRES_DATABASE=codegen_test
8+
- POSTGRES_PASSWORD=password
9+
- POSTGRES_SCHEMA=codegen_integration_tests_postgres
710
ports:
811
- "5432:5432"

integration_tests/macros/bool_type_value.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{%- macro bool_type_value(case_sensitive=False) -%}
22
{%- if target.type == "redshift" -%}
3-
{%- if case_sensitive -%}BOOLEAN{%- else -%}boolean{%- endif -%}
3+
boolean
44
{%- elif target.type == "snowflake" -%}
55
{%- if case_sensitive -%}BOOLEAN{%- else -%}boolean{%- endif -%}
66
{%- elif target.type == "bigquery" -%}
7-
{%- if case_sensitive -%}BOOL{%- else -%}bool{%- endif -%}
7+
{%- if case_sensitive -%}BOOLEAN{%- else -%}boolean{%- endif -%}
88
{%- elif target.type == "postgres" -%}
99
boolean
1010
{%- else -%}

integration_tests/macros/integer_type_value.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{%- macro integer_type_value(case_sensitive=False) -%}
2-
{%- if target.type == "snowflake" -%}
2+
{%- if target.type == "redshift" -%}
3+
integer
4+
{%- elif target.type == "snowflake" -%}
35
{%- if case_sensitive -%}NUMBER{%- else -%}number{%- endif -%}
46
{%- elif target.type == "bigquery" -%}
57
{%- if case_sensitive -%}INT64{%- else -%}int64{%- endif -%}

integration_tests/macros/text_type_value.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{%- macro text_type_value(case_sensitive=False) -%}
22
{%- if target.type == "redshift"-%}
3-
{%- if case_sensitive -%}CHARACTER VARYING{%- else -%}character varying{%- endif -%}
3+
text
44
{%- elif target.type == "snowflake" -%}
55
{%- if case_sensitive -%}VARCHAR{%- else -%}varchar{%- endif -%}
66
{%- elif target.type == "bigquery" -%}

run_test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ echo `pwd`
44
cd integration_tests
55
cp ci/sample.profiles.yml profiles.yml
66

7+
export POSTGRES_HOST=localhost
8+
export POSTGRES_USER=root
9+
export DBT_ENV_SECRET_POSTGRES_PASS=password
10+
export POSTGRES_PORT=5432
11+
export POSTGRES_DATABASE=codegen_test
12+
export POSTGRES_SCHEMA=codegen_integration_tests_postgres
13+
14+
# Create database if it doesn't exist
15+
PGPASSWORD=$DBT_ENV_SECRET_POSTGRES_PASS psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -tc "SELECT 1 FROM pg_database WHERE datname = '$POSTGRES_DATABASE'" | grep -q 1 || \
16+
PGPASSWORD=$DBT_ENV_SECRET_POSTGRES_PASS psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -c "CREATE DATABASE $POSTGRES_DATABASE"
17+
18+
dbt --warn-error clean --target $1 || exit 1
719
dbt --warn-error deps --target $1 || exit 1
820
dbt --warn-error run-operation create_source_table --target $1 || exit 1
921
dbt --warn-error seed --target $1 --full-refresh || exit 1

0 commit comments

Comments
 (0)