mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Remove etcd unit testing from travis (#2672)
* Remove etcd unit testing from travis Remove these from the travis unit testing. (to speed up travis) See #2671 Signed-off-by: Miek Gieben <miek@miek.nl> * Add build tag Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
11
.travis.yml
11
.travis.yml
@@ -22,10 +22,10 @@ branches:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TEST_TYPE=coverage ETCD_VERSION=3.3.8
|
- TEST_TYPE=coverage
|
||||||
- TEST_TYPE=integration ETCD_VERSION=3.3.8
|
- TEST_TYPE=integration
|
||||||
- TEST_TYPE=core ETCD_VERSION=3.3.8
|
- TEST_TYPE=core
|
||||||
- TEST_TYPE=plugin ETCD_VERSION=3.3.8
|
- TEST_TYPE=plugin
|
||||||
|
|
||||||
# In the Travis VM-based build environment, IPv6 networking is not
|
# In the Travis VM-based build environment, IPv6 networking is not
|
||||||
# enabled by default. The sysctl operations below enable IPv6.
|
# enabled by default. The sysctl operations below enable IPv6.
|
||||||
@@ -40,9 +40,6 @@ before_install:
|
|||||||
- cat /proc/net/if_inet6
|
- cat /proc/net/if_inet6
|
||||||
- env
|
- env
|
||||||
|
|
||||||
before_script:
|
|
||||||
- docker run -d --net=host --name=etcd quay.io/coreos/etcd:v$ETCD_VERSION
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make TEST_TYPE=$TEST_TYPE travis
|
- make TEST_TYPE=$TEST_TYPE travis
|
||||||
|
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -22,21 +22,21 @@ check: presubmit core/plugin/zplugin.go core/dnsserver/zdirectives.go
|
|||||||
.PHONY: travis
|
.PHONY: travis
|
||||||
travis:
|
travis:
|
||||||
ifeq ($(TEST_TYPE),core)
|
ifeq ($(TEST_TYPE),core)
|
||||||
( cd request ; GO111MODULE=on go test -v -tags 'etcd' -race ./... )
|
( cd request ; GO111MODULE=on go test -v -race ./... )
|
||||||
( cd core ; GO111MODULE=on go test -v -tags 'etcd' -race ./... )
|
( cd core ; GO111MODULE=on go test -v -race ./... )
|
||||||
( cd coremain ; GO111MODULE=on go test -v -tags 'etcd' -race ./... )
|
( cd coremain ; GO111MODULE=on go test -v -race ./... )
|
||||||
endif
|
endif
|
||||||
ifeq ($(TEST_TYPE),integration)
|
ifeq ($(TEST_TYPE),integration)
|
||||||
( cd test ; GO111MODULE=on go test -v -tags 'etcd' -race ./... )
|
( cd test ; GO111MODULE=on go test -v -race ./... )
|
||||||
endif
|
endif
|
||||||
ifeq ($(TEST_TYPE),plugin)
|
ifeq ($(TEST_TYPE),plugin)
|
||||||
( cd plugin ; GO111MODULE=on go test -v -tags 'etcd' -race ./... )
|
( cd plugin ; GO111MODULE=on go test -v -race ./... )
|
||||||
endif
|
endif
|
||||||
ifeq ($(TEST_TYPE),coverage)
|
ifeq ($(TEST_TYPE),coverage)
|
||||||
for d in `go list ./... | grep -v vendor`; do \
|
for d in `go list ./... | grep -v vendor`; do \
|
||||||
t=$$(date +%s); \
|
t=$$(date +%s); \
|
||||||
GO111MODULE=on go test -i -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
|
GO111MODULE=on go test -i -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
|
||||||
GO111MODULE=on go test -v -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
|
GO111MODULE=on go test -v -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
|
||||||
echo "Coverage test $$d took $$(($$(date +%s)-t)) seconds"; \
|
echo "Coverage test $$d took $$(($$(date +%s)-t)) seconds"; \
|
||||||
if [ -f cover.out ]; then \
|
if [ -f cover.out ]; then \
|
||||||
cat cover.out >> coverage.txt; \
|
cat cover.out >> coverage.txt; \
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// +build etcd
|
||||||
|
|
||||||
package etcd
|
package etcd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -126,6 +128,5 @@ func TestSetupEtcd(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user