--- /dev/null
+name: Run tests
+
+on: [push, pull_request]
+
+jobs:
+ run-tests:
+
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
+ include:
+ - os: ubuntu-latest
+ os-name: Linux
+ pip-cache-path: ~/.cache/pip
+ - os: windows-latest
+ os-name: w32
+ pip-cache-path: ~\AppData\Local\pip\Cache
+
+ name: Python ${{ matrix.python-version }} @ ${{ matrix.os-name }}
+ runs-on: ${{ matrix.os }}
+
+ steps:
+
+ - uses: ankane/setup-postgres@v1
+ - name: Setup Postgres user
+ run: |
+ sudo -u postgres psql --command="ALTER USER runner CREATEDB PASSWORD 'test'"
+ if: ${{ runner.os == 'Linux' }}
+ - name: Setup Postgres user
+ run: |
+ psql --command="CREATE USER runner CREATEDB PASSWORD 'test'"
+ if: ${{ runner.os == 'Windows' }}
+
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Cache pip
+ uses: actions/cache@v2
+ with:
+ path: ${{ matrix.pip-cache-path }}
+ key: ${{ runner.os }}-pip
+ - name: Install dependencies
+ run: |
+ python --version
+ python -m pip install --upgrade "pip<21.0" "setuptools<45" wheel
+ pip --version
+ pip install --upgrade virtualenv tox
+ - name: Set TOXENV
+ run: |
+ import os, sys
+ pyver = '%d%d' % tuple(sys.version_info[:2])
+ toxenv = 'py%s' % pyver
+ toxenv += ',py%s-sqlite' % pyver
+ if os.name == 'nt':
+ toxenv += '-w32'
+ toxenv += ',py%s-postgres' % pyver
+ if os.name == 'posix':
+ toxenv += ',py%s-flake8' % pyver
+ elif os.name == 'nt':
+ toxenv += '-w32'
+ with open(os.environ['GITHUB_ENV'], 'a') as f:
+ f.write('TOXENV=' + toxenv + '\n')
+ f.write('PGPASSWORD=test\n')
+ shell: python
+ - name: Run tox
+ run: |
+ python -c "import os; print(os.environ['TOXENV'])"
+ tox
+++ /dev/null
-os: linux
-
-dist: xenial
-
-language: python
-
-python:
- - "2.7"
-
-cache: pip
-
-addons:
- apt:
- packages:
- - python-psycopg2
- - python3-psycopg2
- postgresql: "9.4"
-
-matrix:
- include:
- - python: "2.7"
- env: TOXENV=py27
- - python: "3.5"
- env: TOXENV=py35
- - python: "3.6"
- env: TOXENV=py36
- - python: "3.7"
- env: TOXENV=py37
- - python: "3.8"
- env: TOXENV=py38
- - python: "3.9"
- env: TOXENV=py39
- - python: "2.7"
- env: TOXENV=py27-postgres
- - python: "3.5"
- env: TOXENV=py35-postgres
- - python: "3.6"
- env: TOXENV=py36-postgres
- - python: "3.7"
- env: TOXENV=py37-postgres
- - python: "3.8"
- env: TOXENV=py38-postgres
- - python: "3.9"
- env: TOXENV=py39-postgres
- - python: "2.7"
- env: TOXENV=py27-sqlite
- - python: "3.5"
- env: TOXENV=py35-sqlite
- - python: "3.6"
- env: TOXENV=py36-sqlite
- - python: "3.7"
- env: TOXENV=py37-sqlite
- - python: "3.8"
- env: TOXENV=py38-sqlite
- - python: "3.9"
- env: TOXENV=py39-sqlite
- - python: "2.7"
- env: TOXENV=py27-flake8
- - python: "3.9"
- env: TOXENV=py39-flake8
-
-install:
- - travis_retry pip install --upgrade "pip<21" "setuptools<44" "tox>=3.15" ppu
-
-script:
- - tox
-
-before_cache:
- - remove-old-files.py -o 180 ~/.cache/pip
+++ /dev/null
-# Test on windows
-# Heavily inspired by Oliver Grisel's appveyor-demo (https://github.com/ogrisel/python-appveyor-demo)
-version: '{branch}-{build}'
-
-cache:
- - '%LOCALAPPDATA%\pip\Cache'
-
-# Match travis
-clone_depth: 50
-
-services:
- - postgresql
-
-environment:
- PGUSER: "postgres"
- PGPASSWORD: "Password12!"
-
- matrix:
- - TOXENV: "py27"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- - TOXENV: "py37"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python37-x64"
- - TOXENV: "py38"
- PYTHON_VERSION: "3.8"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python38-x64"
- - TOXENV: "py39"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python39"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py39"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py27-postgres-w32"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- db: postgresql
- - TOXENV: "py37-postgres-w32"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python37-x64"
- db: postgresql
- - TOXENV: "py38-postgres-w32"
- PYTHON_VERSION: "3.8"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python38-x64"
- db: postgresql
- - TOXENV: "py39-postgres-w32"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python39"
- db: postgresql
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py39-postgres-w32"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
- db: postgresql
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py27-sqlite-w32"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- - TOXENV: "py37-sqlite-w32"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python37-x64"
- - TOXENV: "py38-sqlite-w32"
- PYTHON_VERSION: "3.8"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python38-x64"
- - TOXENV: "py39-sqlite-w32"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python39"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py39-sqlite-w32"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- - TOXENV: "py27-flake8"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "32"
- PYTHON_HOME: "C:\\Python27"
- - TOXENV: "py39-flake8"
- PYTHON_VERSION: "3.9"
- PYTHON_ARCH: "64"
- PYTHON_HOME: "C:\\Python39-x64"
-
-install:
- # Ensure we use the right python version
- - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;C:\\Program Files\\PostgreSQL\\9.5\\bin;%PATH%"
- - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe"
- - "python --version"
- - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
- - "python -m pip install --upgrade \"pip<21\" \"setuptools<44\""
- - "pip install --upgrade \"tox>=3.15\" ppu"
- - "pip --version"
-
-# No build step - we don't have C extensions
-build: false
-
-test_script:
- - "tox"
-
-after_test:
- - "remove-old-files.py -o 180 %LOCALAPPDATA%\\pip\\Cache"
pytest < 5.0; python_version == '2.7' or python_version == '3.4'
pytest; python_version >= '3.5'
-pytest-cov
ppu
* Python 3.8, Python 3.9.
+* GitHub Actions.
+
+* Stop testing at Travis CI.
+
Version 0.2.3 (2019-02-01)
--------------------------
passenv = PGPASSWORD
setenv =
VIRTUALENV_PIP = 19.1.1
-platform = linux
+platform = linux|win32
# Don't fail or warn on uninstalled commands
whitelist_externals =
createdb
dropdb
[testenv:{py27,py34,py35,py36,py37,py38,py39}]
-platform = linux|win32
commands =
{[testenv]commands}
- {envpython} -m pytest --cov=sqlconvert
+ {envpython} -m pytest
{envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
cmp.py -i tests/mysql2sql/test.out test.out
rm.py -f test.out
commands =
{[testenv]commands}
-rm.py -f /tmp/test.sqdb
- {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
+ {envpython} -m pytest -D sqlite:///tmp/test.sqdb
rm.py -f /tmp/test.sqdb
[testenv:{py27,py34,py35,py36,py37,py38,py39}-sqlite-w32]
platform = win32
commands =
{[testenv]commands}
- -rm.py -f C:/projects/sqlconvert/test.sqdb
- pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
- rm.py -f C:/projects/sqlconvert/test.sqdb
+ -rm.py -f {env:TEMP}/test.sqdb
+ pytest -D sqlite:/{env:TEMP}/test.sqdb?debug=1
+ rm.py -f {env:TEMP}/test.sqdb
-[testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres]
+[testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres{,-w32}]
commands =
{[testenv]commands}
- -dropdb -U postgres -w test
- createdb -U postgres -w test
- {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
- dropdb -U postgres -w test
-
-[testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres-w32]
-platform = win32
-commands =
- {[testenv]commands}
- -dropdb -U postgres -w test
- createdb -U postgres -w test
- pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
- dropdb -U postgres -w test
+ -dropdb --username=runner test
+ createdb --username=runner test
+ {envpython} -m pytest -D postgres://runner:test@localhost/test
+ dropdb --username=runner test
# flake8
[testenv:{py27,py34,py35,py36,py37,py38,py39}-flake8]
-platform = linux|win32
deps =
flake8
commands =