mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(pr,time,release): closed PRs for checkout and edit, dismiss state check first, worktree-aware checkout errors, exact piped durations (follow gh)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
11 files changed
+131
-23
No files matched your search
@@ -4,6 +4,7 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
@@ -97,11 +98,15 @@ func TestPullCommandsFindClosedPullsByBranch(t *testing.T) {
|
||||
name string
|
||||
args []string
|
||||
err string
|
||||
// request is the request that proves the closed pull request was found.
|
||||
request string
|
||||
}{
|
||||
{"view", []string{"pr", "view", "alice:gone", "--json=number"}, ""},
|
||||
{"checks", []string{"pr", "checks", "alice:gone", "--web", "--no-input"}, ""},
|
||||
{"reopen", []string{"pr", "reopen", "alice:gone"}, "already merged"},
|
||||
{"clean", []string{"pr", "clean", "alice:gone", "--no-input"}, ""},
|
||||
{"view", []string{"pr", "view", "alice:gone", "--json=number"}, "", ""},
|
||||
{"checks", []string{"pr", "checks", "alice:gone", "--web", "--no-input"}, "", ""},
|
||||
{"reopen", []string{"pr", "reopen", "alice:gone"}, "already merged", ""},
|
||||
{"clean", []string{"pr", "clean", "alice:gone", "--no-input"}, "", ""},
|
||||
{"edit", []string{"pr", "edit", "alice:gone", "--title", "New"}, "", "PATCH /api/v1/repos/alice/project/pulls/31?state="},
|
||||
{"checkout", []string{"pr", "checkout", "alice:gone", "--detach"}, "missing fake", "GET /api/v1/repos/alice/project/pulls?state=closed"},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
var requests []string
|
||||
@@ -116,7 +121,8 @@ func TestPullCommandsFindClosedPullsByBranch(t *testing.T) {
|
||||
if err != nil {
|
||||
require.NotContains(t, err.Error(), "no open pull request")
|
||||
}
|
||||
require.Contains(t, requests, "GET /api/v1/repos/alice/project/pulls/31?state=", "err: %v", err)
|
||||
request := cmp.Or(tc.request, "GET /api/v1/repos/alice/project/pulls/31?state=")
|
||||
require.Contains(t, requests, request, "err: %v", err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user