Skip to content

Commit 586f825

Browse files
Fix test failures by removing pre-committed manifest and letting dbt generate it
Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com>
1 parent ba38da0 commit 586f825

File tree

3 files changed

+22
-187
lines changed

3 files changed

+22
-187
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore dbt artifacts
2+
*.pyc
3+
__pycache__/

sdk/python/tests/integration/dbt/test_dbt_project/README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ This directory contains a minimal dbt project used for testing the Feast dbt int
88
test_dbt_project/
99
├── dbt_project.yml # dbt project configuration
1010
├── profiles.yml # dbt connection profiles (using DuckDB for testing)
11+
├── seeds/ # CSV seed data for models
12+
│ ├── driver_hourly_stats.csv
13+
│ ├── customer_stats.csv
14+
│ └── product_stats.csv
1115
├── models/ # dbt SQL models
1216
│ ├── driver_features.sql
1317
│ ├── customer_features.sql
1418
│ ├── product_features.sql
1519
│ └── schema.yml # Model and column metadata
16-
└── target/
17-
└── manifest.json # Pre-generated dbt manifest
20+
└── target/ # dbt build output (generated, not committed)
21+
└── manifest.json # Generated by dbt build
1822
```
1923

2024
## Models
@@ -41,12 +45,12 @@ The test project includes 3 models with different configurations:
4145

4246
## Pre-generated Manifest
4347

44-
The `target/manifest.json` file is **pre-generated** and committed to the repository. This allows tests to run without requiring:
45-
- dbt CLI installation
46-
- Database connections
47-
- dbt compilation step
48+
The `target/manifest.json` file is **generated by dbt during CI runs**. The manifest is created when `dbt build` is executed in the GitHub Actions workflow. This allows the integration tests to:
49+
- Test actual dbt compilation and build process
50+
- Validate the generated manifest structure
51+
- Ensure compatibility between dbt output and Feast import
4852

49-
This approach keeps the tests fast and portable.
53+
The target directory is tracked in git with a `.gitkeep` file, but the manifest.json itself is excluded via `.gitignore` since it's generated during test execution.
5054

5155
## Testing Different Data Sources
5256

@@ -64,15 +68,13 @@ sdk/python/tests/integration/dbt/test_dbt_integration.py
6468

6569
Run them with:
6670
```bash
67-
pytest sdk/python/tests/integration/dbt/test_dbt_integration.py -v
68-
```
69-
70-
## Updating the Manifest
71+
# First, generate the manifest by running dbt
72+
cd sdk/python/tests/integration/dbt/test_dbt_project
73+
dbt build
7174

72-
If you need to update the manifest (e.g., to add new models or change metadata):
73-
74-
1. Make changes to the model SQL files or schema.yml
75-
2. Manually edit `target/manifest.json` to reflect the changes
76-
3. Ensure the manifest is valid JSON and follows dbt manifest schema v9
75+
# Then run the tests
76+
cd ../../..
77+
pytest tests/integration/dbt/test_dbt_integration.py -v
78+
```
7779

78-
**Note**: We don't actually compile with dbt CLI to keep tests simple and fast.
80+
In CI, the manifest is automatically generated by the GitHub Actions workflow before running tests.

sdk/python/tests/integration/dbt/test_dbt_project/target/manifest.json

Lines changed: 0 additions & 170 deletions
This file was deleted.

0 commit comments

Comments
 (0)