-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathconftest.py
More file actions
35 lines (27 loc) · 1.2 KB
/
conftest.py
File metadata and controls
35 lines (27 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Conftest for dbt integration tests.
This is a standalone conftest that doesn't depend on the main Feast test infrastructure.
"""
from pathlib import Path
import pytest
# This conftest is minimal and doesn't import the main feast conftest
# to avoid complex dependency chains for dbt-specific tests
# Path to the test dbt project manifest
TEST_DBT_PROJECT_DIR = Path(__file__).parent / "test_dbt_project"
TEST_MANIFEST_PATH = TEST_DBT_PROJECT_DIR / "target" / "manifest.json"
def pytest_collection_modifyitems(config, items): # noqa: ARG001
"""
Skip dbt integration tests if manifest.json doesn't exist.
These tests require running 'dbt build' first to generate the manifest.
The dbt-integration-test workflow handles this, but regular unit test
runs don't, so we skip them to avoid failures.
"""
if not TEST_MANIFEST_PATH.exists():
skip_marker = pytest.mark.skip(
reason="dbt manifest.json not found - run 'dbt build' first or use dbt-integration-test workflow"
)
for item in items:
if str(TEST_DBT_PROJECT_DIR) in str(item.fspath) or "/dbt/" in str(
item.fspath
):
item.add_marker(skip_marker)