-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tox + GHA #319
Open
jtcohen6
wants to merge
1
commit into
calogica:main
Choose a base branch
from
jtcohen6:jerco/318-add-tox
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add tox + GHA #319
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# **what?** | ||
# Run tests for dbt-codegen against supported adapters | ||
|
||
# **why?** | ||
# To ensure that dbt-codegen works as expected with all supported adapters | ||
|
||
# **when?** | ||
# On every PR, and every push to main and when manually triggered | ||
|
||
name: Package Integration Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
uses: dbt-labs/dbt-package-testing/.github/workflows/run_tox.yml@main | ||
# this just tests with postgres so no variables need to be passed through. | ||
# When it's time to add more adapters you will need to pass through inputs for | ||
# the other adapters as shown in the below example for redshift | ||
# with: | ||
# # redshift | ||
# REDSHIFT_HOST: ${{ vars.REDSHIFT_HOST }} | ||
# REDSHIFT_USER: ${{ vars.REDSHIFT_USER }} | ||
# REDSHIFT_DATABASE: ${{ vars.REDSHIFT_DATABASE }} | ||
# REDSHIFT_SCHEMA: "integration_tests_redshift_${{ github.run_number }}" | ||
# REDSHIFT_PORT: ${{ vars.REDSHIFT_PORT }} | ||
# secrets: | ||
# DBT_ENV_SECRET_REDSHIFT_PASS: ${{ secrets.DBT_ENV_SECRET_REDSHIFT_PASS }} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# for convenience - test locally against latest changes in dbt-core + adapters | ||
dbt-core@git+https://github.com/dbt-labs/dbt-core.git#subdirectory=core | ||
dbt-postgres@git+https://github.com/dbt-labs/dbt-postgres.git | ||
tox>=3.13 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
packages: | ||
- local: ../ | ||
- package: calogica/dbt_date | ||
version: 0.10.1 | ||
sha1_hash: de2deba3d66ce03d8c02949013650cc9b94f6030 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
integration_tests: | ||
outputs: | ||
postgres: | ||
type: "postgres" | ||
host: "{{ env_var('POSTGRES_HOST') }}" | ||
user: "{{ env_var('POSTGRES_USER') }}" | ||
pass: "{{ env_var('DBT_ENV_SECRET_POSTGRES_PASS') }}" | ||
port: "{{ env_var('POSTGRES_PORT') | as_number }}" | ||
dbname: "{{ env_var('POSTGRES_DATABASE') }}" | ||
schema: "{{ env_var('POSTGRES_SCHEMA') }}" | ||
threads: 5 | ||
target: postgres |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SUPPORTED_ADAPTERS=postgres |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[tox] | ||
skipsdist = True | ||
envlist = lint_all, testenv | ||
|
||
[testenv] | ||
passenv = | ||
# postgres env vars | ||
POSTGRES_HOST | ||
POSTGRES_USER | ||
DBT_ENV_SECRET_POSTGRES_PASS | ||
POSTGRES_PORT | ||
POSTGRES_DATABASE | ||
POSTGRES_SCHEMA | ||
|
||
# Postgres integration tests for centralized dbt testing | ||
# run dbt commands directly, assumes dbt is already installed in environment | ||
[testenv:dbt_integration_postgres] | ||
changedir = integration_tests | ||
allowlist_externals = | ||
dbt | ||
skip_install = true | ||
commands = | ||
dbt deps --target postgres | ||
dbt build --target postgres |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbt-labs has tagged a commit for this workflow to ensure we don't accidentally break anyone during development.