Commit 2e0c2ff6 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Speed up the testing

Parallelize runs, use in-memory sqlite3 and turn off unnecessary
debugging/logging.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent b51d7e99
image: python:3.6 image: python:3.6
services:
- mariadb:latest
variables: variables:
PW_TEST_DB_HOST: 'mariadb'
PW_TEST_DB_USER: 'root'
MYSQL_DATABASE: 'patchwork'
MYSQL_ROOT_PASSWORD: 'password'
DEBIAN_FRONTEND: 'noninteractive' DEBIAN_FRONTEND: 'noninteractive'
CHROME_BIN: '/usr/bin/chromium' CHROME_BIN: '/usr/bin/chromium'
before_script: before_script:
- apt-get -qq update - apt-get -qq update
- apt-get -qq install libmariadbclient-dev
- apt-get -qq install python-virtualenv python3-virtualenv python-pip python3-pip - apt-get -qq install python-virtualenv python3-virtualenv python-pip python3-pip
- apt-get -qq install chromium chromium-driver - apt-get -qq install chromium chromium-driver
......
"""
Quick development settings for patchwork project.
Most of these are commented out as they will be installation dependent.
Design based on:
http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
"""
from __future__ import absolute_import
from .base import * # noqa
from os.path import join, dirname
#
# Core settings
# https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
#
# Security
#
# You'll need to replace this to a random string. The following python code can
# be used to generate a secret key:
#
# import string, random
# chars = string.letters + string.digits + string.punctuation
# print repr("".join([random.choice(chars) for i in range(0,50)]))
SECRET_KEY = '00000000000000000000000000000000000000000000000000'
# Database
#
# SQLite database is used for development.
# Please see https://docs.djangoproject.com/en/1.7/ref/settings/#databases
# for documentation about database configuration.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': join(dirname(__file__), 'db.sqlite'),
},
}
DEBUG = True
TEMPLATE_DEBUG = True
ENABLE_XMLRPC = True
from __future__ import absolute_import
from .base import * # noqa
import logging
SECRET_KEY = '00000000000000000000000000000000000000000000000000'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
ENABLE_XMLRPC = True
# make tests faster
DEBUG = False
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.MD5PasswordHasher',
)
logging.disable(logging.CRITICAL)
INSTALLED_APPS.remove('django.contrib.admin')
...@@ -6,16 +6,15 @@ skipsdist = True ...@@ -6,16 +6,15 @@ skipsdist = True
[testenv] [testenv]
deps = deps =
-r{toxinidir}/docs/requirements-dev.txt -r{toxinidir}/docs/requirements-dev.txt
mysqlclient>=1.3.0,<1.4
django111: django>=1.11,<1.12 django111: django>=1.11,<1.12
setenv = setenv =
DJANGO_SETTINGS_MODULE = patchwork.settings.dev DJANGO_SETTINGS_MODULE = patchwork.settings.test
passenv = passenv =
http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
PW_TEST_DB_HOST PW_TEST_DB_TYPE PW_TEST_DB_USER PW_TEST_DB_PASS PW_TEST_DB_HOST PW_TEST_DB_TYPE PW_TEST_DB_USER PW_TEST_DB_PASS
DISPLAY PATCHWORK_SKIP_BROWSER_TESTS SELENIUM_BROWSER CHROME_BIN DISPLAY PATCHWORK_SKIP_BROWSER_TESTS SELENIUM_BROWSER CHROME_BIN
commands = commands =
{toxinidir}/manage.py test --noinput '{posargs:patchwork}' {toxinidir}/manage.py test --parallel --noinput '{posargs:patchwork}'
[testenv:pep8] [testenv:pep8]
basepython = python3.6 basepython = python3.6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment