From 5711601b26276c04c5ed65047f247fc74dfa5520 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 21 Sep 2023 17:40:43 -0400 Subject: [PATCH 1/6] implement tests for persist test results --- dev-requirements.txt | 6 +++--- tests/functional/adapter/test_persist_test_results.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 tests/functional/adapter/test_persist_test_results.py diff --git a/dev-requirements.txt b/dev-requirements.txt index 96f252ebe..8027a53d3 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # install latest changes in dbt-core + dbt-postgres # TODO: how to switch from HEAD to x.y.latest branches after minor releases? -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-postgres&subdirectory=plugins/postgres +git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-postgres&subdirectory=plugins/postgres # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor diff --git a/tests/functional/adapter/test_persist_test_results.py b/tests/functional/adapter/test_persist_test_results.py new file mode 100644 index 000000000..75bfb5acc --- /dev/null +++ b/tests/functional/adapter/test_persist_test_results.py @@ -0,0 +1,5 @@ +from dbt.tests.adapter.persist_test_results.basic import PersistTestResults + + +class TestPersistTestResults(PersistTestResults): + pass From 979aa765889738750c83a4e455107c6cb2f0b18a Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 21 Sep 2023 17:41:10 -0400 Subject: [PATCH 2/6] implement tests for persist test results --- .changes/unreleased/Features-20230921-153707.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Features-20230921-153707.yaml diff --git a/.changes/unreleased/Features-20230921-153707.yaml b/.changes/unreleased/Features-20230921-153707.yaml new file mode 100644 index 000000000..60fe0b949 --- /dev/null +++ b/.changes/unreleased/Features-20230921-153707.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Support persisting test results as views +time: 2023-09-21T15:37:07.970722-04:00 +custom: + Author: mikealfare + Issue: "6914" From 6b9b883c5fbc411571c7fba26ccb387354d1837c Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 28 Sep 2023 22:31:21 -0400 Subject: [PATCH 3/6] update changelog and test names to reflect renamed parameter --- .changes/unreleased/Features-20230921-153707.yaml | 2 +- tests/functional/adapter/test_persist_test_results.py | 5 ----- tests/functional/adapter/test_store_test_failures.py | 5 +++++ 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 tests/functional/adapter/test_persist_test_results.py diff --git a/.changes/unreleased/Features-20230921-153707.yaml b/.changes/unreleased/Features-20230921-153707.yaml index 60fe0b949..cf2c60ad5 100644 --- a/.changes/unreleased/Features-20230921-153707.yaml +++ b/.changes/unreleased/Features-20230921-153707.yaml @@ -1,5 +1,5 @@ kind: Features -body: Support persisting test results as views +body: Support storing test failures as views time: 2023-09-21T15:37:07.970722-04:00 custom: Author: mikealfare diff --git a/tests/functional/adapter/test_persist_test_results.py b/tests/functional/adapter/test_persist_test_results.py deleted file mode 100644 index 75bfb5acc..000000000 --- a/tests/functional/adapter/test_persist_test_results.py +++ /dev/null @@ -1,5 +0,0 @@ -from dbt.tests.adapter.persist_test_results.basic import PersistTestResults - - -class TestPersistTestResults(PersistTestResults): - pass diff --git a/tests/functional/adapter/test_store_test_failures.py b/tests/functional/adapter/test_store_test_failures.py index 5d6b70fbb..2790d9807 100644 --- a/tests/functional/adapter/test_store_test_failures.py +++ b/tests/functional/adapter/test_store_test_failures.py @@ -1,3 +1,4 @@ +from dbt.tests.adapter.store_test_failures_tests.basic import StoreTestFailures from dbt.tests.adapter.store_test_failures_tests.test_store_test_failures import ( TestStoreTestFailures, ) @@ -5,3 +6,7 @@ class RedshiftTestStoreTestFailures(TestStoreTestFailures): pass + + +class TestStoreTestFailures(StoreTestFailures): + pass From b71ab34a04fcac48796bf5de4c07775091d6ce5d Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 3 Oct 2023 17:01:01 -0400 Subject: [PATCH 4/6] implement store-failures-as tests --- .../adapter/test_store_test_failures.py | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/functional/adapter/test_store_test_failures.py b/tests/functional/adapter/test_store_test_failures.py index 2790d9807..467026db5 100644 --- a/tests/functional/adapter/test_store_test_failures.py +++ b/tests/functional/adapter/test_store_test_failures.py @@ -1,12 +1,29 @@ -from dbt.tests.adapter.store_test_failures_tests.basic import StoreTestFailures +from dbt.tests.adapter.store_test_failures_tests.basic import ( + StoreTestFailuresAsGeneric, + StoreTestFailuresAsInteractions, + StoreTestFailuresAsProjectLevelOff, + StoreTestFailuresAsProjectLevelView, +) from dbt.tests.adapter.store_test_failures_tests.test_store_test_failures import ( TestStoreTestFailures, ) -class RedshiftTestStoreTestFailures(TestStoreTestFailures): +class TestRedshiftTestStoreTestFailures(TestStoreTestFailures): + pass + + +class TestRedshiftStoreTestFailuresAsInteractions(StoreTestFailuresAsInteractions): + pass + + +class TestRedshiftStoreTestFailuresAsProjectLevelOff(StoreTestFailuresAsProjectLevelOff): + pass + + +class TestRedshiftStoreTestFailuresAsProjectLevelView(StoreTestFailuresAsProjectLevelView): pass -class TestStoreTestFailures(StoreTestFailures): +class TestRedshiftStoreTestFailuresAsGeneric(StoreTestFailuresAsGeneric): pass From 0d1672d79dee69768b106c421fcbae340f31ea29 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 10 Oct 2023 18:07:06 -0400 Subject: [PATCH 5/6] revert dev requirements to point back to main on dbt-core --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 8027a53d3..96f252ebe 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ # install latest changes in dbt-core + dbt-postgres # TODO: how to switch from HEAD to x.y.latest branches after minor releases? -git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-tests-adapter&subdirectory=tests/adapter -git+https://github.com/dbt-labs/dbt-core.git@feature/materialized-tests/adap-850#egg=dbt-postgres&subdirectory=plugins/postgres +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-postgres&subdirectory=plugins/postgres # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor From f3a250b8c390f03bce5b1e7679c65cbe7cf2512d Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Tue, 10 Oct 2023 18:18:21 -0400 Subject: [PATCH 6/6] update tests to include recent tests from dbt-core --- .../adapter/test_store_test_failures.py | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/functional/adapter/test_store_test_failures.py b/tests/functional/adapter/test_store_test_failures.py index 467026db5..7f591654e 100644 --- a/tests/functional/adapter/test_store_test_failures.py +++ b/tests/functional/adapter/test_store_test_failures.py @@ -1,9 +1,4 @@ -from dbt.tests.adapter.store_test_failures_tests.basic import ( - StoreTestFailuresAsGeneric, - StoreTestFailuresAsInteractions, - StoreTestFailuresAsProjectLevelOff, - StoreTestFailuresAsProjectLevelView, -) +from dbt.tests.adapter.store_test_failures_tests import basic from dbt.tests.adapter.store_test_failures_tests.test_store_test_failures import ( TestStoreTestFailures, ) @@ -13,17 +8,25 @@ class TestRedshiftTestStoreTestFailures(TestStoreTestFailures): pass -class TestRedshiftStoreTestFailuresAsInteractions(StoreTestFailuresAsInteractions): +class TestStoreTestFailuresAsInteractions(basic.StoreTestFailuresAsInteractions): + pass + + +class TestStoreTestFailuresAsProjectLevelOff(basic.StoreTestFailuresAsProjectLevelOff): + pass + + +class TestStoreTestFailuresAsProjectLevelView(basic.StoreTestFailuresAsProjectLevelView): pass -class TestRedshiftStoreTestFailuresAsProjectLevelOff(StoreTestFailuresAsProjectLevelOff): +class TestStoreTestFailuresAsGeneric(basic.StoreTestFailuresAsGeneric): pass -class TestRedshiftStoreTestFailuresAsProjectLevelView(StoreTestFailuresAsProjectLevelView): +class TestStoreTestFailuresAsProjectLevelEphemeral(basic.StoreTestFailuresAsProjectLevelEphemeral): pass -class TestRedshiftStoreTestFailuresAsGeneric(StoreTestFailuresAsGeneric): +class TestStoreTestFailuresAsExceptions(basic.StoreTestFailuresAsExceptions): pass