From aa7c2cb06795dc8b5d92a3cb293d7fe88137449f Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 11 Oct 2023 21:15:34 -0400 Subject: [PATCH] remove test_get_last_relation_modified.py for CI troubleshooting --- .../test_get_last_relation_modified.py | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 tests/functional/adapter/test_get_last_relation_modified.py diff --git a/tests/functional/adapter/test_get_last_relation_modified.py b/tests/functional/adapter/test_get_last_relation_modified.py deleted file mode 100644 index 60547cd49..000000000 --- a/tests/functional/adapter/test_get_last_relation_modified.py +++ /dev/null @@ -1,61 +0,0 @@ -import os -import pytest - -from dbt.cli.main import dbtRunner - - -freshness_via_metadata_schema_yml = """version: 2 -sources: - - name: test_source - freshness: - warn_after: {count: 10, period: hour} - error_after: {count: 1, period: day} - schema: "{{ env_var('DBT_GET_LAST_RELATION_TEST_SCHEMA') }}" - tables: - - name: test_table -""" - - -class TestGetLastRelationModified: - @pytest.fixture(scope="class", autouse=True) - def set_env_vars(self, project): - os.environ["DBT_GET_LAST_RELATION_TEST_SCHEMA"] = project.test_schema - yield - del os.environ["DBT_GET_LAST_RELATION_TEST_SCHEMA"] - - @pytest.fixture(scope="class") - def models(self): - return {"schema.yml": freshness_via_metadata_schema_yml} - - @pytest.fixture(scope="class") - def custom_schema(self, project, set_env_vars): - with project.adapter.connection_named("__test"): - relation = project.adapter.Relation.create( - database=project.database, schema=os.environ["DBT_GET_LAST_RELATION_TEST_SCHEMA"] - ) - project.adapter.drop_schema(relation) - project.adapter.create_schema(relation) - - yield relation.schema - - with project.adapter.connection_named("__test"): - project.adapter.drop_schema(relation) - - @pytest.mark.skip() - def test_get_last_relation_modified(self, project, set_env_vars, custom_schema): - project.run_sql( - f"create table {custom_schema}.test_table (id integer autoincrement, name varchar(100) not null);" - ) - - warning_or_error = False - - def probe(e): - nonlocal warning_or_error - if e.info.level in ["warning", "error"]: - warning_or_error = True - - runner = dbtRunner(callbacks=[probe]) - runner.invoke(["source", "freshness"]) - - # The 'source freshness' command should succeed without warnings or errors. - assert not warning_or_error