diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-10-16 13:42:39 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-10-16 13:42:39 +0300 |
commit | c1aa5d38391d8092ca852bc3486397b3181a8741 (patch) | |
tree | e56ead0a3fb9ae69fc62653db1f5c7119566ca46 | |
parent | 2ea8b8e0ff063151c0255db3577a25e854cae4d7 (diff) |
Delete test repos during 'make clean'
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | _support/makegen.go | 10 |
2 files changed, 8 insertions, 5 deletions
@@ -15,6 +15,7 @@ MAKEGEN = $(BUILD_DIR)/makegen # These variables are handed down to make in _build export GOPATH := $(CURDIR)/$(BUILD_DIR) export PATH := $(PATH):$(GOPATH)/bin +export TEST_REPO_STORAGE_PATH := $(CURDIR)/internal/testhelper/testdata/data all: build @@ -82,4 +83,4 @@ _build/makegen: _support/makegen.go $(BUILD_DIR)/.ok go build -o $@ _support/makegen.go clean: - rm -rf $(BUILD_DIR) .ruby-bundle + rm -rf $(BUILD_DIR) .ruby-bundle $(TEST_REPO_STORAGE_PATH) diff --git a/_support/makegen.go b/_support/makegen.go index d4f07ca4b..e5f8b5ca0 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -81,7 +81,12 @@ func (gm *gitalyMake) CoverageDir() string { return filepath.Join(gm.BuildDir(), func (gm *gitalyMake) SourceDir() string { return filepath.Join(gm.BuildDir(), "src", gm.Pkg()) } func (gm *gitalyMake) TestRepoStoragePath() string { - return filepath.Join(gm.SourceDir(), "internal/testhelper/testdata/data") + path := os.Getenv("TEST_REPO_STORAGE_PATH") + if len(path) == 0 { + log.Fatal("TEST_REPO_STORAGE_PATH is not set") + } + + return path } func (gm *gitalyMake) TestRepo() string { @@ -223,9 +228,6 @@ INSTALL_DEST_DIR := $(DESTDIR)$(PREFIX)/bin/ BUNDLE_FLAGS ?= --deployment ASSEMBLY_ROOT ?= {{ .BuildDir }}/assembly -# We need to export this path down to Gitaly's test code -export TEST_REPO_STORAGE_PATH := {{ .TestRepoStoragePath }} - unexport GOROOT unexport GOBIN |