Commit fe4ca4ef authored by Daniele Venzano's avatar Daniele Venzano

Add FE unit tests, fix docs

parent 638fad1b
......@@ -9,7 +9,7 @@ variables:
POSTGRES_USER: zoeuser
POSTGRES_PASSWORD: zoepass
ZOE_TEST_IMAGE: zoe:$CI_BUILD_REF
ZOE_COMMON_OPTIONS: --debug --backend-swarm-url http://container-router.vms: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
ZOE_COMMON_OPTIONS: --debug --backend-swarm-url ${SWARM_URL} --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,39 +30,47 @@ 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
- pip install -r requirements_tests.txt
- echo "admin,admin,admin" > zoepass.csv
- mkdir /tmp/test${CI_BUILD_REF}
frontend-unittest:
stage: static-test
image: node:latest
script:
- python3 create_db_tables.py ${ZOE_COMMON_OPTIONS}
- python3 zoe-api.py ${ZOE_COMMON_OPTIONS} --log-file zoe-api-${CI_BUILD_REF}.log &
- sleep 1
- python3 zoe-master.py ${ZOE_COMMON_OPTIONS} --log-file zoe-master-${CI_BUILD_REF}.log &
- sleep 1
- cd tests
- coverage run basic_auth_success_test.py localhost:5100
artifacts:
paths:
- zoe-api-${CI_BUILD_REF}.log
- zoe-master-${CI_BUILD_REF}.log
- cd zoe_fe
- npm install
- ng test
images:
image: docker:latest
stage: build
before_script:
- mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
- cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
- docker login -u gitlab-ci-runner -p $REGISTRY_PASSWORD $DOCKER_REGISTRY
script:
- docker build --pull -t ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE} .
- docker push ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
#api-test:
# stage: integration-test
# services:
# - postgres:9.3
# image: python:3.4
# before_script:
# - pip install -r requirements.txt
# - pip install -r requirements_tests.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 zoe-api-${CI_BUILD_REF}.log &
# - sleep 1
# - python3 zoe-master.py ${ZOE_COMMON_OPTIONS} --log-file zoe-master-${CI_BUILD_REF}.log &
# - sleep 1
# - cd tests
# - coverage run basic_auth_success_test.py localhost:5100
# artifacts:
# paths:
# - zoe-api-${CI_BUILD_REF}.log
# - zoe-master-${CI_BUILD_REF}.log
#images:
# image: docker:latest
# stage: build
# before_script:
# - mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
# - cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
# - docker login -u gitlab-ci-runner -p $REGISTRY_PASSWORD $DOCKER_REGISTRY
# script:
# - docker build --pull -t ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE} .
# - docker push ${DOCKER_REGISTRY}/ci/${ZOE_TEST_IMAGE}
docs:
stage: deploy
......@@ -76,4 +84,5 @@ frontend:
image: node:latest
script:
- cd zoe_fe
- npm install
- ng build --env=prod --output-path=build/prod
......@@ -16,4 +16,4 @@ Developer documentation
scheduler
backend
stats
kube-backend
kube_backend
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