Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
858140d5
Commit
858140d5
authored
Aug 08, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve support for standard Go tools
parent
f184885d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
+19
-9
Makefile
Makefile
+3
-9
_support/fake-auth-backend.go
_support/fake-auth-backend.go
+0
-0
_support/path
_support/path
+0
-0
main_test.go
main_test.go
+16
-0
No files found.
Makefile
View file @
858140d5
...
...
@@ -25,12 +25,12 @@ _build:
touch
$@
.PHONY
:
test
test
:
testdata/data/group/test.git
clean-build clean-workhorse all
test
:
clean-build clean-workhorse all
go
fmt
${PKG}
/... |
awk
'{ print } END { if (NR > 0) { print "Please run go fmt"; exit 1 } }'
support/path go
test
${PKG}
/...
_
support/path go
test
${PKG}
/...
@
echo
SUCCESS
coverage
:
testdata/data/group/test.git
coverage
:
go
test
-cover
-coverprofile
=
test.coverage
go tool cover
-html
=
test.coverage
-o
coverage.html
rm
-f
test.coverage
...
...
@@ -38,12 +38,6 @@ coverage: testdata/data/group/test.git
fmt
:
go
fmt
./...
testdata/data/group/test.git
:
testdata/data
git clone
--bare
https://gitlab.com/gitlab-org/gitlab-test.git
$@
testdata/data
:
mkdir
-p
$@
.PHONY
:
clean
clean
:
clean-workhorse clean-build
rm
-rf
testdata/data testdata/scratch
...
...
support/fake-auth-backend.go
→
_
support/fake-auth-backend.go
View file @
858140d5
File moved
support/path
→
_
support/path
View file @
858140d5
File moved
main_test.go
View file @
858140d5
...
...
@@ -34,6 +34,22 @@ const testProject = "group/test"
var
checkoutDir
=
path
.
Join
(
scratchDir
,
"test"
)
var
cacheDir
=
path
.
Join
(
scratchDir
,
"cache"
)
func
TestMain
(
m
*
testing
.
M
)
{
source
:=
"https://gitlab.com/gitlab-org/gitlab-test.git"
clonePath
:=
path
.
Join
(
testRepoRoot
,
testRepo
)
if
_
,
err
:=
os
.
Stat
(
clonePath
);
err
!=
nil
{
testCmd
:=
exec
.
Command
(
"git"
,
"clone"
,
"--bare"
,
source
,
clonePath
)
testCmd
.
Stdout
=
os
.
Stdout
testCmd
.
Stderr
=
os
.
Stderr
if
err
:=
testCmd
.
Run
();
err
!=
nil
{
os
.
Exit
(
-
1
)
}
}
os
.
Exit
(
m
.
Run
())
}
func
TestAllowedClone
(
t
*
testing
.
T
)
{
// Prepare clone directory
if
err
:=
os
.
RemoveAll
(
scratchDir
);
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment