Commit d5c1e80e authored by Daniele Venzano's avatar Daniele Venzano

Port the integration test script to gitlab yaml config

parent 69b74b3c
stages:
- static-test
- build
- integration-test
- build
- deploy
variables:
# Configure postgres service (https://hub.docker.com/_/postgres/)
POSTGRES_DB: zoe
POSTGRES_USER: zoeuser
POSTGRES_PASSWORD: zoepass
ZOE_TEST_IMAGE: zoe:$CI_BUILD_REF
ZOE_COMMON_OPTIONS: --debug --backend-swarm-url http://172.17.0.1:2375 --deployment-name test${CI_BUILD_REF} --dbuser ${POSTGRES_USER} --dbhost postgres --dbport 5432 --dbname ${POSTGRES_DB} --dbpass ${POSTGRES_PASSWORD} --master-url tcp://localhost:4850 --auth-type text --proxy-type none --listen-port 5100 --workspace-base-path /tmp
#lint:
# stage: static-test
......@@ -30,6 +30,28 @@ variables:
# script:
# - /usr/bin/sonar-scanner-run.sh
api-test:
stage: integration-test
services:
- postgres:9.3
image: python:3.4
before_script:
- pip install -r requirements.txt
- echo "admin,admin,admin" > zoepass.csv
- mkdir /tmp/test${CI_BUILD_REF}
script:
- python3 create_db_tables.py ${ZOE_COMMON_OPTIONS}
- python3 zoe-api.py ${ZOE_COMMON_OPTIONS} --log-file /tmp/zoe-api-${CI_BUILD_REF}.log &
- sleep 1
- python3 zoe-master.py ${ZOE_COMMON_OPTIONS} --log-file /tmp/zoe-master-${CI_BUILD_REF}.log &
- sleep 1
- cd tests
- coverage run basic_auth_success_test.py localhost:5100
artifacts:
paths:
- /tmp/zoe-api-${CI_BUILD_REF}.log
- /tmp/zoe-master-${CI_BUILD_REF}.log
images:
image: docker:latest
stage: build
......@@ -38,16 +60,8 @@ images:
- cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
- docker login -u gitlab-ci-runner -p $REGISTRY_PASSWORD $DOCKER_REGISTRY
script:
- sh ci/build_images.sh
api-test:
stage: integration-test
services:
- postgres:9.3
image: docker:latest
script:
- docker run $DOCKER_REGISTRY:ci/$ZOE_TEST_IMAGE
-
- docker build --pull -t ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE} .
- docker push ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
docs:
stage: deploy
......
#!/usr/bin/env bash
ZOE_TEST_IMAGE=${ZOE_TEST_IMAGE:-zoe:manual}
DOCKER_REGISTRY=${DOCKER_REGISTRY:-docker-registry:5000}
CI_BUILD_REF=${CI_BUILD_REF:-manual}
ZOE_COMMON_OPTIONS="--debug --backend-swarm-url http://localhost:2375 --deployment-name test${CI_BUILD_REF} --dbuser postgres --dbhost localhost --dbport 5432 --dbname postgres --dbpass postgres --master-url tcp://localhost:4850 --auth-type text --proxy-type none --listen-port 5100 --workspace-base-path /tmp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment