From 9913af539be58be7c402757f3be3b90f57ce657a Mon Sep 17 00:00:00 2001 From: Ross Elliot <Ross.Elliot@ess.eu> Date: Tue, 19 Oct 2021 11:15:34 +0200 Subject: [PATCH 1/2] Re-enable test_gendev_logger tests in CI/CD Add test jobs for test_gendev_logger [ICSHWI-8157] --- .gitlab-ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c9c3317..d0cad8a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,6 +56,14 @@ stages: - analyse - deployment +test_py38_gendev_logger: + <<: *runner_tags + <<: *test_py38 + script: + - tox -e py38 -- tests/unit/test_gendev_logger.py $TOX_ARGS + - sed 's|.tox/py38/lib/python3.8/site-packages|src|g' -i coverage.xml + - sed 's|.tox.py38.lib.python3.8.site-packages.||g' -i coverage.xml + test_py38_nat_mch: <<: *runner_tags <<: *test_py38 @@ -91,6 +99,14 @@ test_py38_nat_mch_web: - sed 's|.tox.py38.lib.python3.8.site-packages.||g' -i coverage.xml needs: ["test_py38_nat_mch_moxa"] +test_py37_gendev_logger: + <<: *runner_tags + <<: *test_py37 + script: + - tox -e py37 -- tests/unit/test_gendev_logger.py $TOX_ARGS + - sed 's|.tox/py38/lib/python3.8/site-packages|src|g' -i coverage.xml + - sed 's|.tox.py38.lib.python3.8.site-packages.||g' -i coverage.xml + test_py37_nat_mch: <<: *runner_tags <<: *test_py37 -- GitLab From 36ee195d8fa9697a01163181a2b2d55eafd338f1 Mon Sep 17 00:00:00 2001 From: Ross Elliot <Ross.Elliot@ess.eu> Date: Tue, 19 Oct 2021 13:09:38 +0200 Subject: [PATCH 2/2] Add sleep time to teardown to allow Moxa connection to close properly ICSHWI-8157 --- tests/unit/test_nat_mch.py | 4 ++++ tests/unit/test_nat_mch_moxa.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/unit/test_nat_mch.py b/tests/unit/test_nat_mch.py index 21d9f96..d7e17eb 100644 --- a/tests/unit/test_nat_mch.py +++ b/tests/unit/test_nat_mch.py @@ -13,6 +13,7 @@ from pytest_testconfig import config from gendev_tools.gendev_interface import ConnType from gendev_tools.gendev_err import ConnNotImplemented, FeatureNotSupported from gendev_tools.nat_mch.nat_mch import NATMCH +import time __author__ = ["Felipe Torres González"] @@ -536,6 +537,9 @@ class TestNATMCH2: # before the next test if hasattr(self.mch, "_mox_conn"): self.mch._mox_conn.close() + # Moxa takes a few seconds to close + # connection properly + time.sleep(2) if hasattr(self.mch, "_tel_conn"): self.mch._tel_conn.close() diff --git a/tests/unit/test_nat_mch_moxa.py b/tests/unit/test_nat_mch_moxa.py index 2e7e000..455ad6f 100644 --- a/tests/unit/test_nat_mch_moxa.py +++ b/tests/unit/test_nat_mch_moxa.py @@ -9,6 +9,7 @@ from gendev_tools.nat_mch.nat_mch_moxa import NATMCHMoxa from gendev_tools.gendev_err import FeatureNotSupported from collections import OrderedDict from pytest_testconfig import config +import time __author__ = "Felipe Torres González" __copyright__ = "Copyright 2021, ESS GenDev Tools" @@ -35,6 +36,7 @@ def test_moxa(): # Close session if test_moxa._session_open: test_moxa.close() + time.sleep(2) class TestNATMCHMOXA: -- GitLab