From 8bf944f3c3b2160b2d2d47647fb6c97f9e133a88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Sat, 20 May 2017 11:57:35 +0200 Subject: [PATCH] Add baro_tests as requirements MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It also stops cloning it when building the docker container and updates the related unit tests. It bypasses the bug when importing collectd [1]. [1] https://jira.opnfv.org/browse/BAROMETER-79 Change-Id: Ie9f8ea2b3c95d6b1f5405d76b018cdcb62343a58 Signed-off-by: Cédric Ollivier --- docker/Dockerfile | 4 ---- functest/tests/unit/features/test_barometer.py | 5 ++--- requirements.txt | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4a570b5dd..ef5967f7f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -89,7 +89,6 @@ RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/doctor ${REPO RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/promise ${REPOS_DIR}/promise RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/netready ${REPOS_DIR}/netready RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/fds ${REPOS_DIR}/fds -RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/barometer ${REPOS_DIR}/barometer RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/sfc ${REPOS_DIR}/sfc RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/snaps ${REPOS_DIR}/snaps RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS_DIR}/securityscanning @@ -115,9 +114,6 @@ RUN cd ${FUNCTEST_REPO_DIR} \ && pip install -r requirements.txt \ && pip install -e . -RUN cd ${REPOS_DIR}/barometer \ - && pip install . - RUN pip install ${REPOS_DIR}/opera RUN find ${FUNCTEST_REPO_DIR} -name "*.py" \ diff --git a/functest/tests/unit/features/test_barometer.py b/functest/tests/unit/features/test_barometer.py index c6512615e..8c2585d9c 100644 --- a/functest/tests/unit/features/test_barometer.py +++ b/functest/tests/unit/features/test_barometer.py @@ -16,9 +16,8 @@ import unittest import mock from functest.core import testcase -sys.modules['baro_tests'] = mock.Mock() # noqa -# pylint: disable=wrong-import-position -from functest.opnfv_tests.features import barometer +with mock.patch('functest.utils.functest_utils.get_parameter_from_yaml'): + from functest.opnfv_tests.features import barometer class BarometerTesting(unittest.TestCase): diff --git a/requirements.txt b/requirements.txt index 7b8af6575..425d4a6c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -38,3 +38,4 @@ iniparse==0.4 PrettyTable>=0.7.1,<0.8 # BSD six>=1.9.0 # MIT git+https://gerrit.opnfv.org/gerrit/releng#egg=opnfv&subdirectory=modules +git+https://gerrit.opnfv.org/gerrit/barometer#egg=baro_tests -- 2.16.6