diff --git a/.gitignore b/.gitignore index 7973f4e0e80615ccb708844ab5b87f225bfac1c5..2029f35ec2581cc63764615449c27a374ee602ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ gen/* bin/* + +cover.profile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ada667b231684be1a58be3f1cdda6bf1c65f3bee..22d394ab44b89e03cf2dea9061b9acebe0edeab6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,8 +46,17 @@ test-go: stage: test image: name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golang:${GOLANG_VERSION} + before_script: + - go install github.com/t-yuki/gocover-cobertura@latest script: - - go test ./... + - go test ./... -coverprofile=cover.profile && go tool cover -func cover.profile + - gocover-cobertura < cover.profile > coverage.xml + coverage: /total:\s+\(statements\)\s+\d+.\d+%/ + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml needs: - generate-api diff --git a/README.md b/README.md index 73d185e0cea485db992a4416cd38afe60a427463..fc8564e72b7f1ac2e715586867d19f59975e264e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Costaquanta + + + This repository is used for development and testing of QKDN software. It's use-case is research and development only. If you are interested in production grade QKDN software, please feel free to contact us. diff --git a/justfile b/justfile index db8ec8798a1574601bd00310bd843bc30e973873..62fdb243a3fe1b3a04a279257fecc4ade16a3225 100644 --- a/justfile +++ b/justfile @@ -11,7 +11,10 @@ build-api: buf generate test: - go test ./... + go test -coverprofile=cover.profile ./... + +code-coverage: test + go tool cover -func cover.profile lint: docker run --rm -t -v $(pwd):/app -w /app \