Commit 61e4d00c authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use the standard Go testdata directory

parent 8b39e1f4
test/data
test/scratch
gitlab-workhorse gitlab-workhorse
testdata/data
testdata/scratch
...@@ -8,25 +8,24 @@ install: gitlab-workhorse ...@@ -8,25 +8,24 @@ install: gitlab-workhorse
install gitlab-workhorse ${PREFIX}/bin/ install gitlab-workhorse ${PREFIX}/bin/
.PHONY: test .PHONY: test
test: test/data/group/test.git clean-workhorse gitlab-workhorse test: testdata/data/group/test.git clean-workhorse gitlab-workhorse
go fmt . ./internal/... | awk '{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }' go fmt ./... | awk '{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
go test ./internal/... go test ./...
go test
coverage: test/data/group/test.git coverage: testdata/data/group/test.git
go test -cover -coverprofile=test.coverage go test -cover -coverprofile=test.coverage
go tool cover -html=test.coverage -o coverage.html go tool cover -html=test.coverage -o coverage.html
rm -f test.coverage rm -f test.coverage
test/data/group/test.git: test/data testdata/data/group/test.git: testdata/data
git clone --bare https://gitlab.com/gitlab-org/gitlab-test.git test/data/group/test.git git clone --bare https://gitlab.com/gitlab-org/gitlab-test.git $@
test/data: testdata/data:
mkdir -p test/data mkdir -p $@
.PHONY: clean .PHONY: clean
clean: clean-workhorse clean: clean-workhorse
rm -rf test/data test/scratch rm -rf testdata/data testdata/scratch
.PHONY: clean-workhorse .PHONY: clean-workhorse
clean-workhorse: clean-workhorse:
......
...@@ -19,8 +19,8 @@ import ( ...@@ -19,8 +19,8 @@ import (
"time" "time"
) )
const scratchDir = "test/scratch" const scratchDir = "testdata/scratch"
const testRepoRoot = "test/data" const testRepoRoot = "testdata/data"
const testRepo = "group/test.git" const testRepo = "group/test.git"
const testProject = "group/test" const testProject = "group/test"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment