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

ST-908: first attempt at switching tests to .make/k8s.mk


Signed-off-by: default avatarPiers Harding <piers@ompka.net>
parent 7599cf2e
No related branches found
No related tags found
No related merge requests found
Showing
with 67 additions and 8 deletions
.make @ dbb4dd98
Subproject commit 7cdd757ea020313035f77c2d991d32886a11542d
Subproject commit dbb4dd981183f4692268da03d74a10c4bd12c516
......@@ -22,6 +22,7 @@ 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
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
......@@ -182,6 +183,10 @@ helm-pre-lint: helm-pre-publish ## make sure auto-generate values.yaml happens
# 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
k8s-pre-template-chart:
make helm-pre-publish
......
......@@ -193,15 +193,15 @@ tangodb:
memory: 256Mi # 256Mi = 0.25 GB mem
ephemeral-storage: 2Gi
livenessProbe:
enabled: true
initialDelaySeconds: 0
enabled: false
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
readinessProbe:
enabled: true
initialDelaySeconds: 0
enabled: false
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
......
......@@ -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,23 @@
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
Pipfile
Pipfile.lock
\ No newline at end of file
[pytest]
filterwarnings =
ignore::DeprecationWarning
junit_family=xunit1
log_cli = true
log_cli_level = INFO
log_cli_format = 1|%(asctime)s.%(msecs)03dZ|%(levelname)s|%(threadName)s|%(funcName)s|%(filename)s#%(lineno)d||%(message)s
log_cli_date_format = %Y-%m-%dT%H:%M:%S
log_file = pytest-logs.txt
log_file_level = INFO
testpaths = unit
# addopts = --json-report --json-report-file=report.json --junitxml=report.xml --cucumberjson=cucumber.json --disable-pytest-warnings
addopts = --json-report --json-report-file=build/report.json --junitxml=build/report.xml --cucumberjson=build/cucumber.json --disable-pytest-warnings
# addopts =
# --forked
# --json-report
# --json-report-file=build/reports/report.json
# --cov-report html:build/htmlcov
# --cov-report xml:build/reports/code-coverage.xml
# --cov=skampi
# --cucumberjson=build/reports/cucumber.json
# --junitxml=build/reports/unit-tests.xml
# --verbose
markers =
bdd_features_base_dir = features
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment