Files
sqlalchemy/tox.ini
T
Federico Caselli 8750eb6ef1 Add github action workflow to run tests on master and on pr to master
Trying the pr to check if it works right away

<!-- Describe your changes in detail -->

<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
	- Good to go, no issue or tests are needed
- [x] A short code fix
	- please include the issue number, and create an issue if none exists, which
	  must include a complete example of the issue.  one line code fixes without an
	  issue and demonstration will not be accepted.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
	- please include the issue number, and create an issue if none exists, which must
	  include a complete example of how the feature would look.
	- Please include: `Fixes: #<issue number>` in the commit message
	- please include tests.

**Have a nice day!**

Closes: #5222
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5222
Pull-request-sha: afbb856752

Change-Id: I4981b02f900e76e446cf42e6cc6495ffc0883951
(cherry picked from commit c658540b9a)
2020-04-08 10:14:17 -04:00

108 lines
4.4 KiB
INI

[tox]
envlist = py{27,34,35,36,37,38}-{cext,nocext}
[testenv]
# note that we have a .coveragerc file that points coverage specifically
# at ./lib/sqlalchemy, and *not* at the build that tox might create under .tox.
# See the notes below for setenv for more detail.
# also using --cov-append so that we can aggregate multiple runs together.
# Jenkins etc. need to call "coverage erase" externally.
cov_args=--cov=sqlalchemy --cov-report term --cov-append --cov-report xml --exclude-tag memory-intensive --exclude-tag timing-intensive -k "not aaa_profiling"
install_command=python -m pip install {env:TOX_PIP_OPTS:} {opts} {packages}
usedevelop=
cov: True
deps=pytest!=3.9.1,!=3.9.2
pytest-xdist
mock; python_version < '3.3'
# needed only for correct profiling results
# due to speed improvements in psycopg2 as of 2.7
postgresql: psycopg2>=2.7
# needed only for correct profiling results
# due to speed improvements in mysqlclient as of 1.4.0
mysql: mysqlclient>=1.4.0
mysql: pymysql
mysql: mysql-connector-python
# waiting for https://github.com/oracle/python-cx_Oracle/issues/75
oracle: cx_oracle>=7.0
oracle6: cx_oracle>=6.0.2,!=6.3,!=6.4,<7.0
oracle5: cx_oracle==5.2.1
mssql: pyodbc
cov: pytest-cov
whitelist_externals=sh
# PYTHONPATH - erased so that we use the build that's present
# in .tox as the SQLAlchemy library to be imported
#
# PYTHONUSERSITE - this *MUST* be set so that the ./lib/ import
# set up explicitly in test/conftest.py is *disabled*, again so that
# when SQLAlchemy is built into the .tox area, we use that and not the
# local checkout, at least when usedevelop=False
#
# BASECOMMAND - using an env variable here so we can use it
# as a substitution in a command (see https://bitbucket.org/hpk42/tox/issues/307/)
#
# only use --dropfirst option if we're *not* using -n;
# if -n is used, we're working in brand new DBs anyway, dropfirst
# will collide on CI environments
setenv=
PYTHONPATH=
PYTHONNOUSERSITE=1
BASECOMMAND=python -m pytest --log-info=sqlalchemy.testing
WORKERS={env:TOX_WORKERS:-n4 --max-worker-restart=5}
oracle,oracle6,oracle5: WORKERS={env:TOX_WORKERS:-n2 --max-worker-restart=5}
nocext: DISABLE_SQLALCHEMY_CEXT=1
cov: COVERAGE={[testenv]cov_args}
sqlite: SQLITE={env:TOX_SQLITE:--db sqlite}
sqlite_file: SQLITE={env:TOX_SQLITE_FILE:--db sqlite_file}
postgresql: POSTGRESQL={env:TOX_POSTGRESQL:--db postgresql}
mysql: MYSQL={env:TOX_MYSQL:--db mysql --db pymysql}
oracle,oracle6,oracle5: ORACLE={env:TOX_ORACLE:--db oracle}
mssql: MSSQL={env:TOX_MSSQL:--db mssql}
oracle,oracle6,oracle5,mssql,sqlite_file: IDENTS=--write-idents db_idents.txt
oracle,oracle6,oracle5,mssql,sqlite_file: NOMEMORY=--nomemory
backendonly: BACKENDONLY=--backend-only
# tox as of 2.0 blocks all environment variables from the
# outside, unless they are here (or in TOX_TESTENV_PASSENV,
# wildcards OK). Need at least these
passenv=ORACLE_HOME NLS_LANG TOX_POSTGRESQL TOX_MYSQL TOX_ORACLE TOX_MSSQL TOX_SQLITE TOX_SQLITE_FILE TOX_WORKERS
# for nocext, we rm *.so in lib in case we are doing usedevelop=True
commands=
nocext: sh -c "rm -f lib/sqlalchemy/*.so"
{env:BASECOMMAND} {env:WORKERS} {env:SQLITE:} {env:POSTGRESQL:} {env:MYSQL:} {env:ORACLE:} {env:MSSQL:} {env:BACKENDONLY:} {env:IDENTS:} {env:NOMEMORY:} {env:COVERAGE:} {posargs}
oracle,oracle6,oracle5,mssql,sqlite_file: python reap_dbs.py db_idents.txt
# thanks to https://julien.danjou.info/the-best-flake8-extensions/
[testenv:pep8]
basepython = python3.7
deps=
flake8
flake8-import-order
flake8-builtins
flake8-docstrings
flake8-rst-docstrings
pydocstyle<4.0.0
# used by flake8-rst-docstrings
pygments
commands = flake8 ./lib/ ./test/ ./examples/ setup.py
# command run in the github action when cext are active.
[testenv:github-cext]
commands=
python -m pytest {env:WORKERS} {env:SQLITE:} {env:POSTGRESQL:} {env:MYSQL:} {env:ORACLE:} {env:MSSQL:} {env:BACKENDONLY:} {env:IDENTS:} {env:NOMEMORY:} {env:COVERAGE:} {posargs}
oracle,mssql,sqlite_file: python reap_dbs.py db_idents.txt
# command run in the github action when cext are not active.
[testenv:github-nocext]
commands=
python -m pytest {env:WORKERS} {env:SQLITE:} {env:POSTGRESQL:} {env:MYSQL:} {env:ORACLE:} {env:MSSQL:} {env:BACKENDONLY:} {env:IDENTS:} {env:NOMEMORY:} {env:COVERAGE:} {posargs}
oracle,mssql,sqlite_file: python reap_dbs.py db_idents.txt