Commit 8d1c1812 authored by Julien Schröter's avatar Julien Schröter

Enable usage of gitlab test reports for unittests and e2e tests

parent 3f195ae2
......@@ -37,7 +37,11 @@ unittest:
- cd $GOPATH/src/$REPO_NAME
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.akamu.de/".insteadOf "https://gitlab.akamu.de/"
- go get ./...
- go test ./test
- go get -u github.com/jstemmer/go-junit-report
- go test ./test -v 2>&1 | go-junit-report > report-unit.xml
artifacts:
reports:
junit: report-unit.xml
e2etest:
stage: test
......@@ -54,7 +58,11 @@ e2etest:
- TEST_DATAFILE=$CI_PROJECT_DIR/resources/data/testdata.sql
- echo "{\"jwt-secret\":\"akamu\",\"database\":{\"name\":\"$MYSQL_DATABASE\",\"user\":\"$MYSQL_USER\",\"host\":\"mariadb\",\"password\":\"$MYSQL_PASSWORD\"},\"resource-server\":{\"host\":\"u188504.your-storagebox.de\",\"user\":\"u188504\",\"password\":\"OJgmF9AVdJdoLSK1\"}}" > $TEST_CONFIGFILE
- go get ./...
- TEST_DATAFILE=$TEST_DATAFILE TEST_CONFIGFILE=$TEST_CONFIGFILE go test ./test/e2e
- go get -u github.com/jstemmer/go-junit-report
- TEST_DATAFILE=$TEST_DATAFILE TEST_CONFIGFILE=$TEST_CONFIGFILE go test ./test/e2e -v 2>&1 | go-junit-report > report-e2e.xml
artifacts:
reports:
junit: report-e2e.xml
compile:
stage: build
......@@ -75,59 +83,57 @@ compile:
- development
dev_service:
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go:dev .
- docker push registry.akamu.de/akamu/game-server-go:dev
- docker service update dev_backend_appserver --image registry.akamu.de/akamu/game-server-go:dev --force --with-registry-auth
allow_failure: true
tags:
- deploy
only:
- development
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go:dev .
- docker push registry.akamu.de/akamu/game-server-go:dev
- docker service update dev_backend_appserver --image registry.akamu.de/akamu/game-server-go:dev --force --with-registry-auth
allow_failure: true
tags:
- deploy
only:
- development
service:
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go .
- docker push registry.akamu.de/akamu/game-server-go
- docker service update backend_appserver --image registry.akamu.de/akamu/game-server-go:latest --force --with-registry-auth
allow_failure: true
tags:
- deploy
only:
- master
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go .
- docker push registry.akamu.de/akamu/game-server-go
- docker service update backend_appserver --image registry.akamu.de/akamu/game-server-go:latest --force --with-registry-auth
allow_failure: true
tags:
- deploy
only:
- master
dev_swagger:
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go/swagger:dev -f Dockerfile_swagger .
- docker push registry.akamu.de/akamu/game-server-go/swagger:dev
- docker service update dev_website_swagger --image registry.akamu.de/akamu/game-server-go/swagger:dev --force
allow_failure: true
tags:
- deploy
only:
- development
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go/swagger:dev -f Dockerfile_swagger .
- docker push registry.akamu.de/akamu/game-server-go/swagger:dev
- docker service update dev_website_swagger --image registry.akamu.de/akamu/game-server-go/swagger:dev --force
allow_failure: true
tags:
- deploy
only:
- development
swagger:
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go/swagger -f Dockerfile_swagger .
- docker push registry.akamu.de/akamu/game-server-go/swagger
- docker service update website_swagger --image registry.akamu.de/akamu/game-server-go/swagger:latest --force
allow_failure: true
tags:
- deploy
only:
- master
stage: deploy
image: docker:stable
script:
- docker login registry.akamu.de -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t registry.akamu.de/akamu/game-server-go/swagger -f Dockerfile_swagger .
- docker push registry.akamu.de/akamu/game-server-go/swagger
- docker service update website_swagger --image registry.akamu.de/akamu/game-server-go/swagger:latest --force
allow_failure: true
tags:
- deploy
only:
- master
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