mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
test(pr): follow the pr changes in the Gitea lifecycle test and polish flag help
The disposable-Gitea lifecycle test expects pr checkout to name the branch after the head branch and to fetch quietly, and ✓ feedback only on terminals. The review flags name their file and commit values, and pr edit gets a short Short with the editable fields in its Long text. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
3 files changed
+8
-7
No files matched your search
@@ -147,8 +147,8 @@ func TestGiteaPullEditLifecycle(t *testing.T) {
|
||||
diagnostics.Reset()
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"pr", "checkout", n, "-R", repo.FullName, "--cwd", workingTree, "--no-input", "--json"}))
|
||||
require.NoError(t, json.Unmarshal(out.Bytes(), &checkout))
|
||||
require.Contains(t, diagnostics.String(), "FETCH_HEAD")
|
||||
require.Equal(t, "pr/"+n, checkout.Branch)
|
||||
require.Empty(t, diagnostics.String(), "checkout fetches quietly")
|
||||
require.Equal(t, "feature", checkout.Branch, "the local branch takes the head branch name")
|
||||
require.Equal(t, head.Head.SHA, checkout.Commit)
|
||||
actual, err := runner.Output(context.Background(), workingTree, false, "rev-parse", "HEAD")
|
||||
require.NoError(t, err)
|
||||
@@ -233,7 +233,7 @@ func TestGiteaPullEditLifecycle(t *testing.T) {
|
||||
diagnostics.Reset()
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"pr", "review", "resolve", commentID, "-R", repo.FullName}))
|
||||
require.Empty(t, out.String())
|
||||
require.Contains(t, diagnostics.String(), "resolved")
|
||||
require.Empty(t, diagnostics.String(), "feedback is for terminals")
|
||||
require.NoError(t, json.Unmarshal(execute("pr", "review", "comments", n, "-R", repo.FullName, "--review", fmt.Sprint(review.ID), "--json"), &comments))
|
||||
require.NotEmpty(t, comments[0].Resolver)
|
||||
out.Reset()
|
||||
@@ -254,7 +254,7 @@ func TestGiteaPullEditLifecycle(t *testing.T) {
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"pr", "review", "delete", n, fmt.Sprint(submitted.ID), "-R", repo.FullName, "--yes"}))
|
||||
verifyEditorSubmission(t, deps, repo.FullName, n, true)
|
||||
require.Empty(t, out.String())
|
||||
require.Contains(t, diagnostics.String(), "Deleted review")
|
||||
require.Empty(t, diagnostics.String(), "feedback is for terminals")
|
||||
if reviewerTokenFile := os.Getenv("GITEA_TEA_TEST_REVIEWER_TOKEN_FILE"); reviewerTokenFile != "" {
|
||||
reviewerDeps := deps
|
||||
reviewerDeps.Getenv = gitea.env(readTokenFile(t, reviewerTokenFile))
|
||||
|
||||
Reference in new issue
Block a user