Skip to content

Commit

Permalink
Implement ngt Statistics API
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <kpango@vdaas.org>
  • Loading branch information
kpango committed Jul 25, 2024
1 parent 702e851 commit 30d4ec9
Show file tree
Hide file tree
Showing 442 changed files with 106,146 additions and 7,942 deletions.
111 changes: 111 additions & 0 deletions .gitfiles

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Run formatter and license.go
run: |
make format
git checkout go.mod go.sum ./rust/Cargo.lock
git checkout go.mod go.sum ./example/client/go.mod ./example/client/go.sum ./rust/Cargo.lock ./dockers
- name: Check and Push to main branch
continue-on-error: true
run: |
Expand Down
33 changes: 23 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ PBGOS = $(PROTOS:apis/proto/%.proto=apis/grpc/%.pb.go)
SWAGGERS = $(PROTOS:apis/proto/%.proto=apis/swagger/%.swagger.json)
PBDOCS = apis/docs/v1/docs.md

LDFLAGS = -static -fPIC -pthread -std=gnu++20 -lstdc++ -lm -z relro -z now -flto -march=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast
NGT_LDFLAGS = -fopenmp -lopenblas -llapack
FAISS_LDFLAGS = $(NGT_LDFLAGS) -lgfortran
HDF5_LDFLAGS = -lhdf5 -lhdf5_hl -lsz -laec -lz -ldl
CGO_LDFLAGS = $(FAISS_LDFLAGS) $(HDF5_LDFLAGS)

ifeq ($(GOARCH),amd64)
CFLAGS ?= -mno-avx512f -mno-avx512dq -mno-avx512cd -mno-avx512bw -mno-avx512vl
CXXFLAGS ?= $(CFLAGS)
Expand Down Expand Up @@ -472,11 +478,11 @@ format/go: \
gofumpt/install \
strictgoimports/install \
goimports/install
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/golines -w -m $(GOLINES_MAX_WIDTH)
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/strictgoimports -w
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/golines -w -m $(GOLINES_MAX_WIDTH)
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/strictgoimports -w
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/goimports -w
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/crlfmt -w
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*[^\.pb]\.go' -print | xargs -P$(CORES) $(GOBIN)/gofumpt -w
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/crlfmt -w -diff=false
find $(ROOTDIR)/ -type d -name .git -prune -o -type f -regex '.*\.go' -print | xargs -P$(CORES) $(GOBIN)/gofumpt -w

.PHONY: format/go/test
## run golines, gofumpt, goimports for go test files
Expand All @@ -489,7 +495,7 @@ format/go/test: \
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/golines -w -m $(GOLINES_MAX_WIDTH)
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/strictgoimports -w
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/goimports -w
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/crlfmt -w
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/crlfmt -w -diff=false
find $(ROOTDIR) -name '*_test.go' | xargs -P$(CORES) $(GOBIN)/gofumpt -w

