Skip to content
Snippets Groups Projects
Unverified Commit 327d48d2 authored by Jyotin Ranpura's avatar Jyotin Ranpura Committed by GitHub
Browse files

Merge pull request #88 from ska-telescope/story_AT1-169

CI pipeline implemented
parents a672814e 559ecb98
No related branches found
No related tags found
No related merge requests found
# 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: ska-registry.av.it.pt/ska-docker/tango-builder:latest
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
# 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
cache:
paths:
# before_script is used to define the command that should be run before all jobs, including deploy jobs, but after the restoration of artifacts.
# This can be an array or a multi-line string.
before_script:
- docker login -u $DOCKER_REGISTRY_USER_LOGIN -p $CI_REGISTRY_PASS_LOGIN $CI_REGISTRY
# 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 have to contain at least the script clause.
# In this case we have only the test job which produce an artifacts (it must be placed into a directory called "public")
# It is also specified that only the master branch will be subject of this job.
stages:
- pages
pages:
tags:
- docker-executor
stage: pages
script:
- make test
- ls -la
- mv build public
- mv public/lmcbaseclasses_htmlcov/* public
- make push
artifacts:
paths:
- public
#!/bin/bash
#
# Copyright 2015 Xebia Nederland B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function hasChanges() {
test -n "$(git status -s .)"
}
function getRelease() {
awk -F= '/^release=/{print $2}' .release
}
function getBaseTag() {
sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release
}
function getTag() {
if [ -z "$1" ] ; then
awk -F= '/^tag/{print $2}' .release
else
echo "$(getBaseTag)$1"
fi
}
function setRelease() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release
sed -i.x -e "s/^release=.*/release=$1/g" .release
rm -f .release.x
runPreTagCommand "$1"
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function runPreTagCommand() {
if [ -n "$1" ] ; then
COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release)
if [ -n "$COMMAND" ] ; then
if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi
fi
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function tagExists() {
tag=${1:-$(getTag)}
test -n "$tag" && test -n "$(git tag | grep "^$tag\$")"
}
function differsFromRelease() {
tag=$(getTag)
! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)"
}
function getVersion() {
result=$(getRelease)
if differsFromRelease; then
result="$result-$(git log -n 1 --format=%h .)"
fi
if hasChanges ; then
result="$result-dirty"
fi
echo $result
}
function nextPatchLevel() {
version=${1:-$(getRelease)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
function nextMinorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
function nextMajorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
#
# Copyright 2015 Xebia Nederland B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ifeq ($(strip $(PROJECT)),)
NAME=$(shell basename $(CURDIR))
else
NAME=$(PROJECT)
endif
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
ifeq ($(strip $(DOCKER_REGISTRY_HOST)),)
DOCKER_REGISTRY_HOST = ska-registry.av.it.pt
endif
ifeq ($(strip $(DOCKER_REGISTRY_USER)),)
DOCKER_REGISTRY_USER = tango-example
endif
IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME)
VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
TAG=$(shell . $(RELEASE_SUPPORT); getTag)
SHELL=/bin/bash
DOCKER_BUILD_CONTEXT=.
DOCKER_FILE_PATH=Dockerfile
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \
push pre-push do-push post-push
build: pre-build docker-build post-build ## build the application image
pre-build:
post-build:
pre-push:
post-push:
docker-build: .release
docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH) --build-arg DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) --build-arg DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER)
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
else \
echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \
fi
.release:
@echo "release=0.0.0" > .release
@echo "tag=$(NAME)-0.0.0" >> .release
@echo INFO: .release created
@cat .release
release: check-status check-release build push
push: pre-push do-push post-push ## push the image to the Docker registry
do-push:
# docker push $(IMAGE):$(VERSION)
docker push $(IMAGE):latest
snapshot: build push
showver: .release
@. $(RELEASE_SUPPORT); getVersion
bump-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel)
bump-patch-release: .release tag
bump-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel)
bump-minor-release: .release tag
bump-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel)
bump-major-release: .release tag
patch-release: tag-patch-release release
@echo $(VERSION)
minor-release: tag-minor-release release
@echo $(VERSION)
major-release: tag-major-release release
@echo $(VERSION)
tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION))
tag: check-status
# @. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; setRelease $(VERSION)
# git add .
# git commit -m "bumped to version $(VERSION)" ;
# git tag $(TAG) ;
# @ if [ -n "$(shell git remote -v)" ] ; then git push --tags ; else echo 'no remote to push tags to' ; fi
check-status:
@. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ;
check-release: .release
@. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1)
release=0.0.0
tag=lmcbaseclasses-0.0.0
# Use SKA python image as base image
FROM ska-registry.av.it.pt/ska-docker/ska-python-buildenv:latest AS buildenv
FROM ska-registry.av.it.pt/ska-docker/ska-python-runtime:latest AS runtime
# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create
# set working directory
#WORKDIR /app
#install lmc-base-classes
#USER root
#RUN buildDeps="ca-certificates git" \
# && DEBIAN_FRONTEND=noninteractive apt-get update \
# && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends $buildDeps \
# && su tango -c "git clone https://github.com/ska-telescope/lmc-base-classes.git" \
# && apt-get purge -y --auto-remove $buildDeps \
# && rm -rf /var/lib/apt/lists/* /home/tango/.cache
USER tango
CMD ["/venv/bin/python", "/app/skabase/SKABaseDevice/SKABaseDevice.py"]
\ No newline at end of file
node('docker') {
withDockerContainer(
image: 'tango-lmc-base-classes:latest',
args: '-u root'
) {
stage 'Cleanup workspace'
sh 'chmod 777 -R .'
sh 'rm -rf *'
stage 'Checkout SCM'
checkout([
$class: 'GitSCM',
branches: [[name: "refs/heads/${env.BRANCH_NAME}"]],
extensions: [[$class: 'LocalBranch']],
userRemoteConfigs: scm.userRemoteConfigs,
doGenerateSubmoduleConfigurations: false,
submoduleCfg: []
])
stage 'Install & Unit Tests'
timestamps {
timeout(time: 30, unit: 'MINUTES') {
ansiColor('xterm') {
try {
// Add a symbolic link to lmc-base-classes dir, as the Ansible scripts
// assume that is part of the path
sh 'ln -sv $WORKSPACE ../lmc-base-classes'
// use Ansible to do pip installs, using current WORKSPACE
// as the software_root
// install coverage manually, so it can be used after tests
sh '''
PARENT_DIR=`dirname $WORKSPACE`
cd ansible
ansible-playbook -i hosts install_sw.yml \
--limit "local" \
--tags install-sw-lmc-base-classes \
--tags install-sw-skabase \
--verbose \
--extra-vars software_root=$PARENT_DIR
pip install coverage
cd ..
'''
catchError {
// run tests
sh '''
python setup.py test \
--addopts="--junitxml results.xml --color=yes --cov=skabase --cov=refelt --cov-report=term --cov-config .coveragerc"
'''
}
// generate HTML coverage report
sh 'coverage html'
}
finally {
step([$class: 'JUnitResultArchiver', testResults: 'results.xml'])
archive 'htmlcov/*'
}
}
}
}
}
}
Makefile 0 → 100644
#
# Project makefile for a LMC Base Classes project. You should normally only need to modify
# DOCKER_REGISTRY_USER and PROJECT below.
#
#
# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define
# the Docker tag for this project. The definition below inherits the standard
# value for DOCKER_REGISTRY_HOST (=rska-registry.av.it.pt) and overwrites
# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of
# ska-registry.av.it.pt/dishmaster/dishmaster
#
DOCKER_REGISTRY_USER:=tango-example
PROJECT = lmcbaseclasses
#
# include makefile to pick up the standard Make targets, e.g., 'make build'
# build, 'make push' docker push procedure, etc. The other Make targets
# ('make interactive', 'make test', etc.) are defined in this file.
#
include .make/Makefile.mk
#
# IMAGE_TO_TEST defines the tag of the Docker image to test
#
IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest
#
# CACHE_VOLUME is the name of the Docker volume used to cache eggs and wheels
# used during the test procedure. The volume is not used during the build
# procedure
#
CACHE_VOLUME = $(PROJECT)-test-cache
# optional docker run-time arguments
DOCKER_RUN_ARGS =
#
# Defines a default make target so that help is printed if make is called
# without a target
#
.DEFAULT_GOAL := help
DOCKER_NETWORK := $(shell echo "$(notdir $(CURDIR))"_default | tr A-Z a-z)
#
# defines a function to copy the ./test-harness directory into the container
# and then runs the requested make target in the container. The container is:
#
# 1. attached to the network of the docker-compose test system
# 2. uses a persistent volume to cache Python eggs and wheels so that fewer
# downloads are required
# 3. uses a transient volume as a working directory, in which untarred files
# and test output can be written in the container and subsequently copied
# to the host
#
make = tar -c test-harness/ | \
docker run -i --rm --network=$(DOCKER_NETWORK) \
-e TANGO_HOST=databaseds:10000 \
-v $(CACHE_VOLUME):/home/tango/.cache \
--volumes-from=rsyslog-lmcbaseclasses:rw \
-v /build -w /build -u tango $(DOCKER_RUN_ARGS) $(IMAGE_TO_TEST) \
bash -c "sudo chown -R tango:tango /build && \
tar x --strip-components 1 --warning=all && \
sudo ln -sf /var/run/rsyslog/dev/log /dev/log && \
make TANGO_HOST=databaseds:10000 $1"
test: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
test: build ## test the application
$(INIT_CACHE)
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) docker-compose up -d
$(call make,test); \
status=$$?; \
rm -fr build; \
docker cp $(BUILD):/build .; \
docker rm -f -v $(BUILD); \
docker logs $(CACHE_VOLUME); \
docker logs $(CACHE_VOLUME) > build/container.log 2>&1; \
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) docker-compose down; \
exit $$status
pull: ## download the application image
docker pull $(IMAGE_TO_TEST)
up: build ## start develop/test environment
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) docker-compose up -d
piplock: build ## overwrite Pipfile.lock with the image version
docker run $(IMAGE_TO_TEST) cat /app/Pipfile.lock > $(CURDIR)/Pipfile.lock
interactive: up
interactive: ## start an interactive session using the project image (caution: R/W mounts source directory to /app)
docker run --rm -it --name=$(PROJECT)-dev -e TANGO_HOST=databaseds:10000 --network=$(DOCKER_NETWORK) \
-v $(CURDIR):/app --volumes-from=rsyslog-lmcbaseclasses:rw $(IMAGE_TO_TEST) /bin/bash
down: ## stop develop/test environment and any interactive session
docker ps | grep $(PROJECT)-dev && docker stop $(PROJECT)-dev || true
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) docker-compose down
help: ## show this help.
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all test up down help
# Creates Docker volume for use as a cache, if it doesn't exist already
INIT_CACHE = \
docker volume ls | grep $(CACHE_VOLUME) || \
docker create --name $(CACHE_VOLUME) -v $(CACHE_VOLUME):/cache $(IMAGE_TO_TEST)
# http://cakoose.com/wiki/gnu_make_thunks
BUILD_GEN = $(shell docker create -v /build $(IMAGE_TO_TEST))
BUILD = $(eval BUILD := $(BUILD_GEN))$(BUILD)
\ No newline at end of file
Pipfile 0 → 100644
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
# numpy and pytango versions must match those in the ska-python-builder image,
# otherwise pytango will be recompiled.
numpy = "==1.15.4"
pytango = "==9.2.5"
# itango is added to make it easier to exercise the device in a CLI session,
# but it's not mandatory. If you remove itango, you should also remove the
# 'RUN ipython profile create' line from Dockerfile.
itango = "*"
[dev-packages]
docutils = "*"
MarkupSafe = "*"
Pygments = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
pytest-pylint = "*"
pytest-json-report = "*"
python-dotenv = ">=0.5.1"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-autobuild = "*"
sphinxcontrib-websupport = "*"
[requires]
python_version = "3"
This diff is collapsed.
#!/usr/bin/env bash
echo "STATIC CODE ANALYSIS"
echo "===================="
echo
echo "MODULE ANALYSIS"
echo "---------------"
pylint --rcfile=rcfile skabase
echo "TESTS ANALYSIS"
echo "--------------"
pylint --rcfile=rcfile skabase/SKAAlarmHandler/test
pylint --rcfile=rcfile skabase/SKABaseDevice/test
pylint --rcfile=rcfile skabase/SKACapability/test
pylint --rcfile=rcfile skabase/SKALogger/test
pylint --rcfile=rcfile skabase/SKAMaster/test
pylint --rcfile=rcfile skabase/SKAObsDevice/test
pylint --rcfile=rcfile skabase/SKASubarray/test
pylint --rcfile=rcfile skabase/SKATelState/test
#
# Docker compose file for LMC Base classes.
# Contains services for TANGO database, database device server.
# Also uses rsyslog service
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-lmcbaseclasses:Container which provice rsyslog service for local logging
# - lmcbaseclasses: Container having lmc base classes
#
# Requires:
# - None
#
version: '2'
volumes:
tangodb: {}
services:
tangodb:
image: ska-registry.av.it.pt/ska-docker/tango-db:latest
depends_on:
- rsyslog-lmcbaseclasses
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
volumes:
- tangodb:/var/lib/mysql
databaseds:
image: ska-registry.av.it.pt/ska-docker/tango-cpp:latest
depends_on:
- tangodb
environment:
- MYSQL_HOST=tangodb:3306
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
- TANGO_HOST=databaseds:10000
entrypoint:
- /usr/local/bin/wait-for-it.sh
- tangodb:3306
- --timeout=30
- --strict
- --
- /usr/local/bin/DataBaseds
- "2"
- -ORBendPoint
- giop:tcp::10000
rsyslog-lmcbaseclasses:
container_name: rsyslog-lmcbaseclasses
image: jumanjiman/rsyslog
lmcbaseclasses:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/lmcbaseclasses:latest
depends_on:
- databaseds
- rsyslog-lmcbaseclasses
environment:
- TANGO_HOST=databaseds:10000
command: >
sh -c "wait-for-it.sh databaseds:10000 --timeout=30 --strict --
tango_admin --add-server SKABaseDevice/01 SKABaseDevice ska/basedevice/01 &&\
tango_admin --add-server SKAAlarmHandler/01 SKAAlarmhandler ska/alarmhandler/01 &&\
tango_admin --add-server SKACapability/01 SKACapability ska/capability/01 &&\
tango_admin --add-server SKALogger/01 SKALogger ska/logger/01 &&\
tango_admin --add-server SKAMaster/01 SKAMaster ska/master/01 &&\
tango_admin --add-server SKAObsDevice/01 SKAObsDevice ska/obsdevice/01 &&\
tango_admin --add-server SKASubarray/01 SKASubarray ska/subarray/01 &&\
tango_admin --add-server SKATelState/01 SKATelState ska/telstate/01 &&\
sudo ln -sf /var/run/rsyslog/dev/log /dev/log &&\
/venv/bin/python /app/skabase/SKABaseDevice/SKABaseDevice.py 01 &&\
/venv/bin/python /app/skabase/SKAAlarmHandler/SKAAlarmHandler.py 01 &&\
/venv/bin/python /app/skabase/SKACapablity/SKACapablity.py 01 &&\
/venv/bin/python /app/skabase/SKALogger/SKALogger.py 01 &&\
/venv/bin/python /app/skabase/SKAMaster/SKAMaster.py 01 &&\
/venv/bin/python /app/skabase/SKAObsDevice/SKAObsDevice.py 01 &&\
/venv/bin/python /app/skabase/SKASubarray/SKASubarray.py 01 &&\
/venv/bin/python /app/skabase/SKATelState/SKATelState.py 01"
volumes_from:
- rsyslog-lmcbaseclasses:rw
\ No newline at end of file
[aliases] [aliases]
test=pytest test=pytest
[coverage:run]
branch = True
source = skabase
[tool:pytest] [tool:pytest]
addopts = -v --boxed testpaths = skabase
addopts = --forked --verbose --json-report --json-report-file=htmlcov/report.json --cov-report term --cov-report html --cov-report xml --cov=skabase
console_output_style = progress
\ No newline at end of file
...@@ -45,7 +45,8 @@ setup(name=name, ...@@ -45,7 +45,8 @@ setup(name=name,
"coverage", "coverage",
"pytest", "pytest",
"pytest-cov", "pytest-cov",
"pytest-xdist" "pytest-xdist",
"mock"
], ],
keywords="lmc base classes ska", keywords="lmc base classes ska",
zip_safe=False) zip_safe=False)
...@@ -190,5 +190,3 @@ class TestSKABaseDevice(object): ...@@ -190,5 +190,3 @@ class TestSKABaseDevice(object):
# PROTECTED REGION ID(SKABaseDevice.test_testMode) ENABLED START # # PROTECTED REGION ID(SKABaseDevice.test_testMode) ENABLED START #
assert tango_context.device.testMode == '' assert tango_context.device.testMode == ''
# PROTECTED REGION END # // SKABaseDevice.test_testMode # PROTECTED REGION END # // SKABaseDevice.test_testMode
...@@ -4,8 +4,8 @@ from __future__ import print_function ...@@ -4,8 +4,8 @@ from __future__ import print_function
import json import json
import pytest import pytest
from skabase.utils import get_groups_from_json from skabase.auxiliary.utils import get_groups_from_json
from skabase.utils import GroupDefinitionsError from skabase.auxiliary.faults import GroupDefinitionsError
TEST_GROUPS = { TEST_GROUPS = {
......
all: test
# wait for the device to be available before beginning the test
# A temporary volume is mounted at /build when 'make test' is executing.
# The following steps copy across useful output to this volume which can
# then be extracted to form the CI summary for the test procedure.
test:
retry -- tango_admin --check-device ska/basedevice/01
retry -- tango_admin --check-device ska/alarmhandler/01
retry -- tango_admin --check-device ska/capability/01
retry -- tango_admin --check-device ska/logger/01
retry -- tango_admin --check-device ska/master/01
retry -- tango_admin --check-device ska/obsdevice/01
retry -- tango_admin --check-device ska/subarray/01
retry -- tango_admin --check-device ska/telstate/01
cd /app && python setup.py test | tee setup_py_test.stdout
cd /app && ./code-analysis.sh | tee code_analysis.stdout
if [ -d /build ]; then \
mv /app/setup_py_test.stdout /build/lmcbaseclasses_setup_py_test.stdout; \
mv /app/code_analysis.stdout /build/lmcbaseclasses_code_analysis.stdout; \
mv /app/htmlcov /build/lmcbaseclasses_htmlcov; \
mv /app/coverage.xml /build/lmcbaseclasses_coverage.xml; \
fi;
.PHONY: all test
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment