mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-07-10 10:41:53 +02:00
ci: cleanup; added static device test job
This commit is contained in:
@ -23,7 +23,9 @@ include:
|
|||||||
#commands to run in the Docker container before starting each job.
|
#commands to run in the Docker container before starting each job.
|
||||||
before_script:
|
before_script:
|
||||||
- pip install -e .[dev]
|
- pip install -e .[dev]
|
||||||
- pip install bec-server
|
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
||||||
|
- pip install -e ./bec/bec_lib[dev]
|
||||||
|
- pip install -e ./bec/bec_server[dev]
|
||||||
|
|
||||||
# different stages in the pipeline
|
# different stages in the pipeline
|
||||||
stages:
|
stages:
|
||||||
@ -34,8 +36,11 @@ stages:
|
|||||||
|
|
||||||
formatter:
|
formatter:
|
||||||
stage: Formatter
|
stage: Formatter
|
||||||
|
before_script:
|
||||||
|
- ''
|
||||||
script:
|
script:
|
||||||
- pip install black isort
|
- pip install black isort
|
||||||
|
- pip install -e .[dev]
|
||||||
- isort --check --diff ./
|
- isort --check --diff ./
|
||||||
- black --check --diff --color ./
|
- black --check --diff --color ./
|
||||||
|
|
||||||
@ -43,7 +48,6 @@ pylint:
|
|||||||
stage: Formatter
|
stage: Formatter
|
||||||
script:
|
script:
|
||||||
- pip install pylint pylint-exit anybadge
|
- pip install pylint pylint-exit anybadge
|
||||||
- pip install -e .[dev]
|
|
||||||
- mkdir ./pylint
|
- mkdir ./pylint
|
||||||
- pylint ./ophyd_devices --output-format=text --output=./pylint/pylint.log | tee ./pylint/pylint.log || pylint-exit $?
|
- pylint ./ophyd_devices --output-format=text --output=./pylint/pylint.log | tee ./pylint/pylint.log || pylint-exit $?
|
||||||
- PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
|
- PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
|
||||||
@ -92,8 +96,6 @@ secret_detection:
|
|||||||
pytest:
|
pytest:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
|
||||||
- pip install -e ./bec/bec_lib[dev]
|
|
||||||
- pip install coverage
|
- pip install coverage
|
||||||
- coverage run --source=./ophyd_devices -m pytest -v --junitxml=report.xml --random-order --full-trace ./tests
|
- coverage run --source=./ophyd_devices -m pytest -v --junitxml=report.xml --random-order --full-trace ./tests
|
||||||
- coverage report
|
- coverage report
|
||||||
@ -106,6 +108,17 @@ pytest:
|
|||||||
coverage_format: cobertura
|
coverage_format: cobertura
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
|
|
||||||
|
config_test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ophyd_test --config ./ophyd_devices/epics/db/ --output ./config_tests
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- ./config_tests
|
||||||
|
when: on_failure
|
||||||
|
expire_in: "30 days"
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
tests-3.11:
|
tests-3.11:
|
||||||
stage: AdditionalTests
|
stage: AdditionalTests
|
||||||
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
|
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
|
||||||
|
@ -10,11 +10,6 @@ from bec_lib.scibec_validator import SciBecValidator
|
|||||||
|
|
||||||
from ophyd_devices.utils.bec_device_base import BECDevice
|
from ophyd_devices.utils.bec_device_base import BECDevice
|
||||||
|
|
||||||
try:
|
|
||||||
from bec_plugins import devices as plugin_devices
|
|
||||||
except ImportError:
|
|
||||||
plugin_devices = None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from bec_server.device_server.devices.devicemanager import DeviceManagerDS as device_manager
|
from bec_server.device_server.devices.devicemanager import DeviceManagerDS as device_manager
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
Reference in New Issue
Block a user