before_script:
- sudo apt-get -y install qemu-user-static
- - sudo add-apt-repository -y ppa:jonathonf/python-3.6
+ - sudo add-apt-repository -y ppa:deadsnakes/ppa
- sudo apt-get update
- - sudo apt-get install python3.6 python3.6-dev
+ - sudo apt-get install python3.7 python3.7-dev
- sudo pip install tox
- sudo -E docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
- (cd .. && git clone https://github.com/estesp/manifest-tool)
include:
- stage: run unit tests
script: >
- tox -e docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,py36,cover
+ tox -e docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,py37,cover
- stage: build xtesting images
script: sudo -E bash build.sh
env:
for arch in ${arch};do
if [[ ${arch} == arm64 ]]; then
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.9|multiarch/alpine:arm64-v3.9|g" {} +
+ -e "s|alpine:3.10|multiarch/alpine:arm64-v3.10|g" {} +
elif [[ ${arch} == arm ]]; then
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.9|multiarch/alpine:armhf-v3.9|g" {} +
+ -e "s|alpine:3.10|multiarch/alpine:armhf-v3.10|g" {} +
fi
(cd docker && docker build "${build_opts[@]}" \
-t "${repo}/${image}:${arch}-${tag}" .)
-FROM alpine:3.9
+FROM alpine:3.10
ARG BRANCH=master
ARG OPENSTACK_TAG=master
mock # BSD
nose # LGPL
flake8<2.6.0,>=2.5.4 # MIT
-pylint==1.4.5 # GPLv2
+pylint # GPLv2
sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7;python_version>='3.4' # BSD
sphinx-rtd-theme
[tox]
-envlist = docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,perm,cover
+envlist = docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,py37,cover
skipsdist = True
[testenv]
xtesting/tests/unit
[testenv:docs]
-basepython = python2.7
+basepython = python3.7
commands =
doc8 README.rst api --ignore-path api/build
sphinx-build -W -b html api/ api/build
[testenv:pep8]
-basepython = python2.7
+basepython = python3.7
commands = flake8
[testenv:pylint]
-basepython = python2.7
+basepython = python3.7
whitelist_externals = bash
commands =
pylint --min-similarity-lines=10 \
--disable=locally-disabled --ignore-imports=y --reports=n xtesting
[testenv:yamllint]
-basepython = python2.7
+basepython = python3.7
files =
.travis.yml
ansible
yamllint -s {[testenv:yamllint]files}
[testenv:ansiblelint]
-basepython = python2.7
+basepython = python3.7
commands =
ansible-lint ansible/site.yml
commands = nosetests xtesting/tests/unit
[testenv:bashate]
-basepython = python2.7
+basepython = python3.7
files =
build.sh
commands = bashate {[testenv:bashate]files}
[testenv:bandit]
-basepython = python2.7
+basepython = python3.7
commands = bandit -r xtesting -x tests -n 5 -ll -s B602
[testenv:cover]
-basepython = python2.7
+basepython = python3.7
dirs =
xtesting/tests/unit/ci
xtesting/tests/unit/core
--cover-min-percentage 100 {[testenv:cover]dirs}
[testenv:perm]
-basepython = python2.7
+basepython = python3.7
whitelist_externals = bash
path=. -not -path './.tox/*' -not -path './.git/*' -not -path './doc/reveal.js/*'
commands =
robotframework===3.1.1
bandit===1.1.0
behave===1.2.6
+pylint===1.9.5;python_version=='2.7'
+pylint===2.3.1;python_version=='3.7'
class BlockingTestFailed(Exception):
"""Exception when the blocking test fails"""
- pass
-class RunTestsParser(object):
+class RunTestsParser():
"""Parser to run tests"""
# pylint: disable=too-few-public-methods
return vars(self.parser.parse_args(argv))
-class Runner(object):
+class Runner():
"""Runner class"""
def __init__(self):
from xtesting.utils import env
-class TierBuilder(object):
+class TierBuilder():
# pylint: disable=missing-docstring
def __init__(self, testcases_file):
return lines
-class Tier(object):
+class Tier():
def __init__(self, name, order, description=""):
self.tests_array = []
return msg.get_string()
-class TestCase(object):
+class TestCase():
def __init__(self, name, enabled, skipped, criteria, blocking,
description="", project=""):
@six.add_metaclass(abc.ABCMeta)
-class TestCase(object):
+class TestCase():
# pylint: disable=too-many-instance-attributes
"""Base model for single test case."""
data = [{'status': 'passed'}, {'status': 'passed'}]
self._test_result(data, 100)
- def test_count(self):
+ @mock.patch('six.moves.builtins.open', mock.mock_open())
+ def test_count(self, *args): # pylint: disable=unused-argument
self._response.extend([{'status': 'failed'}, {'status': 'skipped'}])
- with mock.patch('six.moves.builtins.open', mock.mock_open()), \
- mock.patch('json.load', mock.Mock(
- return_value=self._response)):
+ with mock.patch('json.load', mock.Mock(return_value=self._response)):
self.test.parse_results()
self.assertEqual(self.test.details['pass_tests'], 1)
self.assertEqual(self.test.details['fail_tests'], 1)
class AbstractFeatureTesting(unittest.TestCase):
def test_run_unimplemented(self):
+ # pylint: disable=abstract-class-instantiated
with self.assertRaises(TypeError):
feature.Feature(case_name="feature", project_name="xtesting")
class AbstractTestCaseTesting(unittest.TestCase):
def test_run_unimplemented(self):
+ # pylint: disable=abstract-class-instantiated
with self.assertRaises(TypeError):
testcase.TestCase(case_name="base", project_name="xtesting")