浏览代码

Use a small size repo for migrate test (#12300)

Signed-off-by: a101211279 <1012112796@qq.com>
tags/v1.13.0-rc1
赵智超 3 年前
父节点
当前提交
7744b36e56
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 6
    6
      integrations/api_repo_test.go
  2. 1
    1
      integrations/repo_migrate_test.go

+ 6
- 6
integrations/api_repo_test.go 查看文件

@@ -304,11 +304,11 @@ func TestAPIRepoMigrate(t *testing.T) {
cloneURL, repoName string
expectedStatus int
}{
{ctxUserID: 1, userID: 2, cloneURL: "https://github.com/go-gitea/git.git", repoName: "git-admin", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 2, cloneURL: "https://github.com/go-gitea/git.git", repoName: "git-own", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 1, cloneURL: "https://github.com/go-gitea/git.git", repoName: "git-bad", expectedStatus: http.StatusForbidden},
{ctxUserID: 2, userID: 3, cloneURL: "https://github.com/go-gitea/git.git", repoName: "git-org", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 6, cloneURL: "https://github.com/go-gitea/git.git", repoName: "git-bad-org", expectedStatus: http.StatusForbidden},
{ctxUserID: 1, userID: 2, cloneURL: "https://github.com/go-gitea/test_repo.git", repoName: "git-admin", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 2, cloneURL: "https://github.com/go-gitea/test_repo.git", repoName: "git-own", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 1, cloneURL: "https://github.com/go-gitea/test_repo.git", repoName: "git-bad", expectedStatus: http.StatusForbidden},
{ctxUserID: 2, userID: 3, cloneURL: "https://github.com/go-gitea/test_repo.git", repoName: "git-org", expectedStatus: http.StatusCreated},
{ctxUserID: 2, userID: 6, cloneURL: "https://github.com/go-gitea/test_repo.git", repoName: "git-bad-org", expectedStatus: http.StatusForbidden},
}

defer prepareTestEnv(t)()
@@ -348,7 +348,7 @@ func testAPIRepoMigrateConflict(t *testing.T, u *url.URL) {
assert.NoError(t, err)
userID := user.ID

cloneURL := "https://github.com/go-gitea/git.git"
cloneURL := "https://github.com/go-gitea/test_repo.git"

req := NewRequestWithJSON(t, "POST", "/api/v1/repos/migrate?token="+httpContext.Token,
&api.MigrateRepoOption{

+ 1
- 1
integrations/repo_migrate_test.go 查看文件

@@ -38,5 +38,5 @@ func testRepoMigrate(t testing.TB, session *TestSession, cloneAddr, repoName str
func TestRepoMigrate(t *testing.T) {
defer prepareTestEnv(t)()
session := loginUser(t, "user2")
testRepoMigrate(t, session, "https://github.com/go-gitea/git.git", "git")
testRepoMigrate(t, session, "https://github.com/go-gitea/test_repo.git", "git")
}

正在加载...
取消
保存