mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
Benching (#2121)
* Benchmark stuff Signed-off-by: Miek Gieben <miek@miek.nl> * Makefile changes Signed-off-by: Miek Gieben <miek@miek.nl> * Fixes Signed-off-by: Miek Gieben <miek@miek.nl> * fix Signed-off-by: Miek Gieben <miek@miek.nl> * Add benchmark test Signed-off-by: Miek Gieben <miek@miek.nl> * Add master branch Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
29
Makefile
29
Makefile
@@ -17,14 +17,6 @@ coredns: $(CHECKS)
|
||||
.PHONY: check
|
||||
check: presubmit core/zplugin.go core/dnsserver/zdirectives.go godeps
|
||||
|
||||
.PHONY: test
|
||||
test: check
|
||||
go test -race $(VERBOSE) ./test ./plugin/...
|
||||
|
||||
.PHONY: testk8s
|
||||
testk8s: check
|
||||
go test -race $(VERBOSE) -tags=k8s -run 'TestKubernetes' ./test ./plugin/kubernetes/...
|
||||
|
||||
.PHONY: godeps
|
||||
godeps:
|
||||
@ # Not vendoring these, so external plugins compile, avoiding:
|
||||
@@ -40,13 +32,15 @@ godeps:
|
||||
(cd $(GOPATH)/src/github.com/mholt/caddy && git checkout -q v0.10.11)
|
||||
(cd $(GOPATH)/src/github.com/miekg/dns && git checkout -q v1.0.8)
|
||||
(cd $(GOPATH)/src/github.com/prometheus/client_golang && git checkout -q v0.8.0)
|
||||
@ # for travis only, if this fails we don't care, but don't see benchmarks
|
||||
go get -u golang.org/x/tools/cmd/benchcmp || true
|
||||
|
||||
.PHONY: travis
|
||||
travis: check
|
||||
travis:
|
||||
ifeq ($(TEST_TYPE),core)
|
||||
( cd request ; go test -v -tags 'etcd' -race ./... )
|
||||
( cd core ; go test -v -tags 'etcd' -race ./... )
|
||||
( cd coremain go test -v -tags 'etcd' -race ./... )
|
||||
( cd coremain ; go test -v -tags 'etcd' -race ./... )
|
||||
endif
|
||||
ifeq ($(TEST_TYPE),integration)
|
||||
( cd test ; go test -v -tags 'etcd' -race ./... )
|
||||
@@ -66,6 +60,21 @@ ifeq ($(TEST_TYPE),coverage)
|
||||
fi; \
|
||||
done
|
||||
endif
|
||||
ifeq ($(TEST_TYPE),benchmark)
|
||||
> new
|
||||
( cd plugin; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> new
|
||||
( cd request; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> new
|
||||
( cd core; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> new
|
||||
( cd coremain; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> new
|
||||
git checkout master
|
||||
> old
|
||||
( cd plugin; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
|
||||
( cd request; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
|
||||
( cd core; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
|
||||
( cd coremain; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
|
||||
if command -v benchcmp; then benchcmp old new ; fi
|
||||
git checkout -
|
||||
endif
|
||||
|
||||
core/zplugin.go core/dnsserver/zdirectives.go: plugin.cfg
|
||||
go generate coredns.go
|
||||
|
||||
Reference in New Issue
Block a user