From 71ab20bbef0cdfa5a5fed20a5974e8f2621c5bd0 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Mon, 9 Sep 2019 13:27:26 +0200 Subject: [PATCH] add all in one testing and coverage analysis --- .gitlab-ci.yml | 16 ++++++++++++++++ README.md | 1 + 2 files changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8fa1b9..15b8219 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -130,6 +130,22 @@ test:user: variables: TEST_FOLDER: routes/user +test:all: + stage: test + tags: + - docker + image: villaswebbackendgo:ubuntu + script: + - /etc/init.d/postgresql start + - go mod tidy + - go get -u github.com/swaggo/swag/cmd/swag + - ~/go/bin/swag init -p pascalcase -g "start.go" -o "./doc/api/" + - go test $(go list ./... ) -v -p 1 -covermode=count -coverprofile ./testcover.txt + - go tool cover -func=testcover.txt + dependencies: + - build:backend + + # Stage: deploy ############################################################################## diff --git a/README.md b/README.md index e9cca05..e4f001b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # VILLASweb-backend-go [![pipeline status](https://git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/badges/master/pipeline.svg)](https://git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/commits/master) +[![coverage report](https://git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/badges/master/coverage.svg)](https://git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/commits/master) ## Description This is a rewrite of the backend for the VILLASweb