Commit Graph

133 Commits

Author SHA1 Message Date
Preetha Appan cf5006c4f4 Fixed static asset build target and checked in new executable for assetfs 2017-06-12 12:57:02 -05:00
Frank Schroeder 1c75cf1af5 pkg refactor
command/agent/*                  -> agent/*
    command/consul/*                 -> agent/consul/*
    command/agent/command{,_test}.go -> command/agent{,_test}.go
    command/base/command.go          -> command/base.go
    command/base/*                   -> command/*
    commands.go                      -> command/commands.go

The script which did the refactor is:

(
	cd $GOPATH/src/github.com/hashicorp/consul
	git mv command/agent/command.go command/agent.go
	git mv command/agent/command_test.go command/agent_test.go
	git mv command/agent/flag_slice_value{,_test}.go command/
	git mv command/agent .
	git mv command/base/command.go command/base.go
	git mv command/base/config_util{,_test}.go command/
	git mv commands.go command/
	git mv consul agent
	rmdir command/base/

	gsed -i -e 's|package agent|package command|' command/agent{,_test}.go
	gsed -i -e 's|package agent|package command|' command/flag_slice_value{,_test}.go
	gsed -i -e 's|package base|package command|' command/base.go command/config_util{,_test}.go
	gsed -i -e 's|package main|package command|' command/commands.go

	gsed -i -e 's|base.Command|BaseCommand|' command/commands.go
	gsed -i -e 's|agent.Command|AgentCommand|' command/commands.go
	gsed -i -e 's|\tCommand:|\tBaseCommand:|' command/commands.go
	gsed -i -e 's|base\.||' command/commands.go
	gsed -i -e 's|command\.||' command/commands.go

	gsed -i -e 's|command|c|' main.go
	gsed -i -e 's|range Commands|range command.Commands|' main.go
	gsed -i -e 's|Commands: Commands|Commands: command.Commands|' main.go

	gsed -i -e 's|base\.BoolValue|BoolValue|' command/operator_autopilot_set.go
	gsed -i -e 's|base\.DurationValue|DurationValue|' command/operator_autopilot_set.go
	gsed -i -e 's|base\.StringValue|StringValue|' command/operator_autopilot_set.go
	gsed -i -e 's|base\.UintValue|UintValue|' command/operator_autopilot_set.go

	gsed -i -e 's|\bCommand\b|BaseCommand|' command/base.go
	gsed -i -e 's|BaseCommand Options|Command Options|' command/base.go
	gsed -i -e 's|base.Command|BaseCommand|' command/*.go
	gsed -i -e 's|c\.Command|c.BaseCommand|g' command/*.go
	gsed -i -e 's|\tCommand:|\tBaseCommand:|' command/*_test.go
	gsed -i -e 's|base\.||' command/*_test.go

	gsed -i -e 's|\bCommand\b|AgentCommand|' command/agent{,_test}.go
	gsed -i -e 's|cmd.AgentCommand|cmd.BaseCommand|' command/agent.go

	gsed -i -e 's|cli.AgentCommand = new(Command)|cli.Command = new(AgentCommand)|' command/agent_test.go
	gsed -i -e 's|exec.AgentCommand|exec.Command|' command/agent_test.go
	gsed -i -e 's|exec.BaseCommand|exec.Command|' command/agent_test.go
	gsed -i -e 's|NewTestAgent|agent.NewTestAgent|' command/agent_test.go
	gsed -i -e 's|= TestConfig|= agent.TestConfig|' command/agent_test.go
	gsed -i -e 's|: RetryJoin|: agent.RetryJoin|' command/agent_test.go

	gsed -i -e 's|\.\./\.\./|../|' command/config_util_test.go

	gsed -i -e 's|\bverifyUniqueListeners|VerifyUniqueListeners|' agent/config{,_test}.go command/agent.go
	gsed -i -e 's|\bserfLANKeyring\b|SerfLANKeyring|g' agent/{agent,keyring,testagent}.go command/agent.go
	gsed -i -e 's|\bserfWANKeyring\b|SerfWANKeyring|g' agent/{agent,keyring,testagent}.go command/agent.go
	gsed -i -e 's|\bNewAgent\b|agent.New|g' command/agent{,_test}.go
	gsed -i -e 's|\bNewAgent|New|' agent/{acl_test,agent,testagent}.go

	gsed -i -e 's|\bAgent\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bBool\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bConfig\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bDefaultConfig\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bDevConfig\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bMergeConfig\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bReadConfigPaths\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bParseMetaPair\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bSerfLANKeyring\b|agent.&|g' command/agent{,_test}.go
	gsed -i -e 's|\bSerfWANKeyring\b|agent.&|g' command/agent{,_test}.go

	gsed -i -e 's|circonus\.agent|circonus|g' command/agent{,_test}.go
	gsed -i -e 's|logger\.agent|logger|g' command/agent{,_test}.go
	gsed -i -e 's|metrics\.agent|metrics|g' command/agent{,_test}.go
	gsed -i -e 's|// agent.Agent|// agent|' command/agent{,_test}.go
	gsed -i -e 's|a\.agent\.Config|a.Config|' command/agent{,_test}.go

	gsed -i -e 's|agent\.AppendSliceValue|AppendSliceValue|' command/{configtest,validate}.go

	gsed -i -e 's|consul/consul|agent/consul|' GNUmakefile

	gsed -i -e 's|\.\./test|../../test|' agent/consul/server_test.go

	# fix imports
	f=$(grep -rl 'github.com/hashicorp/consul/command/agent' * | grep '\.go')
	gsed -i -e 's|github.com/hashicorp/consul/command/agent|github.com/hashicorp/consul/agent|' $f
	goimports -w $f

	f=$(grep -rl 'github.com/hashicorp/consul/consul' * | grep '\.go')
	gsed -i -e 's|github.com/hashicorp/consul/consul|github.com/hashicorp/consul/agent/consul|' $f
	goimports -w $f

	goimports -w command/*.go main.go
)
2017-06-10 18:52:45 +02:00
James Phillips e9ee136baf
Makes test target fail based on return code from go test. 2017-06-02 15:09:07 -07:00
Frank Schroeder 68cac3d40c
Revert "test: run all tests together again"
This reverts commit e48df7b572.
2017-06-02 07:52:21 +02:00
Frank Schroeder e48df7b572
test: run all tests together again
Looks like I have eliminated the troublesome tests for now.
2017-05-31 10:00:10 +02:00
Frank Schroeder 205cbe5fc8
build: update makefile
* capture all output to test.log only and print only failures
* always print output on travis
* test github.com/hashicorp/consul/consul separately until we've
  found the interactions with the other packages during testing.
2017-05-31 00:29:28 +02:00
Frank Schroeder 53fd15070d
build: add target for running tests with race detector 2017-05-31 00:29:25 +02:00
Frank Schroeder 2a39c480b9
test: capture stderr in test.log 2017-05-31 00:29:18 +02:00
Frank Schroeder 9993095448 test: simplify makefile 2017-05-12 22:12:47 +02:00
Frank Schroeder 57622c518a
Add make target for linux binary 2017-05-04 13:31:56 +02:00
James Phillips f37303401a Merge pull request #2987 from sean-/b-fix-dev-paths
Fix `make dev` when the `bin/` directory doesn't exist.
2017-04-28 16:44:25 -07:00
Sean Chittenden 047576148e
Fix `make dev` when the `bin/` directory doesn't exist.
Without this patch you end up with a nifty consul build named `bin`,
not `bin/consul`.
2017-04-28 16:40:50 -07:00
Frank Schroeder 3cc7a55a9a
build: Use bash for building 2017-04-27 11:49:43 -07:00
Frank Schroeder 76b9e257e3
build: Do not swallow go test exit code 2017-04-27 11:17:58 -07:00
Frank Schroeder 9c632e4eb7 build: Simplify make test and log output 2017-04-27 10:34:30 -07:00
Frank Schröder b6ae9f187c Faster dev builds (#2924)
This patch runs 'go install' instead of gox which runs 'go build' for
'make dev' and copies the binary into ./bin and ./pkg/${GOOS}_${GOARCH}
to mimick the previous behavior. This reduces the roundtrip times
for a dev build from 11 sec to 500ms if there weren't any changes.
2017-04-18 15:03:51 -07:00
Seth Vargo 0a04d23f50
Modernize makefile a bit 2017-03-23 20:29:32 -04:00
Sean Chittenden 35fd064a79
Revert `97904cec95f1a1fafd18405f0dd143eb63d595a9` 2017-02-01 16:32:30 -08:00
Sean Chittenden 97904cec95
Catch cross-compiliation build failures at Travis. 2017-02-01 10:22:27 -08:00
James Phillips bc47511d26
Runs the static asset packaging inside the container; updates assets. 2016-11-08 15:14:08 -08:00
James Phillips 9f2c965a63
Makes vendor pattern more generic. 2016-11-02 17:33:56 -07:00
James Phillips 2a950f3897 Adds basic build tag support with different versions. (#2463) 2016-11-02 17:27:49 -07:00
James Phillips 1468930c93 Adds a UI build in a Docker container. (#2462) 2016-11-02 15:53:02 -07:00
James Phillips 5a06d5eefc
Only builds the binary stuff under master branch CI. 2016-10-25 13:49:57 -07:00
Sean Chittenden 3fc714b9b6 Add `tools/cmd/cover` to GOTOOLS 2016-05-07 13:02:12 -07:00
Sean Chittenden e59509227c golang.org/x/tools/cmd/vet is obsolete after Go1.5
`go tool vet` is builtin starting with Go 1.5
2016-05-07 13:01:07 -07:00
James Phillips 3f7bd5dec2 Tweaks some of the default makefile targets. 2016-02-17 20:36:48 -08:00
James Phillips baef89a8f6 Removes from cruft from the makefile. 2016-02-17 20:30:06 -08:00
James Phillips 6643c94b11 Makes vet check more sure fire now that it's xargs-ed. 2016-02-17 16:02:42 -08:00
Sean Chittenden 0c8b66ddca Don't run `go vet` on vendor/ 2016-02-12 18:52:40 -08:00
Sean Chittenden 1071bc271a Add a tools target that fetches various build-time tools 2016-02-12 17:09:18 -08:00
Sean Chittenden 25b09713b9 Manage dependencies via Godep
Embrace the future and use Go 1.6's vendor support via Godep.

Go 1.5 users should `export GO15VENDOREXPERIMENT=1`
2016-02-12 16:50:37 -08:00
Sean Chittenden 71d02d2a32 Acknowledge that we're using GNU make's dialect and rename appropriate
Makefiles to GNUmakefiles so that non-GNU make(1) will error out.  This
should be a transparent change to the universe of people using GNU make.
2016-02-05 14:24:26 -08:00