mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-30 06:35:59 +00:00
fix: ignore existence of commits for force pushes (#9262)
- Because we wish to show the status of the old and new commit of a force push, ignore that the commit doesn't exist and return a commit with only its ID filled. This is enough to still show the CI status of this commit although the commit itself is no longer reachable. - Add unit test. - Add integration test. - Resolves forgejo/forgejo#9250 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9262 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
60cab1bafd
commit
b816bf9232
6 changed files with 81 additions and 5 deletions
|
@ -58,6 +58,12 @@ func TestActionsForcePushCommitStatus(t *testing.T) {
|
|||
req := NewRequest(t, "GET", "/user2/commitsonpr/pulls/1")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
htmlDoc.AssertElement(t, ".forced-push [data-tippy='commit-statuses']:nth-of-type(3) svg.commit-status.octicon-dot-fill", true)
|
||||
htmlDoc.AssertElement(t, ".forced-push [data-tippy='commit-statuses']:nth-of-type(5) svg.commit-status.octicon-check", true)
|
||||
|
||||
htmlDoc.AssertElement(t, ".error-code", false)
|
||||
|
||||
htmlDoc.AssertElement(t, "#issuecomment-17 .forced-push [data-tippy='commit-statuses']:nth-of-type(3) svg.commit-status.octicon-dot-fill", true)
|
||||
htmlDoc.AssertElement(t, "#issuecomment-17 .forced-push [data-tippy='commit-statuses']:nth-of-type(5) svg.commit-status.octicon-check", true)
|
||||
|
||||
htmlDoc.AssertElement(t, "#issuecomment-1001 .forced-push [data-tippy='commit-statuses']:nth-of-type(3) svg.commit-status.octicon-check", true)
|
||||
htmlDoc.AssertElement(t, "#issuecomment-1001 .forced-push [data-tippy='commit-statuses']:nth-of-type(5) svg.commit-status.octicon-check", true)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue