You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Detailed explanation of custom dbt facets and validation warnings
58
+
- Analysis of what's tested vs. what's not tested and why
59
+
- Recommendations for future coverage improvements
60
+
- Resolution status for known validation warnings
56
61
57
62
## Test Structure
58
63
@@ -75,54 +80,174 @@ producer/dbt/
75
80
76
81
## How to Run the Tests
77
82
78
-
To execute the test suite, you will need a local clone of the main [OpenLineage repository](https://github.com/OpenLineage/OpenLineage), as the validation tool requires access to the specification files.
83
+
There are two primary ways to run the dbt compatibility tests: **locally for development and debugging**, or via **GitHub Actions for automated CI/CD validation**. Both approaches use the same underlying test framework but differ in their database setup and execution environment.
79
84
80
-
### Prerequisites
85
+
### Running Tests via GitHub Actions (Automated CI/CD)
81
86
82
-
1.**Install Python Dependencies**:
87
+
**This is the standard, automated test runner for the repository and community.**
88
+
89
+
GitHub Actions provides the canonical testing environment with:
90
+
- PostgreSQL 15 service container (automatically provisioned)
91
+
- Matrix testing across multiple dbt and OpenLineage versions
92
+
- Automated event validation against OpenLineage specifications
93
+
- Integration with the repository's reporting and compatibility tracking
94
+
95
+
#### Triggering GitHub Actions Workflows
96
+
97
+
1.**Automatic Trigger on Pull Requests**: The workflow runs automatically when changes are detected in `producer/dbt/` paths.
98
+
99
+
2.**Manual Trigger via Workflow Dispatch**:
100
+
```bash
101
+
# Trigger for specific branch
102
+
gh workflow run main_pr.yml --ref feature/your-branch -f components="dbt"
103
+
104
+
# Watch the run
105
+
gh run watch
106
+
```
107
+
108
+
3.**Via Pull Request**: Opening a PR that modifies dbt producer files will automatically trigger the test suite.
109
+
110
+
The GitHub Actions workflow:
111
+
- Provisions a PostgreSQL 15 container with health checks
112
+
- Installs `dbt-core`, `dbt-postgres`, and `openlineage-dbt` at specified versions
113
+
- Executes all scenarios defined in `scenarios/`
114
+
- Validates events against OpenLineage JSON schemas
115
+
- Generates compatibility reports and uploads artifacts
116
+
117
+
**Configuration**: See `.github/workflows/producer_dbt.yml` for the complete workflow definition.
**Use this approach for iterative development, debugging, and testing changes before pushing to GitHub.**
124
+
125
+
Local testing provides:
126
+
- Faster feedback loops for development
127
+
- Direct access to event files and logs
128
+
- Ability to inspect database state
129
+
- Control over specific test scenarios
130
+
131
+
#### Prerequisites
132
+
133
+
1.**Start PostgreSQL Container**:
83
134
```bash
84
135
# From the producer/dbt/ directory
136
+
docker-compose up -d
137
+
138
+
# Verify container is healthy
139
+
docker-compose ps
140
+
```
141
+
142
+
2. **Install Python Dependencies**:
143
+
```bash
144
+
# Activate virtual environment (recommended)
145
+
python -m venv venv
146
+
source venv/bin/activate # On Windows: venv\Scripts\activate
147
+
148
+
# Install requirements
85
149
pip install -r test_runner/requirements.txt
86
150
```
87
151
88
-
2. **Install dbt and the PostgreSQL adapter**:
152
+
3. **Install dbt and the PostgreSQL adapter**:
89
153
```bash
90
154
pip install dbt-core dbt-postgres
91
155
```
92
156
93
-
3. **Install the OpenLineage dbt integration**:
157
+
4. **Install the OpenLineage dbt integration**:
94
158
```bash
95
159
pip install openlineage-dbt
96
160
```
97
161
98
-
### Execution
162
+
5. **Verify dbt Connection**:
163
+
```bash
164
+
cd runner/
165
+
dbt debug
166
+
cd ..
167
+
```
168
+
169
+
#### Local Execution Options
99
170
100
-
Run the main test script, providing the path to your local OpenLineage repository.
171
+
**Option 1: Using the Test Runner CLI (Recommended)**
101
172
102
-
#### Basic Example
103
-
This command runs the test suite with default settings, validating against the `2-0-2` OpenLineage release and saving events to the `events/` directory.
173
+
The test runner CLI provides the same orchestration used in GitHub Actions:
104
174
105
175
```bash
106
-
# Example assuming the OpenLineage repo is cloned in a sibling directory
- Custom dbt facets trigger warnings during schema validation but do**not indicate test failure**
283
+
284
+
These warnings are **documented and accepted** as expected behavior.
285
+
286
+
**📊 For complete technical details**, see **[`SPECIFICATION_COVERAGE_ANALYSIS.md`](./SPECIFICATION_COVERAGE_ANALYSIS.md)** which documents:
287
+
- The exact structure and purpose of `dbt_version` and `dbt_run` facets
288
+
- Why validation warnings occur (vendor extensions vs. official spec)
289
+
- Impact assessment on test results
290
+
- Current workarounds and long-term resolution options
291
+
138
292
## Future Enhancements
139
293
140
294
To support community discussions around forward and backward compatibility, the `future/` directory contains design documents exploring a potential approach to multi-spec and multi-implementation version testing.
- 5 data quality test suites (START/COMPLETE pairs)
13
14
- 1 job orchestration wrapper (START/COMPLETE)
15
+
- Additional seed operations
16
+
17
+
## ⚠️ Known Validation Warnings
18
+
19
+
The dbt integration emits **custom facets that are not part of the official OpenLineage specification**. These generate validation warnings but are **expected and acceptable**:
20
+
21
+
### Custom dbt Facets:
22
+
1.**`dbt_version`** (Run Facet)
23
+
-**Purpose**: Captures the version of dbt-core being used
24
+
-**Schema**: `dbt-version-run-facet.json`
25
+
-**Example**: `{"version": "1.10.15"}`
26
+
-**Validation Warning**: `"$.run.facets.dbt_version facet type dbt_version not recognized"`
0 commit comments