52 lines
1.3 KiB
Makefile
52 lines
1.3 KiB
Makefile
download-third-party:
|
|
rm -rf ./grpc/third_party
|
|
mkdir -p ./grpc/third_party
|
|
cd ./grpc/third_party && git clone https://github.com/googleapis/googleapis.git
|
|
mv ./grpc/third_party/googleapis/google ./grpc
|
|
mv ./grpc/third_party/googleapis/grafeas ./grpc
|
|
rm -rf ./grpc/third_party
|
|
|
|
gen-proto:
|
|
mkdir -p ./grpc
|
|
|
|
@protoc -I ./grpc \
|
|
--go_out=grpc --go_opt paths=source_relative \
|
|
--go-grpc_out=grpc --go-grpc_opt paths=source_relative \
|
|
--grpc-gateway_out=grpc --grpc-gateway_opt paths=source_relative \
|
|
./grpc/snapshot.proto
|
|
|
|
# Run all tests
|
|
test:
|
|
go test -v ./...
|
|
|
|
# Run unit tests
|
|
test-unit:
|
|
go test -v ./store/... ./hash/... ./archive/...
|
|
|
|
# Run integration tests
|
|
test-integration:
|
|
go test -v -tags=integration ./...
|
|
|
|
# Run functional tests
|
|
test-functional:
|
|
go test -v -run TestFull ./...
|
|
|
|
# Run performance tests
|
|
test-performance:
|
|
go test -v -run TestPerformanceMetrics ./...
|
|
go test -v -bench=. ./...
|
|
|
|
# Run tests with code coverage
|
|
test-coverage:
|
|
go test -v -coverprofile=coverage.out ./...
|
|
go tool cover -html=coverage.out -o coverage.html
|
|
|
|
# Run linter
|
|
lint:
|
|
golangci-lint run
|
|
|
|
# Run all checks (tests + linter)
|
|
check: test lint
|
|
|
|
.PHONY: download-third-party gen-proto test test-unit test-integration test-functional test-performance test-coverage lint check
|