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 29bf044 commit a11c724
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 21 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
36 changes: 36 additions & 0 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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 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]'
- 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: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ flake8:

test: dev-requires
python3 -m pytest --cov=piperider_cli --cov-report html tests
tox -c tox-ruamel.ini

pre-release: dev-requires
pip install build
Expand Down
8 changes: 6 additions & 2 deletions tox-ruamel.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
env_list =
py-ruamel-{0.17.21,0.17.22}
py{38,39,310,311}-ruamel-{0.17.21,0.17.22}
minversion = 4.7.0

[testenv]
Expand All @@ -9,7 +9,10 @@ package = wheel
wheel_build_env = .pkg

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

deps =
pytest>=6
Expand All @@ -18,6 +21,7 @@ deps =
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
17 changes: 7 additions & 10 deletions tox.ini → tox-sqlalchemy.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}-sqlalchemy-{14,20}
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
sqlalchemy-14: sqlalchemy>=1.4,<2.0
sqlalchemy-20: sqlalchemy>=2.0


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

0 comments on commit a11c724

Please sign in to comment.