.PHONY: format/yaml
Expand Down Expand Up @@ -599,7 +605,14 @@ ngt/install: $(USR_LOCAL)/include/NGT/Capi.h
$(USR_LOCAL)/include/NGT/Capi.h:
git clone --depth 1 --branch v$(NGT_VERSION) https://github.com/yahoojapan/NGT $(TEMP_DIR)/NGT-$(NGT_VERSION)
cd $(TEMP_DIR)/NGT-$(NGT_VERSION) && \
cmake -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" "$(NGT_EXTRA_FLAGS)" .
cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_EXECS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_C_FLAGS="$(CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
-DCMAKE_INSTALL_PREFIX=$(USR_LOCAL) \
"$(NGT_EXTRA_FLAGS)" .
make -j$(CORES) -C $(TEMP_DIR)/NGT-$(NGT_VERSION)
make install -C $(TEMP_DIR)/NGT-$(NGT_VERSION)
cd $(ROOTDIR)
Expand All @@ -613,18 +626,18 @@ $(LIB_PATH)/libfaiss.a:
curl -fsSL https://github.com/facebookresearch/faiss/archive/v$(FAISS_VERSION).tar.gz -o $(TEMP_DIR)/v$(FAISS_VERSION).tar.gz
tar zxf $(TEMP_DIR)/v$(FAISS_VERSION).tar.gz -C $(TEMP_DIR)/
cd $(TEMP_DIR)/faiss-$(FAISS_VERSION) && \
cmake -DCMAKE_BUILD_TYPE=Release \
cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_EXECS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_C_FLAGS="$(LDFLAGS)" \
-DCMAKE_INSTALL_PREFIX=$(USR_LOCAL) \
-DFAISS_ENABLE_PYTHON=OFF \
-DFAISS_ENABLE_GPU=OFF \
-DBLA_VENDOR=OpenBLAS \
-DCMAKE_EXE_LINKER_FLAGS="-lopenblas -llapack -lgfortran -lm" \
-DCMAKE_EXE_LINKER_FLAGS="$(FAISS_LDFLAGS)" \
-B build . && \
make -C build -j faiss && \
make -C build -j$(CORES) faiss && \
make -C build install
rm -rf v$(FAISS_VERSION).tar.gz
rm -rf $(TEMP_DIR)/faiss-$(FAISS_VERSION)
Expand Down
6 changes: 6 additions & 0 deletions Makefile.d/bench.mk
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pprof/core/ngt/sequential.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand All @@ -154,6 +155,7 @@ pprof/core/ngt/parallel.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -185,6 +187,7 @@ pprof/agent/stream.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand All @@ -210,6 +213,7 @@ pprof/agent/sequential/grpc.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -240,6 +244,7 @@ pprof/gateway/sequential.bin: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-mod=readonly \
-count=1 \
Expand Down Expand Up @@ -288,6 +293,7 @@ $(ROOTDIR)/metrics.gob:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -mod=readonly -v --timeout=1h $(ROOTDIR)/hack/benchmark/e2e/agent/core/ngt/... -output=$(ROOTDIR)/metrics.gob

.PHONY: metrics/chart
Expand Down
8 changes: 4 additions & 4 deletions Makefile.d/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ binary/build: \
cmd/agent/core/ngt/ngt: \
ngt/install
$(eval CGO_ENABLED = 1)
$(call go-build,agent/core/ngt,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lm -z relro -z now -flto -march=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@)
$(call go-build,agent/core/ngt,-linkmode 'external',$(LDFLAGS) $(NGT_LDFLAGS) $(EXTLDFLAGS), cgo,NGT-$(NGT_VERSION),$@)

cmd/agent/core/faiss/faiss: \
faiss/install
$(eval CGO_ENABLED = 1)
$(call go-build,agent/core/faiss,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lstdc++ -lopenblas -llapack -lgfortran -lm -z relro -z now -flto -march=native -fno-plt -Ofast -fvisibility=hidden -ffp-contract=fast, cgo,FAISS-$(FAISS_VERSION),$@)
$(call go-build,agent/core/faiss,-linkmode 'external',$(LDFLAGS) $(FAISS_LDFLAGS), cgo,FAISS-$(FAISS_VERSION),$@)

cmd/agent/sidecar/sidecar:
$(eval CGO_ENABLED = 0)
Expand Down Expand Up @@ -93,15 +93,15 @@ cmd/index/operator/index-operator:

cmd/tools/benchmark/job/job:
$(eval CGO_ENABLED = 1)
$(call go-build,tools/benchmark/job,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lsz -laec -lz -lm -ldl, cgo,$(HDF5_VERSION),$@)
$(call go-build,tools/benchmark/job,-linkmode 'external',$(LDFLAGS) $(HDF5_LDFLAGS), cgo,$(HDF5_VERSION),$@)

cmd/tools/benchmark/operator/operator:
$(eval CGO_ENABLED = 0)
$(call go-build,tools/benchmark/operator,,-static,,,$@)

cmd/tools/cli/loadtest/loadtest:
$(eval CGO_ENABLED = 1)
$(call go-build,tools/cli/loadtest,-linkmode 'external',-static -fPIC -pthread -fopenmp -std=gnu++20 -lhdf5 -lhdf5_hl -lsz -laec -lz -lm -ldl, cgo,$(HDF5_VERSION),$@)
$(call go-build,tools/cli/loadtest,-linkmode 'external',$(LDFLAGS) $(HDF5_LDFLAGS), cgo,$(HDF5_VERSION),$@)

