Skip to content

Commit

Permalink
add test + new db configuration stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Nov 19, 2019
1 parent 2869467 commit 77252de
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 1 as id
44 changes: 43 additions & 1 deletion test/integration/001_simple_copy_test/test_simple_copy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
from pytest import mark

from test.integration.base import DBTIntegrationTest, use_profile


Expand Down Expand Up @@ -329,7 +332,7 @@ def test__snowflake__incremental_overwrite(self):
class TestShouting(BaseTestSimpleCopy):
@property
def models(self):
return self.dir('shouting_models')
return self.dir('models-shouting')

@property
def project_config(self):
Expand All @@ -351,3 +354,42 @@ def test__postgres__simple_copy_loud(self):
self.assertEqual(len(results), 7)

self.assertManyTablesEqual(["seed", "VIEW_MODEL", "INCREMENTAL", "MATERIALIZED", "GET_AND_REF"])


# I give up on getting this working for Windows.
@mark.skipif(os.name == 'nt', reason='mixed-case postgres database tests are not supported on Windows')
class TestMixedCaseDatabase(BaseTestSimpleCopy):
@property
def models(self):
return self.dir('models-trivial')

def postgres_profile(self):
return {
'config': {
'send_anonymous_usage_stats': False
},
'test': {
'outputs': {
'default2': {
'type': 'postgres',
'threads': 4,
'host': self.database_host,
'port': 5432,
'user': 'root',
'pass': 'password',
'dbname': 'dbtMixedCase',
'schema': self.unique_schema()
},
},
'target': 'default2'
}
}

@property
def project_config(self):
return {}

@use_profile('postgres')
def test_postgres_run_mixed_case(self):
self.run_dbt()
self.run_dbt()
3 changes: 3 additions & 0 deletions test/setup_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ psql -c "CREATE ROLE noaccess WITH PASSWORD 'password' NOSUPERUSER;"
psql -c "ALTER ROLE noaccess WITH LOGIN;"
psql -c "GRANT CONNECT ON DATABASE dbt TO noaccess;"

psql -c 'CREATE DATABASE "dbtMixedCase";'
psql -c 'GRANT CREATE, CONNECT ON DATABASE "dbtMixedCase" TO root WITH GRANT OPTION;'

set +x

0 comments on commit 77252de

Please sign in to comment.