feat: Add integration tests for dbt import with local dbt project #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: dbt-integration-tests | |
| # Run dbt integration tests on PRs | |
| on: | |
| pull_request: | |
| paths: | |
| - 'sdk/python/feast/dbt/**' | |
| - 'sdk/python/tests/integration/dbt/**' | |
| - 'sdk/python/tests/unit/dbt/**' | |
| - '.github/workflows/dbt-integration-tests.yml' | |
| jobs: | |
| dbt-integration-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| env: | |
| PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: make install-python-dependencies-ci | |
| - name: Install dbt and dbt-duckdb | |
| run: | | |
| uv pip install --system dbt-core dbt-duckdb | |
| - name: Run dbt commands | |
| run: | | |
| cd sdk/python/tests/integration/dbt/test_dbt_project | |
| dbt deps | |
| dbt build | |
| dbt test | |
| - name: Setup Feast project for dbt import test | |
| run: | | |
| cd sdk/python/tests/integration/dbt | |
| mkdir -p feast_repo | |
| cd feast_repo | |
| cat > feature_store.yaml << EOF | |
| project: feast_dbt_test | |
| registry: data/registry.db | |
| provider: local | |
| online_store: | |
| type: sqlite | |
| path: data/online_store.db | |
| EOF | |
| mkdir -p data | |
| - name: Test feast dbt import | |
| run: | | |
| cd sdk/python/tests/integration/dbt/feast_repo | |
| feast -c feature_store.yaml dbt import \ | |
| -m ../test_dbt_project/target/manifest.json \ | |
| -e driver_id \ | |
| -d file \ | |
| --tag feast | |
| - name: Verify feast objects were created | |
| run: | | |
| cd sdk/python/tests/integration/dbt/feast_repo | |
| feast -c feature_store.yaml feature-views list | |
| feast -c feature_store.yaml entities list | |
| - name: Run dbt integration tests | |
| run: | | |
| cd sdk/python | |
| python -m pytest tests/integration/dbt/test_dbt_integration.py -v --tb=short | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |