integration test
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
testing / backend-checks (pull_request) Has been cancelled
testing / frontend-checks (pull_request) Has been cancelled
testing / test-unit (pull_request) Has been cancelled
testing / test-e2e (pull_request) Has been cancelled
testing / test-remote-cacher (map[image:docker.io/bitnami/redis:7.2 port:6379]) (pull_request) Has been cancelled
testing / test-remote-cacher (map[image:docker.io/bitnami/valkey:7.2 port:6379]) (pull_request) Has been cancelled
testing / test-remote-cacher (map[image:ghcr.io/microsoft/garnet-alpine:1.0.14 port:6379]) (pull_request) Has been cancelled
testing / test-remote-cacher (map[image:registry.redict.io/redict:7.3.0-scratch port:6379]) (pull_request) Has been cancelled
testing / test-mysql (pull_request) Has been cancelled
testing / test-pgsql (pull_request) Has been cancelled
testing / test-sqlite (pull_request) Has been cancelled
testing / security-check (pull_request) Has been cancelled
ci/woodpecker/push/build Pipeline failed
/ release-notes (pull_request_target) Has been cancelled

This commit is contained in:
Tom Neuber 2024-10-28 00:42:38 +01:00
parent f62aae159f
commit 9ea8aaab1b
Signed by: tom
GPG key ID: F17EFE4272D89FF6
2 changed files with 1285 additions and 21 deletions

File diff suppressed because it is too large Load diff

View file

@ -857,11 +857,10 @@ func testPullAutoMergeAfterCommitStatusSucceed(t *testing.T, forkName string, ap
if deleteBranch { if deleteBranch {
branchName = "new_branch_1" branchName = "new_branch_1"
testEditFileToNewBranch(t, session, "user1", forkName, "master", branchName, "README.md", "Hello, World (Edited)\n") testEditFileToNewBranch(t, session, "user1", forkName, "master", branchName, "README.md", "Hello, World (Edited)\n")
testPullCreate(t, session, "user1", forkName, false, "master", branchName, "Indexer notifier test pull")
} else { } else {
testEditFile(t, session, "user1", forkName, "master", "README.md", "Hello, World (Edited)\n") testEditFile(t, session, "user1", forkName, "master", "README.md", "Hello, World (Edited)\n")
testPullCreate(t, session, "user1", forkName, false, "master", branchName, "Indexer notifier test pull")
} }
testPullCreate(t, session, "user1", forkName, false, "master", branchName, "Indexer notifier test pull")
baseRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user2", Name: "repo1"}) baseRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user2", Name: "repo1"})
forkedRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user1", Name: forkName}) forkedRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user1", Name: forkName})
@ -876,24 +875,16 @@ func testPullAutoMergeAfterCommitStatusSucceed(t *testing.T, forkName string, ap
csrf := GetCSRF(t, session, "/user2/repo1/settings/branches") csrf := GetCSRF(t, session, "/user2/repo1/settings/branches")
// Change master branch to protected // Change master branch to protected
var reqParams map[string]string reqParams := map[string]string{
"_csrf": csrf,
"rule_name": "master",
"enable_push": "true",
"enable_status_check": "true",
"status_check_contexts": "gitea/actions",
"required_approvals": "0",
}
if approval { if approval {
reqParams = map[string]string{ reqParams["status_check_contexts"] = "1"
"_csrf": csrf,
"rule_name": "master",
"enable_push": "true",
"enable_status_check": "true",
"status_check_contexts": "gitea/actions",
"required_approvals": "1",
}
} else {
reqParams = map[string]string{
"_csrf": csrf,
"rule_name": "master",
"enable_push": "true",
"enable_status_check": "true",
"status_check_contexts": "gitea/actions",
}
} }
req := NewRequestWithValues(t, "POST", "/user2/repo1/settings/branches/edit", reqParams) req := NewRequestWithValues(t, "POST", "/user2/repo1/settings/branches/edit", reqParams)
@ -1003,13 +994,13 @@ func TestPullAutoMergeAfterCommitStatusSucceed(t *testing.T) {
}, },
{ {
name: "TestPullAutoMergeAfterCommitStatusSucceedAndApproval", name: "TestPullAutoMergeAfterCommitStatusSucceedAndApproval",
forkName: "repo2-1", forkName: "repo1-3",
approval: true, approval: true,
deleteBranch: false, deleteBranch: false,
}, },
{ {
name: "TestPullAutoMergeAfterCommitStatusSucceedAndApprovalWithBranchDeletion", name: "TestPullAutoMergeAfterCommitStatusSucceedAndApprovalWithBranchDeletion",
forkName: "repo2-2", forkName: "repo1-4",
approval: true, approval: true,
deleteBranch: true, deleteBranch: true,
}, },