mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Added test-coverage to Makefile and upload to codecov, see #58
This commit is contained in:
parent
3e3327ade3
commit
a3167cc0ec
4 changed files with 13 additions and 3 deletions
|
|
@ -6,4 +6,5 @@ assets/public/build/*
|
|||
Dockerfile
|
||||
/photoprism
|
||||
docker-compose*
|
||||
.travis.yml
|
||||
.travis.yml
|
||||
/coverage.*
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -17,6 +17,7 @@ frontend/node_modules/*
|
|||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
/coverage.*
|
||||
|
||||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
|
||||
.glide/
|
||||
|
|
|
|||
|
|
@ -7,11 +7,15 @@ before_script:
|
|||
- docker-compose -f docker-compose.travis.yml up -d --build
|
||||
|
||||
script:
|
||||
- docker-compose -f docker-compose.travis.yml exec photoprism make migrate test
|
||||
- docker-compose -f docker-compose.travis.yml exec photoprism make migrate test-coverage
|
||||
|
||||
after_script:
|
||||
- docker cp $(docker-compose ps -q photoprism):/go/src/github.com/photoprism/photoprism/coverage.txt coverage.txt
|
||||
- docker-compose -f docker-compose.travis.yml down
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: make docker-push
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -6,6 +6,7 @@ GOMOD=$(GOCMD) mod
|
|||
GORUN=$(GOCMD) run
|
||||
GOCLEAN=$(GOCMD) clean
|
||||
GOTEST=$(GOCMD) test
|
||||
GOTOOL=$(GOCMD) tool
|
||||
GOGET=$(GOCMD) get
|
||||
GOFMT=$(GOCMD) fmt
|
||||
GOIMPORTS=goimports
|
||||
|
|
@ -36,7 +37,10 @@ start:
|
|||
migrate:
|
||||
$(GORUN) cmd/photoprism/photoprism.go migrate
|
||||
test:
|
||||
$(GOTEST) -v ./internal/...
|
||||
$(GOTEST) -timeout 30m -v ./internal/...
|
||||
test-coverage:
|
||||
$(GOTEST) -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -v ./internal/...
|
||||
$(GOTOOL) cover -html=coverage.txt -o coverage.html
|
||||
clean:
|
||||
$(GOCLEAN)
|
||||
rm -f $(BINARY_NAME)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue