Allow for running dedicated tests
Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
This commit is contained in:
parent
49087433fb
commit
826204b667
19
Makefile
19
Makefile
|
@ -7,15 +7,17 @@ help:
|
||||||
@echo " - build Build the bot"
|
@echo " - build Build the bot"
|
||||||
@echo " - run Start the bot"
|
@echo " - run Start the bot"
|
||||||
@echo " - clean Delete generated files"
|
@echo " - clean Delete generated files"
|
||||||
@echo " - test Run test suite"
|
@echo " - test Run full test suite"
|
||||||
@echo " - coverage Run test suite and generates coverage report as HTML file"
|
@echo " - test p=./path/to/package Run test suite for specific package"
|
||||||
|
@echo " - test\#SpecificTestName Run a specific"
|
||||||
|
@echo " - coverage Run full test suite and generates coverage report as HTML file"
|
||||||
@echo " - dep Dependency maintenance (tidy, vendor, verify)"
|
@echo " - dep Dependency maintenance (tidy, vendor, verify)"
|
||||||
@echo " - vet Examine Go source code and reports suspicious parts"
|
@echo " - vet Examine Go source code and reports suspicious parts"
|
||||||
@echo " - fmt Format the Go code"
|
@echo " - fmt Format the Go code"
|
||||||
@echo " - help Print this help"
|
@echo " - help Print this help"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
GOARCH=amd64 GOOS=linux go build --mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
|
GOARCH=amd64 GOOS=linux go build -mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
|
||||||
|
|
||||||
run:
|
run:
|
||||||
./${BINARY_NAME}
|
./${BINARY_NAME}
|
||||||
|
@ -26,10 +28,17 @@ clean:
|
||||||
rm -f cover.out cover.html
|
rm -f cover.out cover.html
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -v ./...
|
ifdef p
|
||||||
|
go test -v -mod=vendor $(p)
|
||||||
|
else
|
||||||
|
go test -v -mod=vendor ./...
|
||||||
|
endif
|
||||||
|
|
||||||
|
test\#%:
|
||||||
|
go test -mod=vendor -run $(subst .,/,$*) ./...
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
go test -v -coverprofile=cover.out ./...
|
go test -coverprofile=cover.out ./...
|
||||||
go tool cover -html=cover.out -o cover.html
|
go tool cover -html=cover.out -o cover.html
|
||||||
|
|
||||||
dep:
|
dep:
|
||||||
|
|
Loading…
Reference in a new issue