Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented May 5, 2017

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 support git push.

@lunny lunny added this to the 1.2.0 milestone May 5, 2017
@appleboy
Copy link
Member

appleboy commented May 5, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 5, 2017
@lunny
Copy link
Member Author

lunny commented May 5, 2017

But http.Server.Shutdown need go1.8 so the tests failed.

Copy link
Member

@ethantkoenig ethantkoenig left a 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.

Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@lunny
Copy link
Member Author

lunny commented May 5, 2017

@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

@lunny lunny added the status/blocked This PR cannot be merged yet, i.e. because it depends on another unmerged PR label May 6, 2017
@lunny lunny modified the milestones: 1.3.0, 1.2.0 May 6, 2017
@lunny
Copy link
Member Author

lunny commented May 7, 2017

Maybe we could require Go version >= go1.8 since we used server.Shutdown here.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkcsoft
Copy link
Member

bkcsoft commented Jul 3, 2017

Not sure if this one is still active.

Why are we importing src-d/go-git only for tests? why not use exec.Command and skip some 100+ vendored files ? (here's some inspiration: https://gitlab.com/gitlab-org/gitaly/blob/master/internal/service/ssh/receive_pack_test.go#L109-144 but obviously less Gitaly-specific env-vars 😂 )

@lunny
Copy link
Member Author

lunny commented Jul 4, 2017

@bkcsoft via src-d/go-git we will reduce git command dependencies. At the beginning of Gogs, we want to create a pure Go git library that is go-gitea/git. So if there is pure Go library, I would like to use it. Any idea?

@bkcsoft
Copy link
Member

bkcsoft commented Jul 4, 2017

@lunny In that case we should use src-d/go-git in gitea/git, not here.

But if you want a proper end-to-end test you really need to run git clone/pull/push to see that everything will work correctly for the users 🙂

@lunny
Copy link
Member Author

lunny commented Jul 5, 2017

@bkcsoft reasonable! I will change this PR.

@lunny lunny modified the milestones: 1.3.0, 1.x.x Oct 11, 2017
@lunny lunny force-pushed the lunny/integration_git_clone_test branch from aa9f4c4 to 86a0fb8 Compare November 1, 2017 05:37
@lunny lunny changed the title add git clone test on integration test Add git clone test on integration test Nov 1, 2017
@lunny lunny removed the status/blocked This PR cannot be merged yet, i.e. because it depends on another unmerged PR label Nov 1, 2017
@lunny lunny modified the milestones: 1.x.x, 1.3.0 Nov 1, 2017
@lunny lunny force-pushed the lunny/integration_git_clone_test branch from 86a0fb8 to 6d1f86b Compare November 1, 2017 05:41
@lunny
Copy link
Member Author

lunny commented Nov 1, 2017

@bkcsoft done and rebased.

@codecov-io
Copy link

codecov-io commented Nov 1, 2017

Codecov Report

Merging #1682 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eecaba2...0112f7e. Read the comment docs.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer ?

Copy link
Member

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)

Copy link
Member

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() :)

@lunny lunny force-pushed the lunny/integration_git_clone_test branch from 6d1f86b to 49d62e0 Compare November 1, 2017 15:27
@lunny
Copy link
Member Author

lunny commented Nov 1, 2017

@bkcsoft done.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 1, 2017

@lunny Mind having a look at the listen port again? It should be fairly straight forward :)

@lafriks
Copy link
Member

lafriks commented Nov 2, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 2, 2017
@lunny lunny force-pushed the lunny/integration_git_clone_test branch from 9d6efb5 to 75b6172 Compare November 2, 2017 05:48
@lunny
Copy link
Member Author

lunny commented Nov 2, 2017

@bkcsoft listen port has been changed to random.

@bkcsoft bkcsoft merged commit f70758d into go-gitea:master Nov 2, 2017
@lunny lunny deleted the lunny/integration_git_clone_test branch November 3, 2017 00:43
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants