Skip to content

Commit

Permalink
added postgres integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Dec 22, 2023
1 parent ff4b5ba commit d249bdd
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
45 changes: 40 additions & 5 deletions .github/workflows/dbt_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ defaults:
working-directory: integration_tests

jobs:
test:
name: Test
test-duckdb:
name: Test on DuckDB
runs-on: ubuntu-latest
environment: production
container:
Expand All @@ -27,11 +27,46 @@ jobs:
run: pip install dbt-core duckdb dbt-duckdb

- name: Install DBT deps
run: dbt deps
run: dbt deps --target duckdb

- name: load test data
run: dbt seed
run: dbt seed --target duckdb

- name: dbt test
run: dbt test
run: dbt test --target duckdb

test-postgres:
name: Test on Postgres
runs-on: ubuntu-latest
environment: production
container:
image: python:3.11

# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres

steps:
- name: Checkout
uses: actions/checkout@v3

- name: pip install
run: pip install dbt-core duckdb dbt-postgres

- name: Install DBT deps
run: dbt deps --target postgres

- name: load test data
run: dbt seed --target postgres

- name: dbt test
run: dbt test --target postgres



9 changes: 8 additions & 1 deletion integration_tests/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ integration_tests:
duckdb:
type: duckdb
path: 'data/duckdb/integration_test_data.duckdb'

postgres:
type: postgres
host: postgres
user: postgres
password: postgres
port: 5432
dbname: postgres # or database instead of dbname
schema: public

0 comments on commit d249bdd

Please sign in to comment.