diff --git a/GNUmakefile b/GNUmakefile index 5c2266d9a..e221a89da 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -215,18 +215,18 @@ dev: vendorfmt changelogfmt ## Build for the current development platform @rm -f $(GOPATH)/bin/nomad @$(MAKE) --no-print-directory \ $(DEV_TARGET) \ - GO_TAGS="nomad_test $(NOMAD_UI_TAG)" + GO_TAGS="$(NOMAD_UI_TAG)" @mkdir -p $(PROJECT_ROOT)/bin @mkdir -p $(GOPATH)/bin @cp $(PROJECT_ROOT)/$(DEV_TARGET) $(PROJECT_ROOT)/bin/ @cp $(PROJECT_ROOT)/$(DEV_TARGET) $(GOPATH)/bin .PHONY: prerelease -prerelease: GO_TAGS=ui +prerelease: GO_TAGS=ui release prerelease: check generate ember-dist static-assets ## Generate all the static assets for a Nomad release .PHONY: release -release: GO_TAGS=ui +release: GO_TAGS=ui release release: clean $(foreach t,$(ALL_TARGETS),pkg/$(t).zip) ## Build all release packages which can be built on this platform. @echo "==> Results:" @tree --dirsfirst $(PROJECT_ROOT)/pkg @@ -247,7 +247,7 @@ test-nomad: dev ## Run Nomad test suites go test $(if $(VERBOSE),-v) \ -cover \ -timeout=900s \ - -tags="nomad_test $(if $(HAS_LXC),lxc)" ./... $(if $(VERBOSE), >test.log ; echo $$? > exit-code) + -tags="$(if $(HAS_LXC),lxc)" ./... $(if $(VERBOSE), >test.log ; echo $$? > exit-code) @if [ $(VERBOSE) ] ; then \ bash -C "$(PROJECT_ROOT)/scripts/test_check.sh" ; \ fi diff --git a/appveyor.yml b/appveyor.yml index d37d7c0ac..a6ae2926d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,7 +21,7 @@ install: - ps: Expand-Archive C:\gopath\bin\vault.zip -DestinationPath C:\gopath\bin - ps: appveyor DownloadFile "https://releases.hashicorp.com/consul/0.7.0/consul_0.7.0_windows_amd64.zip" -FileName "C:\\gopath\\bin\\consul.zip" - ps: Expand-Archive C:\gopath\bin\consul.zip -DestinationPath C:\gopath\bin - #- cmd: go install -tags nomad_test + #- cmd: go install build_script: - #- cmd: go test -tags nomad_test ./... - - cmd: go install -tags nomad_test + #- cmd: go test ./... + - cmd: go install diff --git a/client/client_test.go b/client/client_test.go index 828dfdab7..7f86b70ba 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -138,6 +138,7 @@ func TestClient_RPC_Passthrough(t *testing.T) { func TestClient_Fingerprint(t *testing.T) { t.Parallel() + c := TestClient(t, nil) defer c.Shutdown() @@ -157,11 +158,8 @@ func TestClient_Fingerprint(t *testing.T) { } func TestClient_Fingerprint_Periodic(t *testing.T) { - driver.CheckForMockDriver(t) t.Parallel() - // these constants are only defined when nomad_test is enabled, so these fail - // our linter without explicit disabling. c1 := TestClient(t, func(c *config.Config) { c.Options = map[string]string{ driver.ShutdownPeriodicAfter: "true", diff --git a/client/driver/mock_driver_testing.go b/client/driver/mock_driver_testing.go index 8a712205e..ac3dda3fb 100644 --- a/client/driver/mock_driver_testing.go +++ b/client/driver/mock_driver_testing.go @@ -1,4 +1,4 @@ -// +build nomad_test +// +build !release package driver diff --git a/client/driver/testing.go b/client/driver/testing.go deleted file mode 100644 index 11ea3957b..000000000 --- a/client/driver/testing.go +++ /dev/null @@ -1,13 +0,0 @@ -package driver - -import ( - "testing" -) - -// CheckForMockDriver is a test helper that ensures the mock driver is enabled. -// If not, it skips the current test. -func CheckForMockDriver(t *testing.T) { - if _, ok := BuiltinDrivers["mock_driver"]; !ok { - t.Skip(`test requires mock_driver; run with "-tags nomad_test"`) - } -} diff --git a/client/fingerprint_manager_test.go b/client/fingerprint_manager_test.go index b2cca2bc9..1a8ccd9b3 100644 --- a/client/fingerprint_manager_test.go +++ b/client/fingerprint_manager_test.go @@ -7,13 +7,11 @@ import ( "testing" "github.com/hashicorp/nomad/client/config" - "github.com/hashicorp/nomad/client/driver" "github.com/hashicorp/nomad/testutil" "github.com/stretchr/testify/require" ) func TestFingerprintManager_Run_MockDriver(t *testing.T) { - driver.CheckForMockDriver(t) t.Parallel() require := require.New(t) testClient := TestClient(t, nil) @@ -42,7 +40,6 @@ func TestFingerprintManager_Run_MockDriver(t *testing.T) { func TestFingerprintManager_Run_ResourcesFingerprint(t *testing.T) { t.Parallel() - driver.CheckForMockDriver(t) require := require.New(t) testClient := TestClient(t, nil) @@ -98,7 +95,6 @@ func TestFingerprintManager_Fingerprint_Run(t *testing.T) { func TestFingerprintManager_Fingerprint_Periodic(t *testing.T) { t.Parallel() require := require.New(t) - driver.CheckForMockDriver(t) testClient := TestClient(t, func(c *config.Config) { c.Options = map[string]string{ "test.shutdown_periodic_after": "true", diff --git a/command/agent/consul/int_test.go b/command/agent/consul/int_test.go index 77d052cff..ab4d7ec43 100644 --- a/command/agent/consul/int_test.go +++ b/command/agent/consul/int_test.go @@ -14,7 +14,6 @@ import ( "github.com/hashicorp/nomad/client" "github.com/hashicorp/nomad/client/allocdir" "github.com/hashicorp/nomad/client/config" - "github.com/hashicorp/nomad/client/driver" "github.com/hashicorp/nomad/client/vaultclient" "github.com/hashicorp/nomad/command/agent/consul" "github.com/hashicorp/nomad/nomad/mock" @@ -32,9 +31,6 @@ func testLogger() *log.Logger { // TestConsul_Integration asserts TaskRunner properly registers and deregisters // services and checks with Consul using an embedded Consul agent. func TestConsul_Integration(t *testing.T) { - if _, ok := driver.BuiltinDrivers["mock_driver"]; !ok { - t.Skip(`test requires mock_driver; run with "-tags nomad_test"`) - } if testing.Short() { t.Skip("-short set; skipping") } diff --git a/testutil/server.go b/testutil/server.go index d070e8d31..f455140b4 100644 --- a/testutil/server.go +++ b/testutil/server.go @@ -145,7 +145,7 @@ func NewTestServer(t testing.T, cb ServerConfigCallback) *TestServer { vcmd.Stdout = nil vcmd.Stderr = nil if err := vcmd.Run(); err != nil { - t.Skipf("nomad version failed. Did you run your test with -tags nomad_test (%v)", err) + t.Skipf("nomad version failed: %v", err) } dataDir, err := ioutil.TempDir("", "nomad")