Skip to content
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

ci: run examples unittest #1644

Merged
merged 9 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ jobs:
run: |
pip install -U pip poetry
poetry config virtualenvs.create false
- name: Install requirements
run: make deps
- name: Install ODBC driver
run: |
sudo curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
Expand All @@ -71,8 +69,17 @@ jobs:
ACCEPT_EULA=Y sudo apt-get install -y msodbcsql18
- name: Run ci
run: make ci
- name: Test Examples
run: |
export DEST=examples/blacksheep && PYTHONPATH=$DEST pytest $PYTEST_ARGS $DEST/_tests.py
export DEST=examples/fastapi && PYTHONPATH=$DEST pytest $PYTEST_ARGS $DEST/_tests.py
env:
PYTHONDEVMODE: 1
PYTEST_ARGS: "-n auto --cov=tortoise --cov-append --tb=native -q"
- name: Upload Coverage
run: coveralls --service=github
run: |
pip3 install --upgrade coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
checkfiles = tortoise/ examples/ tests/ conftest.py
py_warn = PYTHONDEVMODE=1
pytest_opts = -n auto --cov=tortoise --tb=native -q
pytest_opts = -n auto --cov=tortoise --cov-append --tb=native -q

help:
@echo "Tortoise ORM development makefile"
Expand Down Expand Up @@ -65,11 +65,11 @@ test_oracle:
$(py_warn) TORTOISE_TEST_DB="oracle://SYSTEM:$(TORTOISE_ORACLE_PASS)@127.0.0.1:1521/test_\{\}?driver=$(TORTOISE_ORACLE_DRIVER)" pytest $(pytest_opts) --cov-append --cov-report=

_testall: test_sqlite test_postgres_asyncpg test_postgres_psycopg test_mysql_myisam test_mysql test_mssql
coverage report

testall: deps _testall
coverage report

ci: check testall
ci: check _testall

docs: deps
rm -fR ./build
Expand Down
Loading