Switch to Python 3.7 and Alpine 3.10 77/68277/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Sat, 27 Jul 2019 15:09:05 +0000 (17:09 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 27 Jul 2019 18:39:34 +0000 (20:39 +0200)
pylint is updated to 2.3.1 (lastest py3.7 version)

Change-Id: I8b70e9764e2802aeb517969c265fbebfa03458ce
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
.travis.yml
ansible/site.yml
build.sh
docker/core/Dockerfile
docker/features/Dockerfile
docker/healthcheck/Dockerfile
docker/smoke/Dockerfile
functest_kubernetes/test_k8stest.py
test-requirements.txt
tox.ini

index f957587..4fa7e6c 100644 (file)
@@ -9,9 +9,9 @@ addons:
       - libssl1.0.0
 
 before_script:
-  - 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)
@@ -21,7 +21,7 @@ before_script:
 jobs:
   include:
     - stage: run unit tests
-      script: tox -e pep8,pylint,yamllint,ansiblelint,bashate,py27,py36
+      script: tox -e pep8,pylint,yamllint,ansiblelint,bashate,py27,py37
     - stage: build functest-kubernetes-core image
       script: sudo -E bash build.sh
       env:
index 86c9820..7db0d8a 100644 (file)
@@ -10,7 +10,7 @@
           - repo: _
             dport:
             container: golang
-            tag: alpine3.9
+            tag: alpine3.10
         steps:
           - name: build opnfv/functest-kubernetes-core
             containers:
index cdb9bec..610b17b 100644 (file)
--- a/build.sh
+++ b/build.sh
@@ -29,11 +29,11 @@ done
 [ ! -z "${amd64_dirs}" ] &&
     (docker rmi \
         "${repo}/functest-kubernetes-core:amd64-latest" \
-        golang:alpine3.9 || true)
+        golang:alpine3.10 || true)
 find . -name Dockerfile -exec git checkout {} +
 
 find . -name Dockerfile -exec sed -i \
-    -e "s|golang:alpine3.9|arm64v8/golang:alpine3.9|g" {} +
+    -e "s|golang:alpine3.10|arm64v8/golang:alpine3.10|g" {} +
 find . -name Dockerfile -exec sed -i \
     -e "s|opnfv/functest-kubernetes-core|\
 ${repo}/functest-kubernetes-core:arm64-latest|g" {} +
@@ -50,7 +50,7 @@ for dir in ${arm64_dirs}; do
 done
 [ ! -z "${arm64_dirs}" ] &&
     (docker rmi "${repo}/functest-kubernetes-core:arm64-latest" \
-        arm64v8/golang:alpine3.9 || true)
+        arm64v8/golang:alpine3.10 || true)
 find . -name Dockerfile -exec git checkout {} +
 
 exit $?
index 73ad266..5ea3baa 100644 (file)
@@ -1,4 +1,4 @@
-FROM golang:alpine3.9
+FROM golang:alpine3.10
 
 ARG BRANCH=master
 ARG OPENSTACK_TAG=master
@@ -22,5 +22,5 @@ RUN apk --no-cache add --update python3 bash git grep libffi openssl && \
     printf "[database]\nconnection = 'sqlite:////var/lib/rally/database/rally.sqlite'" > /etc/rally/rally.conf && \
     mkdir -p /var/lib/rally/database && rally db create && \
     apk del .build-deps
-COPY logging.ini /usr/lib/python3.6/site-packages/xtesting/ci/logging.ini
+COPY logging.ini /usr/lib/python3.7/site-packages/xtesting/ci/logging.ini
 CMD ["run_tests", "-t", "all"]
index e4c60b6..1e91fe7 100644 (file)
@@ -15,5 +15,5 @@ RUN apk --no-cache add --update make bash git go \
         -rthirdparty-requirements.txt && \
     rm -f thirdparty-requirements.txt && \
     apk del .build-deps
-COPY testcases.yaml /usr/lib/python3.6/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
 CMD ["run_tests", "-t", "all"]
index 1ee82be..9b751d7 100644 (file)
@@ -16,5 +16,5 @@ RUN apk --no-cache add --update make bash git \
         mv _output/bin/* /usr/local/bin) && \
     rm -r /src/k8s.io && \
     apk del .build-deps
-COPY testcases.yaml /usr/lib/python3.6/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
 CMD ["run_tests", "-t", "all"]
index e5424d0..72318e7 100644 (file)
@@ -1,4 +1,4 @@
 FROM opnfv/functest-kubernetes-healthcheck
 
-COPY testcases.yaml /usr/lib/python3.6/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
 CMD ["run_tests", "-t", "all"]
index 81d9285..16b0f24 100644 (file)
@@ -38,8 +38,8 @@ class K8sTests(unittest.TestCase):
         self.k8stesting.config = 'not_file'
         with mock.patch.object(self.k8stesting,
                                '_K8sTesting__logger') as mock_logger:
-            self.assertEquals(self.k8stesting.run(),
-                              testcase.TestCase.EX_RUN_ERROR)
+            self.assertEqual(self.k8stesting.run(),
+                             testcase.TestCase.EX_RUN_ERROR)
             mock_logger.error.assert_called_with(
                 "Cannot run k8s testcases. Config file not found")
         mock_func.assert_called_with('not_file')
@@ -54,8 +54,8 @@ class K8sTests(unittest.TestCase):
     @mock.patch('functest_kubernetes.k8stest.os.path.isfile')
     @mock.patch('functest_kubernetes.k8stest.subprocess.Popen')
     def test_run(self, *args):
-        self.assertEquals(self.k8stesting.run(),
-                          testcase.TestCase.EX_OK)
+        self.assertEqual(self.k8stesting.run(),
+                         testcase.TestCase.EX_OK)
         for loop in range(3):
             args[loop].assert_called()
 
index de2148a..5ea05ff 100644 (file)
@@ -5,7 +5,7 @@ coverage!=4.4 # Apache-2.0
 mock # BSD
 nose # LGPL
 flake8<2.6.0,>=2.5.4 # MIT
-pylint==1.4.5 # GPLv2
+pylint # GPLv2
 yamllint
 ansible-lint
 bashate # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 017d8fc..8351383 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = pep8,pylint,yamllint,ansiblelint,bashate,py27,bandit
+envlist = pep8,pylint,yamllint,ansiblelint,bashate,py27,py37,bandit
 
 [testenv]
 usedevelop = True
@@ -18,15 +18,15 @@ commands = nosetests --with-xunit \
   functest_kubernetes
 
 [testenv:pep8]
-basepython = python2.7
+basepython = python3.7
 commands = flake8
 
 [testenv:pylint]
-basepython = python2.7
+basepython = python3.7
 commands = pylint --disable=locally-disabled --reports=n functest_kubernetes
 
 [testenv:yamllint]
-basepython = python2.7
+basepython = python3.7
 files =
   .travis.yml
   docker
@@ -35,18 +35,18 @@ commands =
   yamllint {[testenv:yamllint]files}
 
 [testenv:ansiblelint]
-basepython = python2.7
+basepython = python3.7
 commands = ansible-lint ansible/site.yml
 
 [testenv:bandit]
-basepython = python2.7
+basepython = python3.7
 commands = bandit -r functest_kubernetes -x tests -n 5 -ll
 
-[testenv:py36]
+[testenv:py37]
 commands = nosetests functest_kubernetes
 
 [testenv:bashate]
-basepython = python2.7
+basepython = python3.7
 files =
   build.sh
 commands = bashate -e E005,E006,E042,E043 {[testenv:bashate]files}