From 00d57ae09201dd59af3aa62177dafef1bb01ce6c Mon Sep 17 00:00:00 2001 From: toor Date: Tue, 22 Dec 2020 19:01:42 +0100 Subject: [PATCH 1/5] fix-setup-bug: removed ska-skuid package installation. It is installed as dependency of ska-log-transactions --- csp-lmc-common/requirements.txt | 1 - csp-lmc-common/setup.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/csp-lmc-common/requirements.txt b/csp-lmc-common/requirements.txt index a0e04f8..e302923 100644 --- a/csp-lmc-common/requirements.txt +++ b/csp-lmc-common/requirements.txt @@ -2,5 +2,4 @@ numpy == 1.17.2 pytango >= 9.3.2 jsonschema >= 3.2.0 lmcbaseclasses >= 0.7.2 -ska-skuid ska-log-transactions diff --git a/csp-lmc-common/setup.py b/csp-lmc-common/setup.py index d2ac7bf..aa15c8f 100644 --- a/csp-lmc-common/setup.py +++ b/csp-lmc-common/setup.py @@ -40,8 +40,7 @@ setup( 'pytango >9.3.1', 'future', 'lmcbaseclasses', - 'ska-log-transactions', - 'ska-skuid>=1.2.0' + 'ska-log-transactions' ], dependency_links=[ 'https://nexus.engageska-portugal.pt/repository/pypi/simple' -- GitLab From cd48b8e19993e9580b685bb0b6cc54e634b3f884 Mon Sep 17 00:00:00 2001 From: toor Date: Tue, 22 Dec 2020 19:07:10 +0100 Subject: [PATCH 2/5] fix-setup-bug: use pytest to run csp-lmc-common tests --- csp-lmc-common/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index c979fe1..07f5092 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -78,7 +78,7 @@ test:csp-lmc-common: - pwd - python3 -m pip install -r requirements-tst.txt - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt - - python3 setup.py test |tee setup_py_test.stdout + - pytest tests |tee setup_py_test.stdout - pwd - mkdir -p build/reports - ls -alR -- GitLab From 461d2f2954b7d0329eccf84eb266b8142f9a147a Mon Sep 17 00:00:00 2001 From: toor Date: Tue, 22 Dec 2020 19:15:39 +0100 Subject: [PATCH 3/5] fix-setup-bug: fix test pipeline requirements. --- csp-lmc-common/.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index 07f5092..ed04811 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -77,7 +77,7 @@ test:csp-lmc-common: - cd $COMMON_BUILD_PATH - pwd - python3 -m pip install -r requirements-tst.txt - - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt + - python3 -m pip install --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple -r requirements.txt . - pytest tests |tee setup_py_test.stdout - pwd - mkdir -p build/reports -- GitLab From 3e4f33ab5e445168d88dc1ef248b70bbb46451c7 Mon Sep 17 00:00:00 2001 From: toor Date: Tue, 22 Dec 2020 19:31:32 +0100 Subject: [PATCH 4/5] fix-setup-bug: push csp-lmc-common dev package on nexus repo. --- csp-lmc-common/.gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/csp-lmc-common/.gitlab-ci.yml b/csp-lmc-common/.gitlab-ci.yml index ed04811..3535b76 100644 --- a/csp-lmc-common/.gitlab-ci.yml +++ b/csp-lmc-common/.gitlab-ci.yml @@ -131,9 +131,6 @@ linting:csp-lmc-common: script: - cd $BUILD_PATH - twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true - only: # publish development package only when source code changes - changes: - - "**/*.py" .publish_python_release_common: extends: .publish_python_common -- GitLab From f333e39cd54c15a0247b2bd89c47e6dd8de5f676 Mon Sep 17 00:00:00 2001 From: toor Date: Tue, 22 Dec 2020 20:45:28 +0100 Subject: [PATCH 5/5] 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