diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bbc1e0d0ccd6916c4175d0d9404b9779b80eff3..0f780839b4ec0d01e541ef4555c6008c45bfa321 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ # GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application. # Docker, when used with GitLab CI, runs each job in a separate and isolated container using the predefined image that is set up in .gitlab-ci.yml. # In this case we use the latest python docker image to build and test this project. -image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest +image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 # cache is used to specify a list of files and directories which should be cached between jobs. You can only use paths that are within the project workspace. # If cache is defined outside the scope of jobs, it means it is set globally and all jobs will use that definition @@ -16,7 +16,9 @@ before_script: stages: - test - linting - - deploy + - build + - publish + - pages # The YAML file defines a set of jobs with constraints stating when they should be run. # You can specify an unlimited number of jobs which are defined as top-level elements with an arbitrary name and always @@ -26,8 +28,8 @@ stages: # job. TODO: possibly a candidate for refactor / renaming later on. test: stage: test -# tags: -# - docker-executor + tags: + - docker-executor script: # - pipenv run python setup.py test - python3 setup.py test @@ -39,6 +41,8 @@ test: list_dependencies: stage: test + tags: + - docker-executor script: # - pipenv graph >> pipenv_deps.txt - pipdeptree --json >> pip_deps.json @@ -66,8 +70,40 @@ linting: paths: - ./build +build_dev_package: + stage: build + tags: + - docker-executor + script: + - python3 setup.py egg_info -b+dev.$CI_COMMIT_SHORT_SHA sdist bdist_wheel + artifacts: + paths: + - ./dist + +build_package: + stage: build + tags: + - docker-executor + script: + - python setup.py egg_info -b.$CI_COMMIT_SHORT_SHA sdist bdist_wheel + only: [master] + artifacts: + paths: + - ./dist + +publish_package: + stage: publish + tags: + - docker-executor + variables: + TWINE_USERNAME: $TWINE_USERNAME + TWINE_PASSWORD: $TWINE_PASSWORD + script: + - pip3 install twine + - twine upload --repository-url $PYPI_REPOSITORY_URL dist/* + pages: - stage: deploy + stage: pages tags: - docker-executor dependencies: diff --git a/docker-requirements.txt b/docker-requirements.txt index 92273eca33dc10bc011bc079abbf7191fa200da5..6379878b9eb7a2fa7f9ffee51078be5a2106e24f 100644 --- a/docker-requirements.txt +++ b/docker-requirements.txt @@ -15,4 +15,4 @@ sphinx-rtd-theme sphinxcontrib-websupport pipdeptree pylint_junit -csp-lmc-common >= 0.5.3 +csp-lmc-common < 0.6.0 diff --git a/setup.py b/setup.py index ffdd470d1a35b78401d4658fc643a7f548e8dd73..985e83824abdbe4b3c55bccf89ca2e2b918a4d90 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( install_requires=[ 'pytango >=9.3.1', 'future', - 'csp-lmc-common', + 'csp-lmc-common < 0.6.0', ], setup_requires=[ # dependency for `python setup.py test` diff --git a/tests/test_se_master.py b/tests/test_se_master.py index f24cffd019832615a8d1de33967bd4ed4094f988..e18d5d2c4e53229d3f8234eafba35874a85d3186 100644 --- a/tests/test_se_master.py +++ b/tests/test_se_master.py @@ -155,7 +155,6 @@ class TestCspSubElementMaster(object): # reinitialize the device to return to # adminMode =ONLINE and State=INIT tango_context.device.Init() - time.sleep(2) assert tango_context.device.adminMode == AdminMode.ONLINE assert tango_context.device.State() == DevState.INIT with pytest.raises(DevFailed) as df: @@ -257,8 +256,6 @@ class TestCspSubElementMaster(object): tango_context.device.onCmdDurationExpected = 20 tango_context.device.offCmdDurationExpected = 20 tango_context.device.standbyCmdDurationExpected = 20 - # wait to let the polling thread update the attrs value - time.sleep(3) assert tango_context.device.onCmdDurationExpected == 20 assert tango_context.device.offCmdDurationExpected == 20 assert tango_context.device.standbyCmdDurationExpected == 20 diff --git a/tests/test_se_subarray.py b/tests/test_se_subarray.py index 786d2d7f5b3dc00d32a163ca35845a5072653b71..985b2b6bf15fd89b1a4c6e6702db2eec82c45fff 100644 --- a/tests/test_se_subarray.py +++ b/tests/test_se_subarray.py @@ -190,8 +190,6 @@ class TestCspSubElementSubarray(object): def test_set_command_duration_expected(self, tango_context): """Test xxxCmdDurationExpected attributes""" tango_context.device.goToIdleDurationExpected = 20 - # wait to let the polling thread update the attrs value - time.sleep(3) assert tango_context.device.goToIdleDurationExpected == 20