Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class TestGetCatalogForSingleRelation(BaseGetCatalogForSingleRelation):

### Community package integration tests

For adding integration tests for community dbt packages, use the `community-package-tests` skill. See `tests/fabric/packages/base_package_test.py` for the `BaseDbtPackageTests` base class and existing tests in the same directory for examples.
For adding integration tests for community dbt packages, use the `community-package-tests` skill. See `tests/packages/base_package_test.py` for the `BaseDbtPackageTests` base class and existing tests in the same directory for examples.

## CI/CD

Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_audit_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests


class TestDbtAuditHelper(BaseDbtPackageTests):
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_codegen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from dbt.tests.util import run_dbt
from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests


class TestDbtCodegen(BaseDbtPackageTests):
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests

_FISCAL_PERIODS_PATH = (
Path(__file__).resolve().parents[3]
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_expectations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from dbt.tests.util import run_dbt
from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests


class TestDbtExpectations(BaseDbtPackageTests):
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_external_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from azure.identity import AzureCliCredential

from dbt.tests.util import relation_from_name, run_dbt
from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests

TEST_CSV_CONTENT = (
"id,name,amount,sale_date\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from dbt.tests.util import run_dbt
from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests

# T-SQL fix for dbt_expectations.expect_column_to_exist which renders Jinja True/False
# directly in SQL (invalid in T-SQL). We patch the installed package file after dbt deps.
Expand Down
2 changes: 1 addition & 1 deletion tests/fabric/packages/test_dbt_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from tests.fabric.packages.base_package_test import BaseDbtPackageTests
from tests.packages.base_package_test import BaseDbtPackageTests


class TestDbtUtils(BaseDbtPackageTests):
Expand Down
Empty file.
44 changes: 44 additions & 0 deletions tests/fabricspark/packages/test_dbt_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import pytest

from dbt.tests.util import run_dbt
from tests.packages.base_package_test import BaseDbtPackageTests


Comment thread
sdebruyn marked this conversation as resolved.
class TestDbtDate(BaseDbtPackageTests):
@pytest.fixture(scope="class")
def package_name(self) -> str:
return "dbt_date"

@pytest.fixture(scope="class")
def package_repo(self, dbt_date_repo) -> str:
return dbt_date_repo

@pytest.fixture(scope="class")
def package_revision(self, dbt_date_revision) -> str:
return dbt_date_revision

@pytest.fixture(scope="class")
def project_vars(self):
return {"dbt_date:time_zone": "America/Los_Angeles"}

@pytest.fixture(scope="class")
def extra_dispatches(self):
return [
{
"macro_namespace": "dbt_date_integration_tests",
"search_order": [
"test_dbt_package",
"dbt",
"dbt_date_integration_tests",
],
}
]

def test_package(self, project, dbt_core_bug_workaround):
run_dbt(["deps"])
# Upstream test_dates.yml has an expression_is_true test that renders
# cast('to_date(...)' as date) — nested single quotes cause a Spark
# PARSE_SYNTAX_ERROR. This is an upstream fixture bug, not an adapter issue.
run_dbt(
["build", "--exclude", "test_name:expression_is_true"],
)
Empty file added tests/packages/__init__.py
Empty file.