exclude integration tests from main build

This commit is contained in:
Chelsea Holland Komlo
2017-10-25 15:56:42 -04:00
parent aa410d0530
commit f4e466f54b
2 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
CURRENT_DIRECTORY=`pwd`
docker run --privileged -v $CURRENT_DIRECTORY:/gopkg/src/github.com/hashicorp/nomad -it nomad-e2e /bin/bash -c "cd gopkg/src/github.com/hashicorp/nomad/e2e/migrations && go test"
docker run --privileged -v \
$CURRENT_DIRECTORY:/gopkg/src/github.com/hashicorp/nomad \
-it nomad-e2e /bin/bash \
-c "cd gopkg/src/github.com/hashicorp/nomad/e2e/migrations && go test -integration"

View File

@@ -2,6 +2,7 @@ package e2e
import (
"bytes"
"flag"
"io/ioutil"
"os"
"os/exec"
@@ -12,6 +13,8 @@ import (
"github.com/stretchr/testify/assert"
)
var integration = flag.Bool("integration", false, "run integration tests")
const sleepJobOne = `job "sleep" {
type = "batch"
datacenters = ["dc1"]
@@ -139,6 +142,11 @@ func startCluster(clusterConfig []string) (func(), error) {
}
func TestJobMigrations(t *testing.T) {
flag.Parse()
if !*integration {
t.Skip("skipping test in non-integration mode.")
}
t.Parallel()
assert := assert.New(t)