From 82f3840cde53b0d4b6ee9606d2977faa721516f6 Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Thu, 21 Oct 2021 17:00:07 -0500 Subject: [PATCH 1/3] making changes to match dbt-core test -> tests naming scheme and updating seeds-path to yaml files --- pytest_dbt_adapter/projects/base.yml | 5 +- .../projects/data_test_ephemerals.yml | 11 +++- pytest_dbt_adapter/projects/data_tests.yml | 9 ++- pytest_dbt_adapter/projects/ephemeral.yml | 5 +- pytest_dbt_adapter/projects/incremental.yml | 55 ++++++++++--------- pytest_dbt_adapter/projects/schema_tests.yml | 7 ++- pytest_dbt_adapter/projects/snapshot_cc.yml | 9 ++- pytest_dbt_adapter/projects/snapshot_ts.yml | 9 ++- 8 files changed, 68 insertions(+), 42 deletions(-) diff --git a/pytest_dbt_adapter/projects/base.yml b/pytest_dbt_adapter/projects/base.yml index dc21952..edaf8f6 100644 --- a/pytest_dbt_adapter/projects/base.yml +++ b/pytest_dbt_adapter/projects/base.yml @@ -1,6 +1,6 @@ name: base paths: - seeds/base.csv: files.seeds.base + data/base.csv: files.seeds.base models/view_model.sql: files.models.base_view models/table_model.sql: files.models.base_table models/swappable.sql: files.models.base_materialized_var @@ -8,7 +8,8 @@ paths: dbt_project_yml: models: dbt_test_project: - + seed-paths: + - data facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/data_test_ephemerals.yml b/pytest_dbt_adapter/projects/data_test_ephemerals.yml index ac273ae..6bd9174 100644 --- a/pytest_dbt_adapter/projects/data_test_ephemerals.yml +++ b/pytest_dbt_adapter/projects/data_test_ephemerals.yml @@ -1,12 +1,17 @@ name: data_test_ephemeral_models paths: - seeds/base.csv: files.seeds.base + data/base.csv: files.seeds.base models/ephemeral.sql: files.models.ephemeral_with_cte models/passing_model.sql: files.tests.ephemeral.passing models/failing_model.sql: files.tests.ephemeral.failing models/schema.yml: files.schemas.base - test/passing.sql: files.tests.ephemeral.passing - test/failing.sql: files.tests.ephemeral.failing + tests/passing.sql: files.tests.ephemeral.passing + tests/failing.sql: files.tests.ephemeral.failing +dbt_project_yml: + test-paths: + - tests + seed-paths: + - data facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/data_tests.yml b/pytest_dbt_adapter/projects/data_tests.yml index c043b9d..d227635 100644 --- a/pytest_dbt_adapter/projects/data_tests.yml +++ b/pytest_dbt_adapter/projects/data_tests.yml @@ -1,7 +1,12 @@ name: data_tests paths: - test/passing.sql: files.tests.passing - test/failing.sql: files.tests.failing + tests/passing.sql: files.tests.passing + tests/failing.sql: files.tests.failing +dbt_project_yml: + test-paths: + - tests + seed-paths: + - data facts: test: length: 2 diff --git a/pytest_dbt_adapter/projects/ephemeral.yml b/pytest_dbt_adapter/projects/ephemeral.yml index 7690135..235af59 100644 --- a/pytest_dbt_adapter/projects/ephemeral.yml +++ b/pytest_dbt_adapter/projects/ephemeral.yml @@ -1,10 +1,13 @@ name: ephemeral paths: - seeds/base.csv: files.seeds.base + data/base.csv: files.seeds.base models/ephemeral.sql: files.models.ephemeral models/view_model.sql: files.models.ephemeral_view models/table_model.sql: files.models.ephemeral_table models/schema.yml: files.schemas.base +dbt_project_yml: + seed-paths: + - data facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/incremental.yml b/pytest_dbt_adapter/projects/incremental.yml index 26473d6..702fa5a 100644 --- a/pytest_dbt_adapter/projects/incremental.yml +++ b/pytest_dbt_adapter/projects/incremental.yml @@ -1,29 +1,32 @@ name: incremental paths: - seeds/base.csv: files.seeds.base - seeds/added.csv: files.seeds.added - models/incremental.sql: files.models.incremental - models/schema.yml: files.schemas.base + data/base.csv: files.seeds.base + data/added.csv: files.seeds.added + models/incremental.sql: files.models.incremental + models/schema.yml: files.schemas.base +dbt_project_yml: + seed-paths: + - data facts: - seed: - length: 2 - names: - - base - - added - run: - length: 1 - names: - - incremental - catalog: - nodes: - length: 3 - sources: - length: 1 - persisted_relations: - - base - - added - - incremental - base: - rowcount: 10 - added: - rowcount: 20 + seed: + length: 2 + names: + - base + - added + run: + length: 1 + names: + - incremental + catalog: + nodes: + length: 3 + sources: + length: 1 + persisted_relations: + - base + - added + - incremental + base: + rowcount: 10 + added: + rowcount: 20 diff --git a/pytest_dbt_adapter/projects/schema_tests.yml b/pytest_dbt_adapter/projects/schema_tests.yml index 12f3f00..1dc672a 100644 --- a/pytest_dbt_adapter/projects/schema_tests.yml +++ b/pytest_dbt_adapter/projects/schema_tests.yml @@ -1,12 +1,15 @@ name: schema_tests paths: - seeds/base.csv: files.seeds.base - seeds/schema.yml: files.schemas.test_seed + data/base.csv: files.seeds.base + data/schema.yml: files.schemas.test_seed models/view_model.sql: files.models.base_view models/table_model.sql: files.models.base_table models/schema.yml: files.schemas.base models/schema_view.yml: files.schemas.test_view models/schema_table.yml: files.schemas.test_table +dbt_project_yml: + seed-paths: + - data facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/snapshot_cc.yml b/pytest_dbt_adapter/projects/snapshot_cc.yml index b2d83a4..ea2d11e 100644 --- a/pytest_dbt_adapter/projects/snapshot_cc.yml +++ b/pytest_dbt_adapter/projects/snapshot_cc.yml @@ -1,11 +1,14 @@ name: snapshot_strategy_check_cols paths: - seeds/base.csv: files.seeds.base - seeds/newcolumns.csv: files.seeds.newcolumns - seeds/added.csv: files.seeds.added + data/base.csv: files.seeds.base + data/newcolumns.csv: files.seeds.newcolumns + data/added.csv: files.seeds.added snapshots/cc_all_snapshot.sql: files.snapshots.check_cols_all snapshots/cc_date_snapshot.sql: files.snapshots.check_cols_date snapshots/cc_name_snapshot.sql: files.snapshots.check_cols_name +dbt_project_yml: + seed-paths: + - data facts: seed: length: 3 diff --git a/pytest_dbt_adapter/projects/snapshot_ts.yml b/pytest_dbt_adapter/projects/snapshot_ts.yml index e31430d..2e40d28 100644 --- a/pytest_dbt_adapter/projects/snapshot_ts.yml +++ b/pytest_dbt_adapter/projects/snapshot_ts.yml @@ -1,9 +1,12 @@ name: snapshot_strategy_timestamp paths: - seeds/base.csv: files.seeds.base - seeds/newcolumns.csv: files.seeds.newcolumns - seeds/added.csv: files.seeds.added + data/base.csv: files.seeds.base + data/newcolumns.csv: files.seeds.newcolumns + data/added.csv: files.seeds.added snapshots/ts_snapshot.sql: files.snapshots.timestamp +dbt_project_yml: + seed-paths: + - data facts: seed: length: 3 From 8de789bf3a9e89e096f2e795b5f13efa4ab04337 Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Tue, 26 Oct 2021 09:48:20 -0500 Subject: [PATCH 2/3] changed seed-path back to seeds from data --- pytest_dbt_adapter/projects/base.yml | 5 ++--- pytest_dbt_adapter/projects/data_test_ephemerals.yml | 5 ++--- pytest_dbt_adapter/projects/data_tests.yml | 3 +-- pytest_dbt_adapter/projects/ephemeral.yml | 6 ++---- pytest_dbt_adapter/projects/incremental.yml | 7 ++----- pytest_dbt_adapter/projects/schema_tests.yml | 8 +++----- pytest_dbt_adapter/projects/snapshot_cc.yml | 10 ++++------ pytest_dbt_adapter/projects/snapshot_ts.yml | 10 ++++------ 8 files changed, 20 insertions(+), 34 deletions(-) diff --git a/pytest_dbt_adapter/projects/base.yml b/pytest_dbt_adapter/projects/base.yml index edaf8f6..21be4ea 100644 --- a/pytest_dbt_adapter/projects/base.yml +++ b/pytest_dbt_adapter/projects/base.yml @@ -1,6 +1,6 @@ name: base paths: - data/base.csv: files.seeds.base + seeds/base.csv: files.seeds.base models/view_model.sql: files.models.base_view models/table_model.sql: files.models.base_table models/swappable.sql: files.models.base_materialized_var @@ -8,8 +8,7 @@ paths: dbt_project_yml: models: dbt_test_project: - seed-paths: - - data + facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/data_test_ephemerals.yml b/pytest_dbt_adapter/projects/data_test_ephemerals.yml index 6bd9174..670a41c 100644 --- a/pytest_dbt_adapter/projects/data_test_ephemerals.yml +++ b/pytest_dbt_adapter/projects/data_test_ephemerals.yml @@ -1,6 +1,6 @@ name: data_test_ephemeral_models paths: - data/base.csv: files.seeds.base + seeds/base.csv: files.seeds.base models/ephemeral.sql: files.models.ephemeral_with_cte models/passing_model.sql: files.tests.ephemeral.passing models/failing_model.sql: files.tests.ephemeral.failing @@ -10,8 +10,7 @@ paths: dbt_project_yml: test-paths: - tests - seed-paths: - - data + facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/data_tests.yml b/pytest_dbt_adapter/projects/data_tests.yml index d227635..b7f500a 100644 --- a/pytest_dbt_adapter/projects/data_tests.yml +++ b/pytest_dbt_adapter/projects/data_tests.yml @@ -5,8 +5,7 @@ paths: dbt_project_yml: test-paths: - tests - seed-paths: - - data + facts: test: length: 2 diff --git a/pytest_dbt_adapter/projects/ephemeral.yml b/pytest_dbt_adapter/projects/ephemeral.yml index 235af59..0ebf8b2 100644 --- a/pytest_dbt_adapter/projects/ephemeral.yml +++ b/pytest_dbt_adapter/projects/ephemeral.yml @@ -1,13 +1,11 @@ name: ephemeral paths: - data/base.csv: files.seeds.base + seeds/base.csv: files.seeds.base models/ephemeral.sql: files.models.ephemeral models/view_model.sql: files.models.ephemeral_view models/table_model.sql: files.models.ephemeral_table models/schema.yml: files.schemas.base -dbt_project_yml: - seed-paths: - - data + facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/incremental.yml b/pytest_dbt_adapter/projects/incremental.yml index 702fa5a..efa97fd 100644 --- a/pytest_dbt_adapter/projects/incremental.yml +++ b/pytest_dbt_adapter/projects/incremental.yml @@ -1,12 +1,9 @@ name: incremental paths: - data/base.csv: files.seeds.base - data/added.csv: files.seeds.added + seeds/base.csv: files.seeds.base + seeds/added.csv: files.seeds.added models/incremental.sql: files.models.incremental models/schema.yml: files.schemas.base -dbt_project_yml: - seed-paths: - - data facts: seed: length: 2 diff --git a/pytest_dbt_adapter/projects/schema_tests.yml b/pytest_dbt_adapter/projects/schema_tests.yml index 1dc672a..ab49b71 100644 --- a/pytest_dbt_adapter/projects/schema_tests.yml +++ b/pytest_dbt_adapter/projects/schema_tests.yml @@ -1,15 +1,13 @@ name: schema_tests paths: - data/base.csv: files.seeds.base - data/schema.yml: files.schemas.test_seed + seeds/base.csv: files.seeds.base + seeds/schema.yml: files.schemas.test_seed models/view_model.sql: files.models.base_view models/table_model.sql: files.models.base_table models/schema.yml: files.schemas.base models/schema_view.yml: files.schemas.test_view models/schema_table.yml: files.schemas.test_table -dbt_project_yml: - seed-paths: - - data + facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/snapshot_cc.yml b/pytest_dbt_adapter/projects/snapshot_cc.yml index ea2d11e..9f42ec8 100644 --- a/pytest_dbt_adapter/projects/snapshot_cc.yml +++ b/pytest_dbt_adapter/projects/snapshot_cc.yml @@ -1,14 +1,12 @@ name: snapshot_strategy_check_cols paths: - data/base.csv: files.seeds.base - data/newcolumns.csv: files.seeds.newcolumns - data/added.csv: files.seeds.added + seeds/base.csv: files.seeds.base + seeds/newcolumns.csv: files.seeds.newcolumns + seeds/added.csv: files.seeds.added snapshots/cc_all_snapshot.sql: files.snapshots.check_cols_all snapshots/cc_date_snapshot.sql: files.snapshots.check_cols_date snapshots/cc_name_snapshot.sql: files.snapshots.check_cols_name -dbt_project_yml: - seed-paths: - - data + facts: seed: length: 3 diff --git a/pytest_dbt_adapter/projects/snapshot_ts.yml b/pytest_dbt_adapter/projects/snapshot_ts.yml index 2e40d28..76810d0 100644 --- a/pytest_dbt_adapter/projects/snapshot_ts.yml +++ b/pytest_dbt_adapter/projects/snapshot_ts.yml @@ -1,12 +1,10 @@ name: snapshot_strategy_timestamp paths: - data/base.csv: files.seeds.base - data/newcolumns.csv: files.seeds.newcolumns - data/added.csv: files.seeds.added + seeds/base.csv: files.seeds.base + seeds/newcolumns.csv: files.seeds.newcolumns + seeds/added.csv: files.seeds.added snapshots/ts_snapshot.sql: files.snapshots.timestamp -dbt_project_yml: - seed-paths: - - data + facts: seed: length: 3 From 1a3edc57e9bad3b78fea491c0b12c62ac033d6cd Mon Sep 17 00:00:00 2001 From: Matthew McKnight Date: Wed, 27 Oct 2021 10:40:31 -0500 Subject: [PATCH 3/3] removing some excess spaces in base.yml --- pytest_dbt_adapter/projects/base.yml | 2 +- pytest_dbt_adapter/projects/incremental.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pytest_dbt_adapter/projects/base.yml b/pytest_dbt_adapter/projects/base.yml index 21be4ea..dc21952 100644 --- a/pytest_dbt_adapter/projects/base.yml +++ b/pytest_dbt_adapter/projects/base.yml @@ -8,7 +8,7 @@ paths: dbt_project_yml: models: dbt_test_project: - + facts: seed: length: 1 diff --git a/pytest_dbt_adapter/projects/incremental.yml b/pytest_dbt_adapter/projects/incremental.yml index efa97fd..13ea829 100644 --- a/pytest_dbt_adapter/projects/incremental.yml +++ b/pytest_dbt_adapter/projects/incremental.yml @@ -4,6 +4,7 @@ paths: seeds/added.csv: files.seeds.added models/incremental.sql: files.models.incremental models/schema.yml: files.schemas.base + facts: seed: length: 2