Add gate for py3k compilance on fm-rest-api

Alot of work has gone into making sure that starlingx is python3
compatibity. To ensure that we remain python3 compatible add a pylint
gate that runs with the --py3k argument to check for possible python3
syntax erorrs.

Story: 2006796
Task: 43102
Signed-off-by: Bernardo Decco de Siqueira <bernardo.deccodesiqueira@windriver.com>
Change-Id: I1275e8d1d0fd0d9e998a29a67372de4ed78a2c7d
This commit is contained in:
Bernardo Decco de Siqueira 2021-08-27 10:24:08 -03:00 committed by Bernardo Decco
parent 83f5caa9b7
commit 878aa70f57
3 changed files with 29 additions and 1 deletions

View File

@ -15,6 +15,7 @@
- stx-fault-build - stx-fault-build
- fault-rest-api-py27 - fault-rest-api-py27
- fault-rest-api-py36 - fault-rest-api-py36
- fault-rest-api-py3k
gate: gate:
jobs: jobs:
- openstack-tox-linters - openstack-tox-linters
@ -22,6 +23,7 @@
- fault-tox-pylint - fault-tox-pylint
- fault-rest-api-py27 - fault-rest-api-py27
- fault-rest-api-py36 - fault-rest-api-py36
- fault-rest-api-py3k
post: post:
jobs: jobs:
- stx-fault-upload-git-mirror - stx-fault-upload-git-mirror
@ -82,6 +84,18 @@
tox_envlist: py36 tox_envlist: py36
tox_extra_args: -c fm-rest-api/fm/tox.ini tox_extra_args: -c fm-rest-api/fm/tox.ini
- job:
name: fault-rest-api-py3k
parent: tox
description: |
Run py3k test for fm-rest-api
nodeset: ubuntu-bionic
required-projects:
- starlingx/config
vars:
tox_envlist: py3k
tox_extra_args: -c fm-rest-api/fm/tox.ini
- job: - job:
name: fault-tox-pylint name: fault-tox-pylint
parent: tox parent: tox

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py27,py36 envlist = py27,py36,py3k
minversion = 2.3 minversion = 2.3
skipsdist = True skipsdist = True
stxdir = {toxinidir}/../../../ stxdir = {toxinidir}/../../../
@ -33,6 +33,16 @@ commands =
stestr run {posargs} stestr run {posargs}
stestr slowest stestr slowest
[testenv:py3k]
basepython = python3
deps = {[testenv]deps}
-e{toxinidir}/../../../config/tsconfig/tsconfig
-e{toxinidir}/../../../config/sysinv/cgts-client/cgts-client
-r{toxinidir}/../../requirements.txt
-r{toxinidir}/../../test-requirements.txt
commands = pylint {posargs} --py3k --disable=W fm --rcfile=../../pylint.rc
[testenv:cover] [testenv:cover]
deps = {[testenv]deps} deps = {[testenv]deps}
coverage coverage

View File

@ -157,6 +157,10 @@ basepython = python3
whitelist_externals = cat whitelist_externals = cat
commands = cat /etc/fm/fm.conf commands = cat /etc/fm/fm.conf
[testenv:py3k]
basepython = python3
description = Dummy environment to allow py3k to be run in subdir tox
[testenv:bandit] [testenv:bandit]
basepython = python3 basepython = python3
description = Bandit code scan for *.py files under config folder description = Bandit code scan for *.py files under config folder