tests: allow running tests via make file on different databases

This commit is contained in:
Marcin Kuzminski 2017-09-19 18:50:20 +02:00
parent 4679c5bfcb
commit fdc6e80b7f
2 changed files with 21 additions and 3 deletions

View file

@ -1,5 +1,5 @@
.PHONY: clean docs docs-clean docs-cleanup test test-clean test-only web-build
.PHONY: clean docs docs-clean docs-cleanup test test-clean test-only test-only-postgres test-only-mysql web-build
WEBPACK=./node_modules/webpack/bin/webpack.js
GRUNT=grunt
@ -19,7 +19,25 @@ test-clean:
find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
test-only:
PYTHONHASHSEED=random py.test -vv -r xw --cov=rhodecode --cov-report=term-missing --cov-report=html rhodecode
PYTHONHASHSEED=random \
py.test -x -vv -r xw -p no:sugar --cov=rhodecode \
--cov-report=term-missing --cov-report=html \
rhodecode
test-only-mysql:
PYTHONHASHSEED=random \
py.test -x -vv -r xw -p no:sugar --cov=rhodecode \
--cov-report=term-missing --cov-report=html \
--ini-config-override='{"app:main": {"sqlalchemy.db1.url": "mysql://root:qweqwe@localhost/rhodecode_test"}}' \
rhodecode
test-only-postgres:
PYTHONHASHSEED=random \
py.test -x -vv -r xw -p no:sugar --cov=rhodecode \
--cov-report=term-missing --cov-report=html \
--ini-config-override='{"app:main": {"sqlalchemy.db1.url": "postgresql://postgres:qweqwe@localhost/rhodecode_test"}}' \
rhodecode
docs:
(cd docs; nix-build default.nix -o result; make clean html)

View file

@ -55,7 +55,7 @@ def pytest_addoption(parser):
'--with-pylons', dest='pylons_config',
help="Set up a Pylons environment with the specified config file.")
group.addoption(
'--pylons-config-override', action='store', type=_parse_json,
'--ini-config-override', action='store', type=_parse_json,
default=None, dest='pylons_config_override', help=(
"Overrides the .ini file settings. Should be specified in JSON"
" format, e.g. '{\"section\": {\"parameter\": \"value\", ...}}'"