mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 20:40:17 +02:00
Extend tox setup to include core only testing
This commit is contained in:
parent
efd2a5e8c5
commit
01c17d28f6
@ -6,25 +6,45 @@ before_script:
|
|||||||
- python -V
|
- python -V
|
||||||
- pip install wheel tox
|
- pip install wheel tox
|
||||||
|
|
||||||
test-3.5:
|
test-3.5-core:
|
||||||
image: python:3.5-buster
|
image: python:3.5-buster
|
||||||
script:
|
script:
|
||||||
- tox -e py35
|
- tox -e py35-core
|
||||||
|
|
||||||
test-3.6:
|
test-3.6-core:
|
||||||
image: python:3.6-buster
|
image: python:3.6-buster
|
||||||
script:
|
script:
|
||||||
- tox -e py36
|
- tox -e py36-core
|
||||||
|
|
||||||
test-3.7:
|
test-3.7-core:
|
||||||
image: python:3.7-buster
|
image: python:3.7-buster
|
||||||
script:
|
script:
|
||||||
- tox -e py37
|
- tox -e py37-core
|
||||||
|
|
||||||
test-3.8:
|
test-3.8-core:
|
||||||
image: python:3.8-buster
|
image: python:3.8-buster
|
||||||
script:
|
script:
|
||||||
- tox -e py38
|
- tox -e py38-core
|
||||||
|
|
||||||
|
test-3.5-all:
|
||||||
|
image: python:3.5-buster
|
||||||
|
script:
|
||||||
|
- tox -e py35-all
|
||||||
|
|
||||||
|
test-3.6-all:
|
||||||
|
image: python:3.6-buster
|
||||||
|
script:
|
||||||
|
- tox -e py36-all
|
||||||
|
|
||||||
|
test-3.7-all:
|
||||||
|
image: python:3.7-buster
|
||||||
|
script:
|
||||||
|
- tox -e py37-all
|
||||||
|
|
||||||
|
test-3.8-all:
|
||||||
|
image: python:3.8-buster
|
||||||
|
script:
|
||||||
|
- tox -e py38-all
|
||||||
|
|
||||||
deploy_production:
|
deploy_production:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
@ -3,8 +3,6 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Alliance Auth Test Suite Django settings.
|
Alliance Auth Test Suite Django settings
|
||||||
|
|
||||||
|
Testing all services and plug-in apps
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from allianceauth.project_template.project_name.settings.base import *
|
from allianceauth.project_template.project_name.settings.base import *
|
||||||
@ -41,14 +43,6 @@ ROOT_URLCONF = 'tests.urls'
|
|||||||
|
|
||||||
CACHES['default'] = {'BACKEND': 'django.core.cache.backends.db.DatabaseCache'}
|
CACHES['default'] = {'BACKEND': 'django.core.cache.backends.db.DatabaseCache'}
|
||||||
|
|
||||||
#####################
|
|
||||||
# HR Configuration
|
|
||||||
#####################
|
|
||||||
# JACK_KNIFE_URL - Url for the audit page of API Jack knife
|
|
||||||
# Should seriously replace with your own.
|
|
||||||
#####################
|
|
||||||
JACK_KNIFE_URL = 'http://example.com/eveapi/audit.php'
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# XenForo Configuration
|
# XenForo Configuration
|
||||||
########################
|
########################
|
33
tests/settings_core.py
Normal file
33
tests/settings_core.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
"""
|
||||||
|
Alliance Auth Test Suite Django settings
|
||||||
|
|
||||||
|
Testing core packages only
|
||||||
|
"""
|
||||||
|
|
||||||
|
from allianceauth.project_template.project_name.settings.base import *
|
||||||
|
|
||||||
|
# Use nose to run all tests
|
||||||
|
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
|
||||||
|
|
||||||
|
NOSE_ARGS = [
|
||||||
|
#'--with-coverage',
|
||||||
|
#'--cover-package=',
|
||||||
|
#'--exe', # If your tests need this to be found/run, check they py files are not chmodded +x
|
||||||
|
]
|
||||||
|
|
||||||
|
# Celery configuration
|
||||||
|
CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing
|
||||||
|
|
||||||
|
INSTALLED_APPS += [
|
||||||
|
'django_nose',
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = 'tests.urls'
|
||||||
|
|
||||||
|
CACHES['default'] = {'BACKEND': 'django.core.cache.backends.db.DatabaseCache'}
|
||||||
|
|
||||||
|
PASSWORD_HASHERS = [
|
||||||
|
'django.contrib.auth.hashers.MD5PasswordHasher',
|
||||||
|
]
|
||||||
|
|
||||||
|
LOGGING = None # Comment out to enable logging for debugging
|
10
tox.ini
10
tox.ini
@ -1,11 +1,12 @@
|
|||||||
[tox]
|
[tox]
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
usedevelop = true
|
usedevelop = true
|
||||||
envlist = py{35,36,37,38}-dj{2X}
|
envlist = py{35,36,37,38}-{all}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv =
|
setenv =
|
||||||
DJANGO_SETTINGS_MODULE = settings
|
all: DJANGO_SETTINGS_MODULE = tests.settings_all
|
||||||
|
core: DJANGO_SETTINGS_MODULE = tests.settings_core
|
||||||
basepython =
|
basepython =
|
||||||
py35: python3.5
|
py35: python3.5
|
||||||
py36: python3.6
|
py36: python3.6
|
||||||
@ -13,8 +14,9 @@ basepython =
|
|||||||
py38: python3.8
|
py38: python3.8
|
||||||
deps=
|
deps=
|
||||||
coverage
|
coverage
|
||||||
dj2X: Django>=2.0,<3.0
|
Django>=2.0,<3.0
|
||||||
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
||||||
commands =
|
commands =
|
||||||
coverage run runtests.py -v 2
|
all: coverage run runtests.py -v 2
|
||||||
|
core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2
|
||||||
coverage report -m
|
coverage report -m
|
||||||
|
Loading…
x
Reference in New Issue
Block a user