-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add git clone test on integration test #1682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add git clone test on integration test #1682
Conversation
LGTM |
But |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what this test is actually accomplishes. This test doesn't cover any Gitea-related code. It seems to be testing gopkg.in/src-d/go-git.v4
more than anything else.
integrations/git_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just do assert.False(t, empty)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@ethantkoenig, this test will test git Smart HTTP pull routes in Gitea. You can find them in https://github.com/go-gitea/gitea/blob/master/routers/repo/http.go#L47 |
Maybe we could require Go version >= go1.8 since we used |
integrations/git_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use a temporary Port? using s.URL
to get the result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea. I will try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkcsoft It seems there is no s.URL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's how that's done: https://gist.github.com/xcsrz/538e291d12be6ee9a8c7#file-server-go-L13-L19
Not sure if this one is still active. Why are we importing |
@bkcsoft via src-d/go-git we will reduce |
@lunny In that case we should use But if you want a proper end-to-end test you really need to run |
@bkcsoft reasonable! I will change this PR. |
aa9f4c4
to
86a0fb8
Compare
86a0fb8
to
6d1f86b
Compare
@bkcsoft done and rebased. |
Codecov Report
@@ Coverage Diff @@
## master #1682 +/- ##
=======================================
Coverage 26.84% 26.84%
=======================================
Files 89 89
Lines 17608 17608
=======================================
Hits 4727 4727
Misses 12195 12195
Partials 686 686 Continue to review full report at Codecov.
|
integrations/git_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use this? https://golang.org/pkg/io/ioutil/#TempDir
That way we don't get collisions if ran concurrently.
integrations/git_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs both (remove before clone - just in case it exists and defer to delete it also after)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not if we use ioutil.TempDir()
:)
6d1f86b
to
49d62e0
Compare
@bkcsoft done. |
@lunny Mind having a look at the listen port again? It should be fairly straight forward :) |
LGTM |
9d6efb5
to
75b6172
Compare
@bkcsoft listen port has been changed to random. |
Add git clone test on integration test and in this PR I used
github.com/src-d/go-git
but it seems it don't supportgit push
.