rust/target/release/agent:
pushd rust && cargo build -p agent --release && popd
Expand Down
11 changes: 8 additions & 3 deletions Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ define go-build
CFLAGS="$(CFLAGS)" \
CXXFLAGS="$(CXXFLAGS)" \
CGO_ENABLED=$(CGO_ENABLED) \
CGO_CXXFLAGS="-g -Ofast -march=native" \
CGO_FFLAGS="-g -Ofast -march=native" \
CGO_LDFLAGS="-g -Ofast -march=native" \
CGO_CXXFLAGS="$3" \
CGO_FFLAGS="$3" \
CGO_LDFLAGS="$3" \
GO111MODULE=on \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
Expand Down Expand Up @@ -106,6 +106,7 @@ define run-e2e-crud-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down Expand Up @@ -135,6 +136,7 @@ define run-e2e-crud-faiss-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand All @@ -160,6 +162,7 @@ define run-e2e-multi-crud-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down Expand Up @@ -189,6 +192,7 @@ define run-e2e-max-dim-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand All @@ -210,6 +214,7 @@ define run-e2e-sidecar-test
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test \
-race \
-mod=readonly \
Expand Down
7 changes: 6 additions & 1 deletion Makefile.d/proto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ proto/gen: \
$(PROTOS) \
proto/deps
@$(call green, "generating pb.go and swagger.json files and documents for API v1...")
buf format -w
buf generate
make proto/replace

proto/replace:
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%google.golang.org/grpc/codes%github.com/vdaas/vald/internal/net/grpc/codes%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%google.golang.org/grpc/status%github.com/vdaas/vald/internal/net/grpc/status%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"io\"%\"github.com/vdaas/vald/internal/io\"%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%\"sync\"%\"github.com/vdaas/vald/internal/sync\"%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%any%any%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%interface\{\}%any%g"
find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs -P$(CORES) sed -i -E "s%For_%For%g"
22 changes: 21 additions & 1 deletion Makefile.d/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/...

.PHONY: test/tparse
Expand All @@ -56,6 +57,7 @@ test/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -69,6 +71,7 @@ test/cmd/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -82,6 +85,7 @@ test/internal/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/internal/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -95,6 +99,7 @@ test/pkg/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -110,6 +115,7 @@ test/hack/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -json -cover \
$(ROOTDIR)/hack/gorules/... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -128,6 +134,7 @@ test/all/tparse: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| tparse -pass -notests
Expand All @@ -141,6 +148,7 @@ test/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... $(ROOTDIR)/internal/... $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -154,6 +162,7 @@ test/cmd/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/cmd/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -167,6 +176,7 @@ test/internal/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/internal/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -180,6 +190,7 @@ test/pkg/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/pkg/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand All @@ -195,6 +206,7 @@ test/hack/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -json -cover \
$(ROOTDIR)/hack/gorules/... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -213,6 +225,7 @@ test/all/gotestfmt: \
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -json -cover -timeout=$(GOTEST_TIMEOUT) $(ROOTDIR)/... \
| tee "$(TEST_RESULT_DIR)/`echo $@ | sed -e 's%/%-%g'`-result.json" \
| gotestfmt -showteststatus
Expand Down Expand Up @@ -250,6 +263,7 @@ test/pkg:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/pkg/...

.PHONY: test/internal
Expand All @@ -258,6 +272,7 @@ test/internal:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/internal/...

.PHONY: test/cmd
Expand All @@ -266,6 +281,7 @@ test/cmd:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/cmd/...

.PHONY: test/hack
Expand All @@ -276,6 +292,7 @@ test/hack:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=vendor -cover \
$(ROOTDIR)/hack/gorules... \
$(ROOTDIR)/hack/helm/... \
Expand All @@ -289,6 +306,7 @@ test/all:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -cover $(ROOTDIR)/...

.PHONY: coverage
Expand All @@ -297,6 +315,7 @@ coverage:
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
GOOS=$(GOOS) \
CGO_LDFLAGS="$(CGO_LDFLAGS)" \
go test -short -shuffle=on -race -mod=readonly -v -race -covermode=atomic -timeout=$(GOTEST_TIMEOUT) -coverprofile=coverage.out $(ROOTDIR)/...
GOPRIVATE=$(GOPRIVATE) \
GOARCH=$(GOARCH) \
Expand Down Expand Up @@ -349,7 +368,8 @@ test/patch-placeholder:

.PHONY: test/comment-unimplemented
## comment out unimplemented tests
test/comment-unimplemented:
test/comment-unimplemented: \
format/go/test
@$(call green, "comment out unimplemented test...")
@for f in $(GO_ALL_TEST_SOURCES) ; do \
if [ ! -f "$$f" ] ; then continue; fi; \
Expand Down
Loading

0 comments on commit 30d4ec9

Please sign in to comment.