Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the watch package into the api module #5664

Merged
merged 8 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from 5 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
19 changes: 14 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ GOTOOLS = \
github.com/vektra/mockery/cmd/mockery

GOTAGS ?=
GOFILES ?= $(shell go list ./... | grep -v /vendor/)
GOMODULES ?= ./... ./api/... ./sdk/...
GOFILES ?= $(shell go list $(GOMODULES) | grep -v /vendor/)
ifeq ($(origin GOTEST_PKGS_EXCLUDE), undefined)
GOTEST_PKGS ?= "./..."
GOTEST_PKGS ?= $(GOMODULES)
else
GOTEST_PKGS=$(shell go list ./... | sed 's/github.com\/hashicorp\/consul/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))$$")
GOTEST_PKGS=$(shell go list $(GOMODULES) | sed 's/github.com\/hashicorp\/consul/./' | egrep -v "^($(GOTEST_PKGS_EXCLUDE))$$")
endif
GOOS?=$(shell go env GOOS)
GOARCH?=$(shell go env GOARCH)
Expand Down Expand Up @@ -143,14 +144,22 @@ dev-tree:
@$(SHELL) $(CURDIR)/build-support/scripts/dev.sh $(DEV_PUSH_ARG)

cov:
go test ./... -coverprofile=coverage.out
go test $(GOMODULES) -coverprofile=coverage.out
go tool cover -html=coverage.out

test: other-consul dev-build vet test-install-deps test-internal

test-install-deps:
go test -tags '$(GOTAGS)' -i $(GOTEST_PKGS)

update-vendor:
@echo "--> Running go mod vendor"
@go mod vendor
@echo "--> Removing vendoring of our own nested modules"
@rm -rf vendor/github.com/hashicorp/consul
@grep -v "hashicorp/consul/" < vendor/modules.txt > vendor/modules.txt.new
rboyer marked this conversation as resolved.
Show resolved Hide resolved
@mv vendor/modules.txt.new vendor/modules.txt

test-internal:
@echo "--> Running go test"
@rm -f test.log exit-code
Expand Down Expand Up @@ -265,4 +274,4 @@ proto:

.PHONY: all ci bin dev dist cov test test-ci test-internal test-install-deps cover format vet ui static-assets tools
.PHONY: docker-images go-build-image ui-build-image static-assets-docker consul-docker ui-docker
.PHONY: version proto
.PHONY: version proto
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ import (
"github.com/hashicorp/consul/agent/token"
"github.com/hashicorp/consul/agent/xds"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/api/watch"
"github.com/hashicorp/consul/ipaddr"
"github.com/hashicorp/consul/lib"
"github.com/hashicorp/consul/lib/file"
"github.com/hashicorp/consul/logger"
"github.com/hashicorp/consul/tlsutil"
"github.com/hashicorp/consul/types"
"github.com/hashicorp/consul/watch"
multierror "github.com/hashicorp/go-multierror"
uuid "github.com/hashicorp/go-uuid"
"github.com/hashicorp/memberlist"
Expand Down
2 changes: 1 addition & 1 deletion agent/watch_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/armon/circbuf"
"github.com/hashicorp/consul/agent/exec"
"github.com/hashicorp/consul/watch"
"github.com/hashicorp/consul/api/watch"
"github.com/hashicorp/go-cleanhttp"
"golang.org/x/net/context"
)
Expand Down
2 changes: 1 addition & 1 deletion agent/watch_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/hashicorp/consul/watch"
"github.com/hashicorp/consul/api/watch"
)

func TestMakeWatchHandler(t *testing.T) {
Expand Down
28 changes: 14 additions & 14 deletions api/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAPI_ACLBootstrap(t *testing.T) {

func TestAPI_ACLCreateDestroy(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()
s.WaitForSerfCheck(t)

Expand Down Expand Up @@ -64,7 +64,7 @@ func TestAPI_ACLCreateDestroy(t *testing.T) {

func TestAPI_ACLCloneDestroy(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestAPI_ACLCloneDestroy(t *testing.T) {

func TestAPI_ACLInfo(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand All @@ -118,7 +118,7 @@ func TestAPI_ACLInfo(t *testing.T) {

func TestAPI_ACLList(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand All @@ -143,7 +143,7 @@ func TestAPI_ACLList(t *testing.T) {

func TestAPI_ACLReplication(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -172,7 +172,7 @@ func TestAPI_ACLReplication(t *testing.T) {

func TestAPI_ACLPolicy_CreateReadDelete(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -207,7 +207,7 @@ func TestAPI_ACLPolicy_CreateReadDelete(t *testing.T) {

func TestAPI_ACLPolicy_CreateUpdate(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestAPI_ACLPolicy_CreateUpdate(t *testing.T) {

func TestAPI_ACLPolicy_List(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -378,7 +378,7 @@ func prepTokenPolicies(t *testing.T, acl *ACL) (policies []*ACLPolicy) {

func TestAPI_ACLToken_CreateReadDelete(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -431,7 +431,7 @@ func TestAPI_ACLToken_CreateReadDelete(t *testing.T) {

func TestAPI_ACLToken_CreateUpdate(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -494,7 +494,7 @@ func TestAPI_ACLToken_CreateUpdate(t *testing.T) {

func TestAPI_ACLToken_List(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -599,7 +599,7 @@ func TestAPI_ACLToken_List(t *testing.T) {

func TestAPI_ACLToken_Clone(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand All @@ -624,7 +624,7 @@ func TestAPI_ACLToken_Clone(t *testing.T) {

func TestAPI_RulesTranslate_FromToken(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down Expand Up @@ -658,7 +658,7 @@ func TestAPI_RulesTranslate_FromToken(t *testing.T) {

func TestAPI_RulesTranslate_Raw(t *testing.T) {
t.Parallel()
c, s := makeACLClient(t)
c, s := MakeTestACLClient(t)
defer s.Stop()

acl := c.ACL()
Expand Down
Loading