mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 05:01:48 +02:00
Enable CI builds with postgresql and mysql
This commit is contained in:
parent
9db9a7b725
commit
a8702dae96
4 changed files with 18 additions and 1 deletions
10
.travis.yml
10
.travis.yml
|
@ -5,8 +5,18 @@ python:
|
||||||
- "3.7"
|
- "3.7"
|
||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
|
env:
|
||||||
|
- TESTING_SQLALCHEMY_DATABASE_URI='sqlite:///budget.db'
|
||||||
|
- TESTING_SQLALCHEMY_DATABASE_URI='postgresql+psycopg2://postgres:@localhost/travis_ci_test'
|
||||||
|
- TESTING_SQLALCHEMY_DATABASE_URI='mysql+pymysql://travis:@localhost/travis_ci_test'
|
||||||
|
before_script:
|
||||||
|
- psql -c 'create database travis_ci_test;' -U postgres
|
||||||
|
- mysql -e 'CREATE DATABASE travis_ci_test;'
|
||||||
script: tox
|
script: tox
|
||||||
before_install:
|
before_install:
|
||||||
- python -m pip install --upgrade pip virtualenv
|
- python -m pip install --upgrade pip virtualenv
|
||||||
install:
|
install:
|
||||||
- pip install tox-travis
|
- pip install tox-travis
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
- postgresql
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
|
||||||
from flask_testing import TestCase
|
from flask_testing import TestCase
|
||||||
from werkzeug.security import generate_password_hash
|
from werkzeug.security import generate_password_hash
|
||||||
|
|
||||||
|
@ -58,7 +60,9 @@ class BaseTestCase(TestCase):
|
||||||
|
|
||||||
|
|
||||||
class IhatemoneyTestCase(BaseTestCase):
|
class IhatemoneyTestCase(BaseTestCase):
|
||||||
SQLALCHEMY_DATABASE_URI = "sqlite://"
|
SQLALCHEMY_DATABASE_URI = os.environ.get(
|
||||||
|
"TESTING_SQLALCHEMY_DATABASE_URI", "sqlite://"
|
||||||
|
)
|
||||||
TESTING = True
|
TESTING = True
|
||||||
WTF_CSRF_ENABLED = False # Simplifies the tests.
|
WTF_CSRF_ENABLED = False # Simplifies the tests.
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,8 @@ dev =
|
||||||
pytest>=5.4.1
|
pytest>=5.4.1
|
||||||
tox>=3.14.6
|
tox>=3.14.6
|
||||||
zest.releaser>=6.20.1
|
zest.releaser>=6.20.1
|
||||||
|
psycopg2-binary>=2.8.5
|
||||||
|
PyMySQL>=0.9,<0.10
|
||||||
|
|
||||||
doc =
|
doc =
|
||||||
Sphinx==4.0.2
|
Sphinx==4.0.2
|
||||||
|
|
1
tox.ini
1
tox.ini
|
@ -3,6 +3,7 @@ envlist = py39,py38,py37,py36,lint_docs
|
||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
passenv = TESTING_SQLALCHEMY_DATABASE_URI
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
python --version
|
python --version
|
||||||
|
|
Loading…
Reference in a new issue