aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2022-07-01 09:49:58 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2022-07-07 10:43:38 +0200
commit861f79d46397d8bbc5b55b95bc4ca2ac0fb1f247 (patch)
treee396c5e2e67e6045dedea9f54163a8fa8880d277
parent4c91aa8d974d95fec6b39741102327716a7cf20d (diff)
Update to Alpine 3.16
It also switches to pytest because nose fails vs py3.10. Change-Id: I920baef12d4934b359873519d5518835007c2f02 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--ansible/site.gate.yml2
-rw-r--r--build.sh4
-rw-r--r--docker/core/Dockerfile4
-rw-r--r--docker/core/testcases.yaml6
-rw-r--r--docker/mts/Dockerfile2
-rw-r--r--docker/mts/testcases.yaml2
-rw-r--r--test-requirements.txt4
-rw-r--r--tox.ini42
-rw-r--r--upper-constraints.txt4
9 files changed, 34 insertions, 36 deletions
diff --git a/ansible/site.gate.yml b/ansible/site.gate.yml
index d4de0bdd..207e4b64 100644
--- a/ansible/site.gate.yml
+++ b/ansible/site.gate.yml
@@ -8,7 +8,7 @@
docker_tags:
- latest:
branch: master
- dependency: '3.15'
+ dependency: '3.16'
builds:
dependency:
repo: _
diff --git a/build.sh b/build.sh
index 3f100862..e7056514 100644
--- a/build.sh
+++ b/build.sh
@@ -24,12 +24,12 @@ build_opts=(--pull=true --no-cache --force-rm=true)
for arch in ${arch}; do
if [[ ${arch} == arm64 ]]; then
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.15|arm64v8/alpine:3.15|g" {} +
+ -e "s|alpine:3.16|arm64v8/alpine:3.16|g" {} +
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/xtesting|${repo}/xtesting:arm64-${tag}|g" {} +
elif [[ ${arch} == arm ]]; then
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.15|arm32v6/alpine:3.15|g" {} +
+ -e "s|alpine:3.16|arm32v6/alpine:3.16|g" {} +
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/xtesting|${repo}/xtesting:arm-${tag}|g" {} +
else
diff --git a/docker/core/Dockerfile b/docker/core/Dockerfile
index b083e36a..f8d21c22 100644
--- a/docker/core/Dockerfile
+++ b/docker/core/Dockerfile
@@ -1,4 +1,4 @@
-FROM alpine:3.15
+FROM alpine:3.16
ARG BRANCH=master
ARG OPENSTACK_TAG=master
@@ -27,7 +27,7 @@ RUN apk -U upgrade && \
addgroup -g 1000 xtesting && adduser -u 1000 -G xtesting -D xtesting && \
mkdir -p /var/lib/xtesting/results && chown -R xtesting: /var/lib/xtesting && \
apk del .build-deps
-COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.10/site-packages/xtesting/ci/testcases.yaml
USER xtesting
WORKDIR /var/lib/xtesting/results
CMD ["run_tests", "-t", "all"]
diff --git a/docker/core/testcases.yaml b/docker/core/testcases.yaml
index 508d1031..360869d4 100644
--- a/docker/core/testcases.yaml
+++ b/docker/core/testcases.yaml
@@ -50,7 +50,7 @@ tiers:
args:
suites:
- >-
- /usr/lib/python3.9/site-packages/xtesting/samples/HelloWorld.robot
+ /usr/lib/python3.10/site-packages/xtesting/samples/HelloWorld.robot
variable:
- 'var01:foo'
- 'var02:bar'
@@ -64,7 +64,7 @@ tiers:
name: behaveframework
args:
suites:
- - /usr/lib/python3.9/site-packages/xtesting/samples/features
+ - /usr/lib/python3.10/site-packages/xtesting/samples/features
tags:
- foo
- case_name: eighth
@@ -76,5 +76,5 @@ tiers:
run:
name: ansible
args:
- private_data_dir: /usr/lib/python3.9/site-packages/xtesting/samples
+ private_data_dir: /usr/lib/python3.10/site-packages/xtesting/samples
playbook: helloworld.yml
diff --git a/docker/mts/Dockerfile b/docker/mts/Dockerfile
index ae32d8b8..502cf754 100644
--- a/docker/mts/Dockerfile
+++ b/docker/mts/Dockerfile
@@ -22,6 +22,6 @@ RUN case $(uname -m) in x86_64) \
java -jar target/mts-${MTS_TAG}-installer.jar -options /src/mts-installer.properties) && \
rm -rf /root/.m2/ ${APP_FOLDER}/tutorial /src/mts-installer.properties /src/git-mts && \
apk del .build-deps;; esac
-COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.10/site-packages/xtesting/ci/testcases.yaml
USER xtesting
CMD ["run_tests", "-t", "all"]
diff --git a/docker/mts/testcases.yaml b/docker/mts/testcases.yaml
index 69d05210..4ebeeabb 100644
--- a/docker/mts/testcases.yaml
+++ b/docker/mts/testcases.yaml
@@ -15,7 +15,7 @@ tiers:
run:
name: 'mts'
args:
- test_file: /usr/lib/python3.9/site-packages/xtesting/samples/mts/test.xml
+ test_file: /usr/lib/python3.10/site-packages/xtesting/samples/mts/test.xml
testcases:
- Pause_5_sec
max_duration: 2 # in seconds
diff --git a/test-requirements.txt b/test-requirements.txt
index 4ba8a8f6..a5399586 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,7 +3,9 @@
# process, which may cause wedges in the gate later.
coverage!=4.4 # Apache-2.0
mock!=4.0.0,!=4.0.1 # BSD
-nose # LGPL
+pytest # MIT
+pytest-html #MPL-2.0
+pytest-cov
flake8 # MIT
pylint # GPLv2
sphinx!=1.6.6,!=1.6.7,!=2.1.0,!=3.0.0,!=3.4.2 # BSD
diff --git a/tox.ini b/tox.ini
index c09e942d..d6924538 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = docs,pep8,pylint,yamllint,bashate,py39,cover,perm
+envlist = docs,pep8,pylint,yamllint,bashate,py310,cover,perm
skipsdist = True
[testenv]
@@ -11,33 +11,32 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
install_command = pip install {opts} {packages}
-commands = nosetests --with-xunit \
- --with-coverage \
- --cover-tests \
- --cover-package=xtesting \
- --cover-xml \
- --cover-html \
- xtesting/tests/unit
+commands =
+ pytest xtesting/tests/unit \
+ --junit-xml=junit.xml \
+ --html=report.html --self-contained-html \
+ --cov=xtesting --cov-reset --cov-report html \
+ xtesting/tests/unit
[testenv:docs]
-basepython = python3.9
+basepython = python3.10
commands =
doc8 README.rst api --ignore-path api/build
sphinx-build -W -b html api/ api/build
[testenv:pep8]
-basepython = python3.9
+basepython = python3.10
commands = flake8
[testenv:pylint]
-basepython = python3.9
+basepython = python3.10
whitelist_externals = bash
commands =
pylint --min-similarity-lines=10 \
--disable=locally-disabled --ignore-imports=y --reports=n --extension-pkg-whitelist=lxml xtesting
[testenv:yamllint]
-basepython = python3.9
+basepython = python3.10
files =
.travis.yml
ansible
@@ -45,33 +44,28 @@ files =
commands =
yamllint -s {[testenv:yamllint]files}
-[testenv:py38]
-commands = nosetests xtesting/tests/unit
-
[testenv:bashate]
-basepython = python3.9
+basepython = python3.10
files =
build.sh
commands = bashate {[testenv:bashate]files}
[testenv:bandit]
-basepython = python3.9
+basepython = python3.10
commands = bandit -r xtesting -x tests -n 5 -ll -s B602
[testenv:cover]
-basepython = python3.9
+basepython = python3.10
dirs =
xtesting/tests/unit/ci
xtesting/tests/unit/core
xtesting/tests/unit/utils/test_decorators.py
-commands = nosetests --with-coverage --cover-tests \
- --cover-package xtesting.core \
- --cover-package xtesting.tests.unit \
- --cover-package xtesting.utils.decorators \
- --cover-min-percentage 100 {[testenv:cover]dirs}
+commands =
+ pytest --cov=xtesting --cov-reset --cov-report html --cov-fail-under=100 \
+ {[testenv:cover]dirs}
[testenv:perm]
-basepython = python3.9
+basepython = python3.10
whitelist_externals = bash
path=. -not -path './.tox/*' -not -path './.git/*' -not -path './doc/reveal.js/*'
commands =
diff --git a/upper-constraints.txt b/upper-constraints.txt
index 32e09e1e..613a9718 100644
--- a/upper-constraints.txt
+++ b/upper-constraints.txt
@@ -4,5 +4,7 @@ behave===1.2.6
behave-html-formatter===0.9.8
pylint===2.11.1
flake8===4.0.1
-nose===1.3.7
ansible-lint===5.2.1
+pytest===7.1.2
+pytest-cov===3.0.0
+pytest-html===3.1.1