diff --git a/Makefile b/Makefile index b16d4ef47..156b4d284 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ RELEASE_TMP_DIR = $(CURDIR)/.release RELEASES_OUT_DIR = $(CURDIR)/.releases ZIP ?= 0 -all: install test lint vet +all: install test lint vet integration-tests install: @echo Building version: $(BUILD_INFO) / $(BUILD_VERSION) @@ -80,6 +80,10 @@ test: install vtest: go test -v -timeout 30s github.com/kopia/kopia/... +integration-tests: + go build -o $(RELEASE_TMP_DIR)/integration/kopia -ldflags $(LDARGS) github.com/kopia/kopia + KOPIA_EXE=$(RELEASE_TMP_DIR)/integration/kopia go test -timeout 30s github.com/kopia/kopia/tests/... + godoc: godoc -http=:33333 diff --git a/tests/end_to_end_test.go b/tests/end_to_end_test.go index 3757eac66..3994dd179 100644 --- a/tests/end_to_end_test.go +++ b/tests/end_to_end_test.go @@ -88,9 +88,9 @@ func TestRepo(t *testing.T) { e := newTestEnv(t) defer e.cleanup() - e.runAndExpectSuccess(t, "repo", "create", e.repoDir) + e.runAndExpectSuccess(t, "repo", "create", "filesystem", "--path", e.repoDir) e.runAndExpectSuccess(t, "repo", "disconnect") - e.runAndExpectSuccess(t, "repo", "connect", e.repoDir) + e.runAndExpectSuccess(t, "repo", "connect", "filesystem", "--path", e.repoDir) e.runAndExpectSuccess(t, "snapshot", "create", ".") e.runAndExpectSuccess(t, "snapshot", "list", ".") @@ -99,9 +99,11 @@ func TestRepo(t *testing.T) { createDirectory(dir1, 3) e.runAndExpectSuccess(t, "snapshot", "create", dir1) e.runAndExpectSuccess(t, "snapshot", "create", dir1) - createDirectory(dir1, 3) - e.runAndExpectSuccess(t, "snapshot", "create", dir1) - e.runAndExpectSuccess(t, "snapshot", "create", dir1) + + dir2 := filepath.Join(e.dataDir, "dir2") + createDirectory(dir2, 3) + e.runAndExpectSuccess(t, "snapshot", "create", dir2) + e.runAndExpectSuccess(t, "snapshot", "create", dir2) sources := listSnapshotsAndExpectSuccess(t, e) if got, want := len(sources), 3; got != want { t.Errorf("unexpected number of sources: %v, want %v in %#v", got, want, sources) @@ -121,8 +123,7 @@ func (e *testenv) run(t *testing.T, args ...string) ([]string, error) { cmdArgs := append(append([]string(nil), e.fixedArgs...), args...) c := exec.Command(e.exe, cmdArgs...) c.Env = append(os.Environ(), e.environment...) - c.Stderr = os.Stderr - o, err := c.Output() + o, err := c.CombinedOutput() t.Logf("finished 'kopia %v' with err=%v and output:\n%v", strings.Join(args, " "), err, string(o)) return splitLines(string(o)), err }