Skip to content

Commit

Permalink
Rearrange tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ching Yi, Chan <[email protected]>
  • Loading branch information
qrtt1 committed Nov 7, 2023
1 parent 02b474b commit 3a0d8aa
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 18 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ '3.9', '3.10', '3.11' ]
sqlalchemy: [ "sqlalchemy>=1.4,<2.0", "sqlalchemy>=2.0" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.version }}
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "${{ matrix.sqlalchemy }}"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e '.[duckdb]'
- name: Run tests
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Run tox tests

on:
push:
branches:
- main
pull_request:
branches:
- main


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e '.[duckdb]'
pip install tox
- name: Run tox-sqlalchemy
run: tox -c tox-sqlalchemy.ini
- name: Run tox-ruamel
run: tox -c tox-ruamel.ini
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _get_version():
'csv': duckdb_require_packages,
'parquet': duckdb_require_packages,
'dev': [
'tox',
'pytest>=4.6',
'pytest-flake8',
'flake8==3.9.2',
Expand Down
17 changes: 7 additions & 10 deletions tox.ini → tox-ruamel.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
env_list =
py38-dbt13
py{39,310,311}-dbt{14,15,16}
py{38,39,310,311}-ruamel-{0.17.21,0.17.22}
minversion = 4.7.0

[testenv]
Expand All @@ -13,17 +12,15 @@ basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11

deps =
pytest>=6
py38-dbt13: dbt-core>=1.3,<1.4
py38-dbt13: dbt-duckdb>=1.3,<1.4
dbt14: dbt-core>=1.4,<1.5
dbt14: dbt-duckdb>=1.4,<1.5
dbt15: dbt-core>=1.5,<1.6
dbt15: dbt-duckdb>=1.5,<1.6
dbt16: dbt-core>=1.6,<1.7
dbt16: dbt-duckdb>=1.6,<1.7
dbt-core>=1.6,<1.7
dbt-duckdb>=1.6,<1.7
ruamel-0.17.21: ruamel.yaml<=0.17.21
ruamel-0.17.22: ruamel.yaml>0.17.21,<0.18


commands =
pytest {tty:--color=yes} {posargs}
Expand Down
31 changes: 31 additions & 0 deletions tox-sqlalchemy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
env_list =
py{38,39,310,311}-sqlalchemy-{14,20}
minversion = 4.7.0

[testenv]
description = run the tests with pytest
package = wheel
wheel_build_env = .pkg

basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11

deps =
pytest>=6
dbt-core>=1.6,<1.7
dbt-duckdb>=1.6,<1.7
sqlalchemy-14: sqlalchemy>=1.4,<2.0
sqlalchemy-20: sqlalchemy>=2.0


commands =
pytest {tty:--color=yes} {posargs}

setenv =
PYTHONPATH = {toxinidir}/tests/:{env:PYTHONPATH}


0 comments on commit 3a0d8aa

Please sign in to comment.