Skip to content
Snippets Groups Projects
Commit 09dff5e8 authored by Piers Harding's avatar Piers Harding
Browse files

Merge branch 'st-908-use-k8s-make' into 'master'

ST-908: refactor tests to use .make/k8s.mk

See merge request ska-telescope/ska-tango-images!122
parents ac1f48d2 16c53f18
No related branches found
No related tags found
No related merge requests found
Showing
with 110 additions and 215 deletions
......@@ -27,7 +27,7 @@ before_script:
- k8srunner
before_script:
- '[ -f .make/oci.mk ] || exit 1'
- 'make help | grep oci.mk:oci-build'
- 'make help | grep oci-build'
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo $CAR_OCI_REGISTRY_PASSWORD | docker login -u $CAR_OCI_REGISTRY_USERNAME --password-stdin $CAR_OCI_REGISTRY_HOST
script:
......@@ -555,39 +555,6 @@ test-chart-templates:
reports:
junit: build/reports/chart_template_tests.xml
test-chart:
stage: test
variables:
MINIKUBE: "false"
tags:
- k8srunner
image: $SKA_K8S_TOOLS_DEPLOY_IMAGE
script:
- kubectl version
- helm version
- make install-chart CAR_OCI_REGISTRY_HOST=${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
- make wait
- make test
- mkdir -p ./build/reports ./build/htmlcov
- mv build/report.xml ./build/reports/unit-tests.xml
after_script:
- make uninstall-chart
- make delete_namespace
environment:
name: test
kubernetes:
namespace: ci-$CI_PROJECT_NAME-$CI_COMMIT_SHORT_SHA
artifacts:
name: "$CI_PROJECT_NAME-$CI_JOB_ID"
paths:
- "build/"
reports:
junit: build/reports/unit-tests.xml
rules:
- if: '$CI_COMMIT_TAG'
# don't run on master as the new images are not available yet (on Merge)
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
# Custom OCI Image publish stage
oci-image-publish: #Executed on a tag for CAR
stage: publish
......@@ -596,7 +563,7 @@ oci-image-publish: #Executed on a tag for CAR
- k8srunner
before_script:
- '[ -f .make/oci.mk ] || (echo "File oci.mk not included in Makefile; exit 1")'
- 'make help | grep oci.mk:oci-publish'
- 'make help | grep oci-publish'
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo $CAR_OCI_REGISTRY_PASSWORD | docker login -u $CAR_OCI_REGISTRY_USERNAME --password-stdin $CAR_OCI_REGISTRY_HOST
script:
......@@ -618,13 +585,15 @@ include:
# Raw
- project: 'ska-telescope/templates-repository'
file: 'gitlab-ci/includes/raw.gitlab-ci.yml'
ref: master
# Docs pages
- project: 'ska-telescope/templates-repository'
file: 'gitlab-ci/includes/docs-pages.gitlab-ci.yml'
# ref: master
# .post step finalisers eg: badges
- project: 'ska-telescope/templates-repository'
file: 'gitlab-ci/includes/finaliser.gitlab-ci.yml'
# k8s steps
- project: 'ska-telescope/templates-repository'
file: 'gitlab-ci/includes/k8s.gitlab-ci.yml'
.make @ b54b8f3d
Subproject commit 3147e518066888b16adebc8126f20ccabdf3b42c
Subproject commit b54b8f3d97d4cb9abc8c4441acf3749dcad74bc7
Copyright 2018 SKA Organisation
BSD 3-Clause License
Copyright 2021 SKA Observatory
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
......
......@@ -6,42 +6,41 @@ OCI_IMAGES_TO_PUBLISH ?= $(OCI_IMAGES)
KUBE_NAMESPACE ?= ska-tango-images#namespace to be used
RELEASE_NAME ?= test## release name of the chart
UMBRELLA_CHART_PATH ?= ska-tango-umbrella/## Path of the umbrella chart to work with
# HELM_HOST ?= https://artefact.skatelescope.org # helm host url https
K8S_CHART = ska-tango-umbrella
MINIKUBE ?= true ## Minikube or not
MARK ?= all
IMAGE_TO_TEST ?= artefact.skao.int/ska-tango-images-tango-itango:9.3.4 ## TODO: UGUR docker image that will be run for testing purpose
K8S_TEST_IMAGE_TO_TEST ?= artefact.skao.int/ska-tango-images-tango-itango:9.3.7 ## TODO: UGUR docker image that will be run for testing purpose
CI_JOB_ID ?= local##pipeline job id
TEST_RUNNER ?= test-mk-runner-$(CI_JOB_ID)##name of the pod running the k8s_tests
TANGO_HOST ?= tango-host-databaseds-from-makefile-$(RELEASE_NAME):10000## TANGO_HOST is an input!
CHARTS ?= ska-tango-util ska-tango-base ska-tango-umbrella## list of charts to be published on gitlab -- umbrella charts for testing purpose
# LINTING_OUTPUT=$(shell helm lint --with-subcharts $(UMBRELLA_CHART_PATH) | grep ERROR -c | tail -1)
TANGO_HOST ?= my-personal-databaseds-also-node-port:10000## TANGO_HOST connection to the Tango DS
TANGO_SERVER_PORT ?= 45450## TANGO_SERVER_PORT - fixed listening port for local server
K8S_CHARTS ?= ska-tango-util ska-tango-base ska-tango-umbrella## list of charts to be published on gitlab -- umbrella charts for testing purpose
CI_PROJECT_PATH_SLUG ?= ska-tango-images
CI_ENVIRONMENT_SLUG ?= ska-tango-images
# K8S_TEST_MAKE_PARAMS = KUBE_NAMESPACE=$(KUBE_NAMESPACE) HELM_RELEASE=$(RELEASE_NAME) TANGO_HOST=$(TANGO_HOST) MARK=$(MARK)
# K8S_CHART_PARAMS = --set global.minikube=$(MINIKUBE) --set global.tango_host=$(TANGO_HOST) --values $(BASE)/charts/values.yaml
PYTHON_VARS_BEFORE_PYTEST = PYTHONPATH=/app:/app/tests KUBE_NAMESPACE=$(KUBE_NAMESPACE) HELM_RELEASE=$(RELEASE_NAME) TANGO_HOST=$(TANGO_HOST)
PYTHON_VARS_AFTER_PYTEST = --disable-pytest-warnings --timeout=300
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
# include OCI Images support
include .make/oci.mk
# include k8s support
include .make/k8s.mk
# include Helm Chart support
include .make/helm.mk
# include make support
include .make/make.mk
# include help support
include .make/help.mk
# include core release support
include .make/release.mk
# include raw support
include .make/raw.mk
# include docs support
include .make/docs.mk
# include core make support
include .make/base.mk
# include your own private variables for custom deployment configuration
-include PrivateRules.mak
......@@ -91,13 +90,17 @@ make-a-release: ## Step through the process of bumping .release and creating a t
@printf "\nStep 2: Select and bump OCI Image .release's \n Tell me which of the following OCI_IMAGES_TO_PUBLISH list to bump patch release for: $(OCI_IMAGES_TO_PUBLISH)\n"; \
read -p "$(POWDER_BLUE)Enter list here$(NORMAL): " OCI_IMAGES_TO_RELEASE; \
printf "\n You provided: $${OCI_IMAGES_TO_RELEASE}\n"; \
read -p "$(POWDER_BLUE)Do you wish to continue (you will be prompted at each step)$(NORMAL) $(YELLOW)[N/y]$(NORMAL): " SHALL_WE; \
read -p "$(POWDER_BLUE)Do you wish to continue (you will be prompted at each step)$(NORMAL) $(YELLOW)[N=No/s=skip/y=yes]$(NORMAL): " SHALL_WE; \
if [[ "y" == "$${SHALL_WE}" ]] || [[ "Y" == "$${SHALL_WE}" ]]; then \
echo "$(GREEN) OK - ✨ bumping patch .release files ...$(NORMAL)"; \
echo "$(GREEN) OK - ✨ bumping patch for .release files ...$(NORMAL)"; \
make oci-bump-patch-release OCI_IMAGES_TO_PUBLISH="$${OCI_IMAGES_TO_RELEASE}"; \
else \
if [[ "s" == "$${SHALL_WE}" ]] || [[ "S" == "$${SHALL_WE}" ]]; then \
echo "$(YELLOW) OK - 👍 Skipping bumping patch for .release files ...$(NORMAL)"; \
else \
printf "$(RED) 😱 OK - aborting$(NORMAL).\n 💀"; \
exit 1; \
fi; \
fi;
@printf "\nStep 3: Bump project .release AND update Helm Chart release\n"; \
......@@ -149,22 +152,6 @@ k8s: ## Which kubernetes are we connected to
@echo "Helm version:"
@helm version --client
namespace: ## create the kubernetes namespace
@kubectl describe namespace $(KUBE_NAMESPACE) > /dev/null 2>&1 ; \
K_DESC=$$? ; \
if [ $$K_DESC -eq 0 ] ; \
then kubectl describe namespace $(KUBE_NAMESPACE); \
else kubectl create namespace $(KUBE_NAMESPACE); \
fi
delete_namespace: ## delete the kubernetes namespace
@if [ "default" = "$(KUBE_NAMESPACE)" ] || [ "kube-system" = "$(KUBE_NAMESPACE)" ]; then \
echo "You cannot delete Namespace: $(KUBE_NAMESPACE)"; \
exit 1; \
else \
kubectl describe namespace $(KUBE_NAMESPACE) && kubectl delete namespace $(KUBE_NAMESPACE); \
fi
package: helm-pre-publish ## package charts
@echo "Packaging helm charts. Any existing file won't be overwritten."; \
mkdir -p ./tmp
......@@ -181,128 +168,21 @@ helm-pre-publish: ## hook before helm chart publish
helm-pre-lint: helm-pre-publish ## make sure auto-generate values.yaml happens
dep-up: helm-pre-publish ## update dependencies for every charts in the env var CHARTS
@cd charts; \
for i in $(CHARTS); do \
helm dependency update $${i}; \
done;
install-chart: clean dep-up namespace## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@cd charts; \
sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ci-values.yaml > generated_values.yaml; \
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml; \
helm install $(RELEASE_NAME) \
--set global.minikube=$(MINIKUBE) \
--set global.tango_host=$(TANGO_HOST) \
--values values.yaml \
$(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE); \
rm generated_values.yaml; \
rm values.yaml
template-chart: clean dep-up## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@cd charts; \
sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ci-values.yaml > generated_values.yaml; \
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml; \
helm template $(RELEASE_NAME) \
--set global.minikube=$(MINIKUBE) \
--set global.tango_host=$(TANGO_HOST) \
--values values.yaml \
--debug \
$(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE); \
rm generated_values.yaml; \
rm values.yaml
uninstall-chart: ## uninstall the ska-tango-images helm chart on the namespace ska-tango-images
# use pre update hook to update chart values
k8s-pre-install-chart:
make helm-pre-publish
@echo "k8s-pre-install-chart: setting up charts/values.yaml"
@cd charts; \
sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ci-values.yaml > generated_values.yaml; \
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml; \
helm template $(RELEASE_NAME) \
--set global.minikube=$(MINIKUBE) \
--set global.tango_host=$(TANGO_HOST) \
--values values.yaml \
$(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE) | kubectl delete -f - ; \
rm generated_values.yaml; \
rm values.yaml; \
helm uninstall $(RELEASE_NAME) --namespace $(KUBE_NAMESPACE)
reinstall-chart: uninstall-chart install-chart ## reinstall the ska-tango-images helm chart on the namespace ska-tango-images
# chart_lint: clean dep-up## lint check the helm chart
# mkdir -p build; helm lint $(UMBRELLA_CHART_PATH) --with-subcharts --namespace $(KUBE_NAMESPACE); \
# echo "<testsuites><testsuite errors=\"$(LINTING_OUTPUT)\" failures=\"0\" name=\"helm-lint\" skipped=\"0\" tests=\"0\" time=\"0.000\" timestamp=\"$(shell date)\"> </testsuite> </testsuites>" > build/linting.xml
# exit $(LINTING_OUTPUT)
wait: ## wait for pods to be ready
@echo "Waiting for pods to be ready"
@date
@kubectl -n $(KUBE_NAMESPACE) get pods
#jobs=$$(kubectl get job --output=jsonpath={.items..metadata.name} -n $(KUBE_NAMESPACE)); kubectl wait job --for=condition=complete --timeout=900s $$jobs -n $(KUBE_NAMESPACE)
@kubectl -n $(KUBE_NAMESPACE) wait --for=condition=ready -l app=ska-tango-images --timeout=900s pods || exit 1
@date
#
# defines a function to copy the ./test-harness directory into the K8s TEST_RUNNER
# and then runs the requested make target in the container.
# capture the output of the test in a tar file
# stream the tar file base64 encoded to the Pod logs
#
k8s_test = tar -c tests/post-deployment/ | \
kubectl run $(TEST_RUNNER) \
--namespace $(KUBE_NAMESPACE) -i --wait --restart=Never \
--image-pull-policy=IfNotPresent \
--image=$(IMAGE_TO_TEST) \
--limits='cpu=1000m,memory=500Mi' \
--requests='cpu=900m,memory=400Mi' -- \
/bin/bash -c "mkdir testing && tar xv --directory testing --strip-components 2 --warning=all && cd testing && \
make KUBE_NAMESPACE=$(KUBE_NAMESPACE) HELM_RELEASE=$(RELEASE_NAME) TANGO_HOST=$(TANGO_HOST) MARK=$(MARK) $1 && \
tar -czvf /tmp/build.tgz build && \
echo '~~~~BOUNDARY~~~~' && \
cat /tmp/build.tgz | base64 && \
echo '~~~~BOUNDARY~~~~'" \
2>&1
# call 'k8s_test' and pass it arg 'test' - look for $1
# run the test function
# save the status
# clean out build dir
# print the logs minus the base64 encoded payload
# pull out the base64 payload and unpack build/ dir
# base64 payload is given a boundary "~~~~BOUNDARY~~~~" and extracted using perl
# clean up the run to completion container
# exit the saved status
test: helm-pre-publish ## test the application on K8s
cp charts/ska-tango-base/values.yaml tests/post-deployment/tango_values.yaml; \
$(call k8s_test,test); \
status=$$?; \
rm -fr build; \
kubectl --namespace $(KUBE_NAMESPACE) logs $(TEST_RUNNER) | \
perl -ne 'BEGIN {$$on=0;}; if (index($$_, "~~~~BOUNDARY~~~~")!=-1){$$on+=1;next;}; print if $$on % 2;' | \
base64 -d | tar -xzf -; \
kubectl --namespace $(KUBE_NAMESPACE) delete pod $(TEST_RUNNER); \
rm tests/post-deployment/tango_values.yaml; \
echo "Status set at \"$$status\" in ./Makefile test target"; \
exit $$status
chart_test: helm-pre-publish #clean dep-up
helm package charts/ska-tango-util/ -d charts/ska-tango-base/charts/; \
mkdir -p charts/build; helm unittest charts/ska-tango-base/ --helm3 --with-subchart --output-type JUnit --output-file charts/build/chart_template_tests.xml; \
show:
echo $$TANGO_HOST
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml
k8s-pre-template-chart:
make helm-pre-publish
# OCI_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make/.make-oci-support
k8s-pre-test:
@echo "k8s-pre-test: setting up tests/values.yaml"
cp charts/ska-tango-base/values.yaml tests/tango_values.yaml
# xoci-publish:
# @. $(OCI_SUPPORT) ; \
# OCI_NEXUS_REPO=$(OCI_NEXUS_REPO) \
# ociImageExists "$(OCI_IMAGE)" "$(VERSION)" && (echo "oci-publish:WARNING: $(CAR_OCI_REGISTRY_HOST)/$(OCI_IMAGE):$(VERSION) already exists, skipping " >&2; exit 0) ;
# # pull GitLab registry version and then push to CAR
# @echo "oci-do-publish: Pulling $${CI_REGISTRY}/$${CI_PROJECT_NAMESPACE}/$${CI_PROJECT_NAME}/$(OCI_IMAGE):$(VERSION)-dev.$${CI_COMMIT_SHORT_SHA}"
# $(OCI_BUILDER) pull $${CI_REGISTRY}/$${CI_PROJECT_NAMESPACE}/$${CI_PROJECT_NAME}/$(OCI_IMAGE):$(VERSION)-dev.$${CI_COMMIT_SHORT_SHA}
# $(OCI_BUILDER) tag $${CI_REGISTRY}/$${CI_PROJECT_NAMESPACE}/$${CI_PROJECT_NAME}/$(OCI_IMAGE):$(VERSION)-dev.$${CI_COMMIT_SHORT_SHA} $(CAR_OCI_REGISTRY_HOST)/$(OCI_IMAGE):$(VERSION)
# @echo "oci-do-publish: Pushing to $(CAR_OCI_REGISTRY_HOST)/$(OCI_IMAGE):$(VERSION)"
# $(OCI_BUILDER) push $(CAR_OCI_REGISTRY_HOST)/$(OCI_IMAGE):$(VERSION)
# xoci-publish-all: ## Publish all OCI Images in OCI_IMAGES_TO_PUBLISH
# $(foreach ociimage,$(OCI_IMAGES_TO_PUBLISH), make xoci-publish OCI_IMAGE=$(ociimage);)
chart_test: helm-pre-publish
helm package charts/ska-tango-util/ -d charts/ska-tango-base/charts/; \
mkdir -p charts/build; helm unittest charts/ska-tango-base/ --helm3 --with-subchart --output-type JUnit --output-file charts/build/chart_template_tests.xml; \
......@@ -107,14 +107,14 @@ databaseds:
memory: 256Mi # 256Mi = 0.25 GB mem
ephemeral-storage: 1Gi
livenessProbe:
enabled: false
enabled: true
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
readinessProbe:
enabled: false
enabled: true
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
......@@ -194,14 +194,14 @@ tangodb:
ephemeral-storage: 2Gi
livenessProbe:
enabled: false
initialDelaySeconds: 0
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
readinessProbe:
enabled: false
initialDelaySeconds: 0
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
......
......@@ -6,10 +6,10 @@ version: 0.2.0
icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png
dependencies:
- name: ska-tango-base
version: 0.3.0
version: 0.3.2
repository: file://../ska-tango-base
condition: ska-tango-base.enabled,global.sub-system.ska-tango-base.enabled
- name: ska-tango-util
version: 0.3.0
version: 0.3.2
repository: file://../ska-tango-util
......@@ -87,7 +87,7 @@ metadata:
annotations:
{{ toYaml (coalesce .Values.global.annotations .Values.annotations "annotations:none") | indent 4 }}
spec:
ttlSecondsAfterFinished: 100
ttlSecondsAfterFinished: 3600
template:
spec:
initContainers:
......
......@@ -23,7 +23,7 @@ metadata:
annotations:
{{ toYaml $annotations | indent 4 }}
spec:
ttlSecondsAfterFinished: 100
ttlSecondsAfterFinished: 3600
template:
spec:
initContainers:
......
......@@ -2,6 +2,14 @@ ARG CAR_OCI_REGISTRY_HOST
ARG BASE_IMAGE="${CAR_OCI_REGISTRY_HOST}/ska-tango-images-tango-cpp-alpine:0.0.0"
FROM $BASE_IMAGE
LABEL \
author="Piers Harding <Piers.Harding@skao.int>" \
description="This image illustrates build dependencies" \
license="Apache2.0" \
int.skao.team="Systems Team" \
int.skao.website="https://gitlab.com/ska-telescope/sdi/ska-ser-containerisation-and-orchestration" \
int.skao.application="Tango Builder"
USER root
# pkgconfig needs to find these
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
......@@ -12,7 +20,9 @@ ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib
RUN apk --update add --no-cache libstdc++ \
g++ \
libsodium-dev \
libffi-dev \
zlib-dev \
boost \
boost-dev \
python3-dev \
py3-pip \
......@@ -21,6 +31,7 @@ RUN apk --update add --no-cache libstdc++ \
bash \
make \
ca-certificates \
cargo \
curl \
git
......
......@@ -2,6 +2,9 @@ numpy==1.21.0
pytango==9.3.3
flake8
flake8_formatter_junit_xml
isort
black
poetry
ipython==7.27.0
itango==0.1.8
coverage
......@@ -9,6 +12,7 @@ docutils
MarkupSafe
Pygments
pylint
pylint-junit
pytest
pytest-bdd
pytest-cov
......
......@@ -2,6 +2,9 @@ numpy==1.19.2
pytango==9.3.3
flake8
flake8_formatter_junit_xml
isort
black
poetry
ipython==7.21.0
itango==0.1.8
coverage
......@@ -9,6 +12,7 @@ docutils
MarkupSafe
Pygments
pylint
pylint-junit
pytest
pytest-bdd
pytest-cov
......
......@@ -41,3 +41,4 @@ COPY --from=buildenv /docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
COPY sql_mode.cnf /etc/mysql/conf.d
RUN chmod 644 /etc/mysql/conf.d/sql_mode.cnf
ENTRYPOINT ["/scripts/run.sh"]
......@@ -42,3 +42,4 @@ LABEL \
COPY --from=builder /docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
COPY sql_mode.cnf /etc/mysql/conf.d
RUN chmod 644 /etc/mysql/conf.d/sql_mode.cnf
......@@ -5,26 +5,21 @@
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
TEST_ARTIFACTS = pytest.stdout report.xml report.json cucumber.json pytest-logs.txt
MARK ?= fast## this variable allow the mark parameter in the pytest
FILE ?= ##this variable allow to execution of a single file in the pytest
SLEEPTIME ?= 1200s ##amount of sleep time for the smoketest target
COUNT ?= 1## amount of repetition for pytest-repeat
all: test
# create the build directory
# execute the python tests
# copy TEST_ARTIFACTS into build directory
# exit with same exit code as test run
test: install
.PHONY: test
test:
echo "Inside the test"
mkdir -p build && \
find . -name "*.pyc" -type f -delete && \
PYTHONPATH=/app:/app/testing:/app/testing/post-deployment pytest $(if $(findstring all,$(MARK)),, -m $(MARK)) --disable-pytest-warnings | tee pytest.stdout; \
PYTHONPATH=/app:/app/tests:/app/tests/post-deployment pytest $(if $(findstring all,$(MARK)),, -m $(MARK)) --disable-pytest-warnings | tee pytest.stdout; \
status=$$?; \
echo "Status set at \"$$status\" in post-deployment/Makefile test target"; \
$(foreach artfct,$(TEST_ARTIFACTS),mv -f $(artfct) build/;) \
echo "test: status is ($$status)"; \
exit $$status
.PHONY: all test install
install:
pip3 install -r test_requirements.txt;
# @echo "############ post-deployment/test_requirements.txt versions not necessarily fixed - see build/python_packages_installed_for_test.pip3 ###############"
# @pip3 list >> python_packages_installed_for_test.pip3
......@@ -3,7 +3,7 @@ Feature: tango-db
Test tango db connection
Scenario: Test mysql connection
Given Tango env tango_values.yaml
Given Tango env tests/tango_values.yaml
When I extract the DB config in the databaseds-tango-base-{{.Release.Name}}
Then I check the tango database connection
......
Pipfile
Pipfile.lock
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment