Use Horizon project template for django jobs

Horizon defined a project template 'horizon-non-primary-django-jobs'
for django jobs. This patch use that template to run django jobs
here and fix the failed test cases for django2.2 support by replacing
None with an empty string and add renderer argument.
For information please refer [1], [2], [3].

[1] https://review.opendev.org/#/c/681969/
[2] https://github.com/django/django/commit/6fe9c45b725
[3] https://docs.djangoproject.com/en/2.1/releases/2.1/#features-removed-in-2-1
Change-Id: I9a62bb0a56b16cd6caa6cc9bf7db9b85c99ed580
This commit is contained in:
manchandavishal 2019-10-09 10:00:48 +00:00 committed by Vishal Manchanda
parent c3d3f42ac3
commit 3584317a46
5 changed files with 18 additions and 39 deletions

View File

@ -1,13 +1,11 @@
- project:
templates:
- check-requirements
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python-jobs-horizon
- openstack-python3-train-jobs-horizon
- release-notes-jobs-python3
check:
jobs:
- sahara-dashboard-tox-python3-django111
experimental:
jobs:
- sahara-dashboard-integration
@ -23,12 +21,6 @@
- ^releasenotes/.*$
- ^sahara_dashboard/locale/.*$
- job:
name: sahara-dashboard-tox-python3-django111
parent: sahara-dashboard-tox-base
vars:
tox_envlist: py3-dj111
- job:
name: sahara-dashboard-integration
parent: devstack

View File

@ -177,14 +177,14 @@ class DataProcessingNodeGroupTests(test.TestCase):
'hadoop_version': ngt.hadoop_version,
'description': ngt.description,
'flavor': flavor.id,
'availability_zone': None,
'availability_zone': '',
'storage': 'ephemeral_drive',
'volumes_per_node': 0,
'volumes_size': 0,
'volume_type': None,
'volume_type': '',
'volume_local_to_instance': False,
'volumes_availability_zone': None,
'floating_ip_pool': None,
'volumes_availability_zone': '',
'floating_ip_pool': '',
'security_autogroup': True,
'processes': 'HDFS:namenode',
'use_autoconfig': True,
@ -279,14 +279,14 @@ class DataProcessingNodeGroupTests(test.TestCase):
'hadoop_version': ngt.hadoop_version,
'description': ngt.description,
'flavor': flavor.id,
'availability_zone': None,
'availability_zone': '',
'storage': 'ephemeral_drive',
'volumes_per_node': 0,
'volumes_size': 0,
'volume_type': None,
'volume_type': '',
'volume_local_to_instance': False,
'volumes_availability_zone': None,
'floating_ip_pool': None,
'volumes_availability_zone': '',
'floating_ip_pool': '',
'is_proxy_gateway': False,
'security_autogroup': True,
'processes': 'HDFS:namenode',
@ -328,10 +328,10 @@ class DataProcessingNodeGroupTests(test.TestCase):
volumes_availability_zone=None,
node_processes=['namenode'],
node_configs={},
floating_ip_pool=None,
floating_ip_pool='',
security_groups=[],
auto_security_group=True,
availability_zone=None,
availability_zone='',
use_autoconfig=True,
is_proxy_gateway=False,
shares=[],

View File

@ -382,7 +382,7 @@ class CheckboxSelectMultiple(forms.CheckboxSelectMultiple):
attrs.update(extra_attrs)
return attrs
def render(self, name, value, attrs=None, choices=()):
def render(self, name, value, attrs=None, choices=(), renderer=None):
if value is None:
value = []
has_id = attrs and 'id' in attrs

View File

@ -133,7 +133,7 @@ def data(TEST):
# Nodegroup_Templates.
ngt1_dict = {
"created_at": "2014-06-04T14:01:03",
"description": None,
"description": "",
"flavor_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"availability_zone": None,
"floating_ip_pool": None,

23
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 2.0
envlist = py3-dj111,py3-dj21,py27,py37,pep8
envlist = py3-{dj111,dj22},py27,py37,pep8
skipsdist = True
[testenv]
@ -10,7 +10,10 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = /bin/bash
commands = {envpython} {toxinidir}/manage.py test --settings=sahara_dashboard.test.settings --exclude-tag integration {posargs}
commands =
dj111: pip install django>=1.11,<2
dj22: pip install django>=2.2,<2.3
{envpython} {toxinidir}/manage.py test --settings=sahara_dashboard.test.settings --exclude-tag integration {posargs}
[testenv:py27]
setenv =
@ -32,22 +35,6 @@ commands = flake8
basepython = python3
commands = {posargs}
[testenv:py3-dj111]
basepython = python3
setenv =
DJANGO_SETTINGS_MODULE=sahara_dashboard.test.settings
commands =
pip install django>=1.11,<2
{[testenv]commands}
[testenv:py3-dj21]
basepython = python3
setenv =
DJANGO_SETTINGS_MODULE=sahara_dashboard.test.settings
commands =
pip install django>=2.1,<2.2
{[testenv]commands}
[testenv:py27integration]
basepython = python2.7
passenv = AVCONV_INSTALLED