From 4172bfc25e1c7dc4265a50b3ba73e87401fb75c1 Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 19 Apr 2018 17:17:21 -0700 Subject: [PATCH] documentation: add instructions for running tests locally (#2006) --- CONTRIBUTING.md | 4 ++++ Makefile | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ec6c957..0863eb26 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,6 +27,10 @@ How to get your contributions merged smoothly and quickly. - Keep your PR up to date with upstream/master (if there are merge conflicts, we can't really merge your change). - **All tests need to be passing** before your change can be merged. We recommend you **run tests locally** before creating your PR to catch breakages early on. + - `make all` to test everything, OR + - `make vet` to catch vet errors + - `make test` to run the tests + - `make testrace` to run tests in race mode - Exceptions to the rules can be made if there's a compelling reason for doing so. diff --git a/Makefile b/Makefile index c4453437..6f393a80 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: test testrace +all: vet test testrace deps: go get -d -v google.golang.org/grpc/... @@ -22,6 +22,9 @@ proto: fi go generate google.golang.org/grpc/... +vet: + ./vet.sh + test: testdeps go test -cpu 1,4 -timeout 5m google.golang.org/grpc/... @@ -39,7 +42,7 @@ clean: updatetestdeps \ build \ proto \ + vet \ test \ testrace \ - clean \ - coverage + clean