From 7e195ded9fa55e4c535b751fb9289f191b81c48c Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 1 Jul 2022 09:49:58 +0200 Subject: Update to Alpine 3.16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also switches to pytest because nose fails vs py3.10. Change-Id: I920baef12d4934b359873519d5518835007c2f02 Signed-off-by: Cédric Ollivier (cherry picked from commit 861f79d46397d8bbc5b55b95bc4ca2ac0fb1f247) --- ansible/site.gate.yml | 2 +- build.sh | 4 ++-- docker/core/Dockerfile | 4 ++-- docker/core/testcases.yaml | 6 +++--- docker/mts/Dockerfile | 2 +- docker/mts/testcases.yaml | 2 +- test-requirements.txt | 4 +++- tox.ini | 42 ++++++++++++++++++------------------------ upper-constraints.txt | 4 +++- 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 c3352c40..6be850fc 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:yoga|${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:yoga|${repo}/xtesting:arm-${tag}|g" {} + else diff --git a/docker/core/Dockerfile b/docker/core/Dockerfile index 649c1060..a610ceef 100644 --- a/docker/core/Dockerfile +++ b/docker/core/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.15 +FROM alpine:3.16 ARG BRANCH=stable/yoga ARG OPENSTACK_TAG=stable/yoga @@ -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 b2278b2c..4eb9dd3d 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 7de5e259..ae7c109c 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 -- cgit 1.2.3-korg