Update to Alpine 3.16 19/73419/5
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 1 Jul 2022 07:49:58 +0000 (09:49 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 7 Jul 2022 08:43:38 +0000 (10:43 +0200)
It also switches to pytest because
nose fails vs py3.10.

Change-Id: I920baef12d4934b359873519d5518835007c2f02
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
ansible/site.gate.yml
build.sh
docker/core/Dockerfile
docker/core/testcases.yaml
docker/mts/Dockerfile
docker/mts/testcases.yaml
test-requirements.txt
tox.ini
upper-constraints.txt

index d4de0bd..207e4b6 100644 (file)
@@ -8,7 +8,7 @@
       docker_tags:
         - latest:
             branch: master
-            dependency: '3.15'
+            dependency: '3.16'
       builds:
         dependency:
           repo: _
index 3f10086..e705651 100644 (file)
--- 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
index b083e36..f8d21c2 100644 (file)
@@ -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"]
index 508d103..360869d 100644 (file)
@@ -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
index ae32d8b..502cf75 100644 (file)
@@ -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"]
index 69d0521..4ebeeab 100644 (file)
@@ -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
index 4ba8a8f..a539958 100644 (file)
@@ -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 c09e942..d692453 100644 (file)
--- 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 =
index 32e09e1..613a971 100644 (file)
@@ -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