From f333e39cd54c15a0247b2bd89c47e6dd8de5f676 Mon Sep 17 00:00:00 2001 From: toor <elisabetta.giani@inaf.it> Date: Tue, 22 Dec 2020 20:45:28 +0100 Subject: [PATCH] fix-setup-bug: try to fix the problem with ska-skuid depencencies. Added the requirements.txt file to install packages needed during tests. Call 'pytest test' instead of 'python3 setup.py test' to run tests --- csp-lmc-mid/.make/k8s.mk | 2 +- csp-lmc-mid/requirements-tst.txt | 3 ++- csp-lmc-mid/setup.cfg | 6 +----- csp-lmc-mid/test-harness/Makefile | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/csp-lmc-mid/.make/k8s.mk b/csp-lmc-mid/.make/k8s.mk index 71c7b39..2d88343 100644 --- a/csp-lmc-mid/.make/k8s.mk +++ b/csp-lmc-mid/.make/k8s.mk @@ -229,7 +229,7 @@ k8s_test = tar -c . | \ --image-pull-policy=IfNotPresent \ --image=$(IMAGE_TO_TEST) -- \ /bin/bash -c "tar xv --strip-components 1 --warning=all && \ - python3 -m pip install . &&\ + python3 -m pip install -r requirements-tst.txt . && \ cd test-harness &&\ make TANGO_HOST=$(TANGO_HOST) $1 && \ tar -czvf /tmp/build.tgz build && \ diff --git a/csp-lmc-mid/requirements-tst.txt b/csp-lmc-mid/requirements-tst.txt index 67c373b..147dc97 100644 --- a/csp-lmc-mid/requirements-tst.txt +++ b/csp-lmc-mid/requirements-tst.txt @@ -3,7 +3,8 @@ pytest-bdd pytest-cov pytest-json-report pytest-mock -#pytest-xdist == 1.34.0 +pytest-forked pycodestyle coverage mock +assertpy diff --git a/csp-lmc-mid/setup.cfg b/csp-lmc-mid/setup.cfg index d7e22e1..4113b6d 100644 --- a/csp-lmc-mid/setup.cfg +++ b/csp-lmc-mid/setup.cfg @@ -14,12 +14,8 @@ source = csp-lmc-mid [tool:pytest] testpaths = tests -log_cli = True -log_cli_level = INFO -log_file = pytest-logs.txt -log_file_level = INFO addopts = --forked - --verbose + --verbose --cov=csp_lmc_mid --json-report --json-report-file=htmlcov/report.json diff --git a/csp-lmc-mid/test-harness/Makefile b/csp-lmc-mid/test-harness/Makefile index 60db74e..bb172a3 100644 --- a/csp-lmc-mid/test-harness/Makefile +++ b/csp-lmc-mid/test-harness/Makefile @@ -17,7 +17,7 @@ test: retry --max=15 -- tango_admin --ping-device mid_csp/elt/master retry --max=15 -- tango_admin --ping-device mid_csp/elt/subarray_01 retry --max=15 -- tango_admin --ping-device mid_csp/elt/subarray_02 - cd /app && python3 setup.py test| tee integration-test.stdout + cd /app && pytest tests| tee integration-test.stdout mkdir -p build/reports && \ if [ -d build ]; then \ mv /app/integration-test.stdout ./build/csp-lmc-mid-setup-test.stdout; \ -- GitLab