Skip to content

Commit

Permalink
🔧 bump deps and use markers for tests (#164)
Browse files Browse the repository at this point in the history
* deps

* seperate slow and fast tests

* rename action

* use markers for tests
  • Loading branch information
zschumacher committed Jul 30, 2023
1 parent 890748f commit a99c5f6
Show file tree
Hide file tree
Showing 31 changed files with 1,284 additions and 929 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install poetry
env:
POETRY_VERSION: "1.4.0"
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: install poetry
env:
POETRY_VERSION: "1.4.0"
POETRY_VERSION: "1.4.2"
run: curl -sSL https://install.python-poetry.org | python -

- name: publish
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/test-bigquery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test-bigquery

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

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]

steps:
- name: checkout
uses: actions/checkout@v1

- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install poetry
env:
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
- name: cache poetry.lock dependencies
id: cache-poetry-deps
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test-bigquery

- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install -E google-cloud-bigquery -E google-cloud-bigquery-storage

- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest -m "bigquery" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}-bigquery
54 changes: 54 additions & 0 deletions .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test-core

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

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]

steps:
- name: checkout
uses: actions/checkout@v1

- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install poetry
env:
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
- name: cache poetry.lock dependencies
id: cache-poetry-deps
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test-core

- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install

- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest -m "core" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}-core
65 changes: 65 additions & 0 deletions .github/workflows/test-mssql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: test-mssql

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

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]

services:

mssql-server:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1434:1433
env:
SA_PASSWORD: "pydapper!PYDAPPER"
ACCEPT_EULA: "Y"
MSSQL_PID: "Express"

steps:
- name: checkout
uses: actions/checkout@v1

- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install poetry
env:
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
- name: cache poetry.lock dependencies
id: cache-poetry-deps
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test-mssql

- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install -E pymssql

- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest -m "mssql" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}-mssql
90 changes: 90 additions & 0 deletions .github/workflows/test-mysql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: test-mysql

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

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]

services:

mysql:
image: mysql:latest
ports:
- 3307:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "pydapper"
MYSQL_USER: "pydapper"
MYSQL_PASSWORD: "pydapper"
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: checkout
uses: actions/checkout@v1

- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install poetry
env:
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
- name: cache oracle instantclient download
id: cache-oracle-instantclient-download
uses: actions/cache@v2
with:
path: oracle-instantclient-basiclite_21.5.0.0.0-2_amd64.deb
key: oracle-instantclient-basiclite_21.5.0.0.0-2_amd64

- name: download oracle instantclient
if: steps.cache-oracle-instantclient-download.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install wget alien libaio1 -y
wget https://download.oracle.com/otn_software/linux/instantclient/215000/oracle-instantclient-basiclite-21.5.0.0.0-1.x86_64.rpm
sudo alien oracle-instantclient-basiclite-21.5.0.0.0-1.x86_64.rpm
- name: install oracle instantclient
run: |
sudo apt install ./oracle-instantclient-basiclite_21.5.0.0.0-2_amd64.deb
- name: cache poetry.lock dependencies
id: cache-poetry-deps
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test-mysql

- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install -E mysql-connector-python

- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest -m "mysql" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}-mysql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: test-oracle

on:
push:
Expand All @@ -18,43 +18,6 @@ jobs:

services:

postgres:
image: postgres:latest
ports:
- 5433:5432
env:
POSTGRES_USER: pydapper
POSTGRES_PASSWORD: pydapper
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mssql-server:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1434:1433
env:
SA_PASSWORD: "pydapper!PYDAPPER"
ACCEPT_EULA: "Y"
MSSQL_PID: "Express"

mysql:
image: mysql:latest
ports:
- 3307:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "pydapper"
MYSQL_USER: "pydapper"
MYSQL_PASSWORD: "pydapper"
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
oracle:
image: gvenzl/oracle-xe:slim
ports:
Expand All @@ -81,7 +44,7 @@ jobs:

- name: install poetry
env:
POETRY_VERSION: "1.4.0"
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
Expand Down Expand Up @@ -110,18 +73,18 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-test-oracle

- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install -E all
run: poetry install -E cx_Oracle -E oracledb

- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest --cov=. --cov-branch -v --durations=25
poetry run pytest -m "oracle" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}
poetry run codecov -F ${{ matrix.python-version }}-oracle

0 comments on commit a99c5f6

Please sign in to comment.