Skip to content
Snippets Groups Projects
Commit d94c98f1 authored by Julien Leduc's avatar Julien Leduc
Browse files

enabling system tests in CI and crossing fingers ;)

parent f246f350
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ stages:
- test:valgrind
- build:dockerimage
- rename:dockerimage
- systemtests
before_script:
- export CTA_BUILD_ID=${CI_PIPELINE_ID}git${CI_BUILD_REF:0:8}
......@@ -87,3 +88,21 @@ ctageneric_docker_rename:
- export NEWTAG=${CTA_BUILD_ID}
- cd continuousintegration/ci_helpers/
- ./rename_tag.sh
archiveretrieve:
stage: systemtests
script:
- export NAMESPACE="archiveretrieve-${CTA_BUILD_ID}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)"
- echo "Creating systemtest instance using sqlite and local objectstore"
- cd continuousintegration/orchestration/; ./create_instance.sh -n ${NAMESPACE} -p ${CI_PIPELINE_ID} -D -O 2>&1 | tee -a ../../create_instance.log
- cd tests; ./systest.sh 2>&1 | tee -a ../../../systest.sh.log
- cd ../; ./delete_instance.sh -n ${NAMESPACE} 2>&1 | tee -a ../../delete_instance.log
artifacts:
paths:
- create_instance.log
- systest.sh.log
- delete_instance.log
tags:
- kubernetes
- mhvtl
......@@ -12,7 +12,7 @@ keepDatabase=1
keepObjectstore=1
usage() { cat <<EOF 1>&2
Usage: $0 -n <namespace> [-o <objectstore_configmap>] [-d <database_configmap>] [-D] [-O]
Usage: $0 -n <namespace> [-o <objectstore_configmap>] [-d <database_configmap>] [-p <gitlab pipeline ID>] [-D] [-O]
Options:
-D wipe database content during initialization phase (database content is kept by default)
......@@ -21,7 +21,7 @@ EOF
exit 1
}
while getopts "n:o:d:t:DO" o; do
while getopts "n:o:d:p:DO" o; do
case "${o}" in
o)
config_objectstore=${OPTARG}
......@@ -34,6 +34,9 @@ while getopts "n:o:d:t:DO" o; do
n)
instance=${OPTARG}
;;
p)
pipelineid=${OPTARG}
;;
O)
keepObjectstore=0
;;
......@@ -53,8 +56,13 @@ fi
COMMITID=$(git log -n1 | grep ^commit | cut -d\ -f2 | sed -e 's/\(........\).*/\1/')
echo "Creating instance for latest image built for ${COMMITID} (highest PIPELINEID)"
imagetag=$(../ci_helpers/list_images.sh 2>/dev/null | grep ${COMMITID} | sort -n | tail -n1)
if [ -z "${pipelineid}" ]; then
echo "Creating instance for latest image built for ${COMMITID} (highest PIPELINEID)"
imagetag=$(../ci_helpers/list_images.sh 2>/dev/null | grep ${COMMITID} | sort -n | tail -n1)
else
echo "Creating instance for image built on commit ${COMMITID} with gitlab pipeline ID ${pipelineid}"
imagetag=$(../ci_helpers/list_images.sh 2>/dev/null | grep ${COMMITID} | grep ^${pipelineid}git | sort -n | tail -n1)
fi
if [ "${imagetag}" == "" ]; then
echo "commit:${COMMITID} has no docker image available in gitlab registry, please check pipeline status and registry images available."
exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment