Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
.PHONY: integration integration_w_race

DELAY ?= 0

ifneq ($(DELAY),0)
DELAY_FLAG=-delay $(DELAY)
endif

TAGS=integration,sftp.sync.metrics

integration:
go test -v ./...
go test -v $(DELAY_FLAG) -tags=$(TAGS)
go test ./encoding/... ./internal/...
make -C localfs integration

integration_w_race:
go test -race -v ./...
make -C localfs integration
go test -race -v $(DELAY_FLAG) -tags=$(TAGS)
go test -race ./encoding/... ./internal/...
make -C localfs integration_w_race

COUNT ?= 1
BENCHMARK_PATTERN ?= "."

benchmark:
go test -v -run=NONE -bench=$(BENCHMARK_PATTERN) -benchmem -count=$(COUNT) $(DELAY_FLAG) -tags=$(TAGS)
make -C localfs benchmark

benchmark_w_memprofile:
ifneq ($(DELAY),0)
@echo "memprofile with DELAY produces invalid data" >&2
@exit 1
endif
go test -v -run=NONE -bench=$(BENCHMARK_PATTERN) -benchmem -count=$(COUNT) -memprofile memprofile.out -tags=integration
go tool pprof -sample_index=alloc_space -svg -output=memprofile-space.svg memprofile.out
go tool pprof -sample_index=alloc_objects -svg -output=memprofile-allocs.svg memprofile.out
make -C localfs benchmark_w_memprofile
Loading
Loading