Skip to content

Commit

Permalink
Fix docs generate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Jul 24, 2018
1 parent 04e02b8 commit f28eaa1
Showing 1 changed file with 123 additions and 5 deletions.
128 changes: 123 additions & 5 deletions test/integration/029_docs_generate_tests/test_docs_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,67 @@ def test__bigquery__nested_models(self):
},
}
self.verify_manifest(expected_manifest)
@use_profile('redshift')
def test__redshift__run_and_generate(self):
self.run_and_generate()
my_schema_name = self.unique_schema()
expected_cols = [
{
'name': 'id',
'index': 1,
'type': 'integer',
'comment': None,
},
{
'name': 'first_name',
'index': 2,
'type': 'character varying',
'comment': None,
},
{
'name': 'email',
'index': 3,
'type': 'character varying',
'comment': None,
},
{
'name': 'ip_address',
'index': 4,
'type': 'character varying',
'comment': None,
},
{
'name': 'updated_at',
'index': 5,
'type': 'timestamp without time zone',
'comment': None,
},
]
expected_catalog = {
'model': {
'metadata': {
'schema': my_schema_name,
'name': 'model',
'type': 'VIEW',
'comment': None,
},
'columns': expected_cols,
},
'seed': {
'metadata': {
'schema': my_schema_name,
'name': 'seed',
'type': 'BASE TABLE',
'comment': None,
},
'columns': expected_cols,
},
}
self.verify_catalog(expected_catalog)
self.verify_manifest(self.expected_manifest())

@attr(type='redshift')
@use_profile('redshift')
def test__redshift__incremental_view(self):
self.use_profile('redshift')
self.run_and_generate({'source-paths': [self.dir('rs_models')]})
my_schema_name = self.unique_schema()
expected_catalog = {
Expand Down Expand Up @@ -572,6 +629,67 @@ def test__redshift__incremental_view(self):
},
}
self.verify_catalog(expected_catalog)
# TODO: This is wrong and being wrong means we hang forever.
# Merge in when bigquery is fixed
# self.verify_manifest()
model_sql_path = self.dir('rs_models/model.sql')
expected_manifest = {
"nodes": {
"model.test.model": {
"name": "model",
"root_path": os.getcwd(),
"resource_type": "model",
"path": "model.sql",
"original_file_path": ,
"package_name": "test",
"raw_sql": open(model_sql_path).read().rstrip('\n'),
"refs": [["seed"]],
"depends_on": {
"nodes": ["seed.test.seed"],
"macros": [],
},
"unique_id": "model.test.model",
"empty": False,
"fqn": ["test", "model"],
"tags": [],
"config": {
"enabled": True,
"materialized": "view",
"pre-hook": [],
"post-hook": [],
"vars": {},
"column_types": {},
"quoting": {},
},
"schema": my_schema_name,
"alias": "model"
},
"seed.test.seed": {
"path": "seed.csv",
"name": "seed",
"root_path": os.getcwd(),
"resource_type": "seed",
"raw_sql": "-- csv --",
"package_name": "test",
"original_file_path": self.dir("seed/seed.csv"),
"refs": [],
"depends_on": {
"nodes": [],
"macros": [],
},
"unique_id": "seed.test.seed",
"empty": False,
"fqn": ["test", "seed"],
"tags": [],
"config": {
"enabled": True,
"materialized": "seed",
"pre-hook": [],
"post-hook": [],
"vars": {},
"column_types": {},
"quoting": {},
},
"schema": my_schema_name,
"alias": "seed"
},
},
}
self.verify_manifest(expected_manifest)

0 comments on commit f28eaa1

Please sign in to comment.