Merge "Add proper references to xml schemas"
authorCedric Ollivier <cedric.ollivier@orange.com>
Tue, 1 Jun 2021 14:46:29 +0000 (14:46 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 1 Jun 2021 14:46:29 +0000 (14:46 +0000)
.travis.yml
docker/core/Dockerfile
setup.cfg
tox.ini
xtesting/ci/tier_handler.py
xtesting/core/testcase.py
xtesting/tests/unit/ci/test_tier_handler.py
xtesting/utils/constants.py

index 6a23ba7..66ba80e 100644 (file)
@@ -2,17 +2,10 @@
 sudo: required
 services: docker
 language: generic
-dist: xenial
-addons:
-  apt:
-    packages:
-      - libssl1.0.0
+dist: focal
 
 before_script:
   - sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
-  - sudo add-apt-repository -y ppa:deadsnakes/ppa
-  - sudo apt-get update
-  - sudo apt-get install python3.8 python3.8-dev python3.8-distutils
   - sudo pip install tox tox-pip-version
   - sudo -E docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
   - (cd .. && git clone https://github.com/estesp/manifest-tool)
index 45248ff..c746fd0 100644 (file)
@@ -9,6 +9,7 @@ RUN apk -U upgrade && \
         python3-dev build-base libxml2-dev libxslt-dev linux-headers && \
     wget -q -O- https://opendev.org/openstack/requirements/raw/branch/$OPENSTACK_TAG/upper-constraints.txt > upper-constraints.txt && \
     sed -i -E /^PyYAML==+.*$/d upper-constraints.txt && \
+    sed -i -E /^six==+.*$/d upper-constraints.txt && \
     case $(uname -m) in aarch*|arm*) CFLAGS="-O0" \
         pip3 install --no-cache-dir \
             -cupper-constraints.txt \
index 1b7d171..944e2d0 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,11 @@
 [metadata]
 name = xtesting
 summary = OPNFV reference testing framework
-description-file =
+description_file =
     README.rst
 author = OPNFV
-author-email = opnfv-tech-discuss@lists.opnfv.org
-home-page = https://wiki.opnfv.org/display/functest
+author_email = opnfv-tech-discuss@lists.opnfv.org
+home_page = https://wiki.opnfv.org/display/functest
 classifiers =
     Intended Audience :: Information Technology
     Intended Audience :: System Administrators
diff --git a/tox.ini b/tox.ini
index b4bf6c5..9b48dc3 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -50,7 +50,7 @@ basepython = python3.8
 commands =
   ansible-lint -x303,305,306 ansible/site.yml
 
-[testenv:py37]
+[testenv:py38]
 commands = nosetests xtesting/tests/unit
 
 [testenv:bashate]
index 6f78f20..86f1374 100644 (file)
@@ -16,24 +16,6 @@ import textwrap
 import prettytable
 
 
-LINE_LENGTH = 72
-
-
-def split_text(text, max_len):
-    words = text.split()
-    lines = []
-    line = ""
-    for word in words:
-        if len(line) + len(word) < max_len - 1:
-            line += word + " "
-        else:
-            lines.append(line)
-            line = word + " "
-    if line != "":
-        lines.append(line)
-    return lines
-
-
 class Tier():
 
     def __init__(self, name, description=""):
index 8faf3f4..08ce426 100644 (file)
@@ -28,6 +28,7 @@ from six.moves import urllib
 
 from xtesting.utils import decorators
 from xtesting.utils import env
+from xtesting.utils import constants
 
 __author__ = "Cedric Ollivier <cedric.ollivier@orange.com>"
 
@@ -55,7 +56,7 @@ class TestCase():
     EX_PUBLISH_ARTIFACTS_ERROR = os.EX_SOFTWARE - 4
     """publish_artifacts() failed"""
 
-    dir_results = "/var/lib/xtesting/results"
+    dir_results = constants.RESULTS_DIR
     _job_name_rule = "(dai|week)ly-(.+?)-[0-9]*"
     headers = {'Content-Type': 'application/json'}
     __logger = logging.getLogger(__name__)
@@ -69,9 +70,9 @@ class TestCase():
         self.start_time = 0
         self.stop_time = 0
         self.is_skipped = False
-        self.output_log_name = 'xtesting.log'
-        self.output_debug_log_name = 'xtesting.debug.log'
-        self.res_dir = "{}/{}".format(self.dir_results, self.case_name)
+        self.output_log_name = os.path.basename(constants.LOG_PATH)
+        self.output_debug_log_name = os.path.basename(constants.DEBUG_LOG_PATH)
+        self.res_dir = os.path.join(self.dir_results, self.case_name)
 
     def __str__(self):
         try:
index 5ee62c4..668f33c 100644 (file)
@@ -29,11 +29,6 @@ class TierHandlerTesting(unittest.TestCase):
         self.testcase.str = self.testcase.__str__()
         self.tier.str = self.tier.__str__()
 
-    def test_split_text(self):
-        test_str = 'this is for testing'
-        self.assertEqual(tier_handler.split_text(test_str, 10),
-                         ['this is ', 'for ', 'testing '])
-
     def test_add_test(self):
         self.tier.add_test(self.test)
         self.assertEqual(self.tier.tests_array, [self.test])
index 7677f2e..acd0d31 100644 (file)
@@ -6,7 +6,7 @@ import os
 
 ENV_FILE = '/var/lib/xtesting/conf/env_file'
 
-RESULTS_DIR = '/var/lib/xtesting/results/'
+RESULTS_DIR = '/var/lib/xtesting/results'
 LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.log')
 DEBUG_LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.debug.log')