Add pr-review e2e test and speed up e2e tests#37345
Merged
wxiaoguang merged 9 commits intogo-gitea:mainfrom Apr 24, 2026
Merged
Add pr-review e2e test and speed up e2e tests#37345wxiaoguang merged 9 commits intogo-gitea:mainfrom
wxiaoguang merged 9 commits intogo-gitea:mainfrom
Conversation
Covers the highest-recurrence UI regressions from the last ~500 issues: - pr-merge: default / delete-branch toggle / squash / conflicted - pr-commits: new commit appears on reload - pr-review: top-level / inline reply (go-gitea#35994) / approve / reject / self-review - diff viewer: file-box render + split/unified toggle Also rewrites `login` in `tests/e2e/utils.ts` to use a direct form POST instead of driving the browser UI, which speeds up every existing e2e test that logs in. `events.test.ts` gets an explicit `page.goto('/')` since `login` no longer navigates. New helpers in `utils.ts`: apiCreatePR, apiMergePR, apiCreateReview, branch+file consolidation via `{branch, newBranch}` option on apiCreateFile, optional `message` for deterministic commit summaries. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Keep `login.test.ts::login form and logout` as the sole test that exercises the browser login form (since `utils.ts::login` now uses a direct form POST). Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- Collapse pr-merge/pr-commits/pr-review/diff-viewer to one test each; inline setup helpers. pr-review consolidates reply(go-gitea#35994) + approve into one flow with a mid-test session swap. - Remove apiDeleteRepo/apiDeleteUser calls across 11 pre-existing tests — the e2e server is a per-run mktemp workdir killed on exit, and tests use randomString suffixes, so cleanup was pure overhead. - Repurpose login.test.ts "login form and logout" to drive the browser login UI (utils.ts::login is now a direct form POST, no UI coverage). - Drop MergeStyle/ReviewEvent type aliases and the now-unused apiMergePR helper; inline plain string on apiCreateReview's event param. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- events.test.ts::stopwatch: move loginUser into Promise.all with the
repo/issue/stopwatch chain
- file-view-render.test.ts::asciicast: replace apiCreateFile+apiCreateBranch
with a single apiCreateFile({newBranch}) — Gitea's file API creates the
first commit on the specified branch when the repo is empty
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Drop diff-viewer, pr-commits, pr-merge test files. Fold their assertions into the single pr-review flow that already loads /files: - diff-file-box header + add-code row (was diff-viewer) - Commits tab badge count (was pr-commits) - .diff-detail-stats changed-file count (was diff-viewer) The reply-to-inline-comment (go-gitea#35994) and approve paths were the highest-value; the dropped tests were cheap to fold in since /files already rendered. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
- apiCreateFile: base64-encode via Buffer UTF-8 instead of btoa to
avoid Latin-1 range errors on non-ASCII content
- apiCreateReview: make options object optional (= {}); drop unused
return value
Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
lunny
approved these changes
Apr 24, 2026
bircni
approved these changes
Apr 24, 2026
Contributor
|
Tests are still flaky https://github.com/go-gitea/gitea/actions/runs/24878089698/attempts/1 |
silverwind
added a commit
to mohammad-rj/gitea
that referenced
this pull request
Apr 24, 2026
* origin/main: (127 commits) Refactor pull request view (1) (go-gitea#37380) Improve AGENTS.md (go-gitea#37382) Remove dead CSS (go-gitea#37376) Add pr-review e2e test and speed up e2e tests (go-gitea#37345) Drop Fomantic tab, checkbox and form patches (go-gitea#37377) fix: dump with default zip type produces uncompressed zip (go-gitea#37401) Allow fast-forward-only merge when signed commits are required (go-gitea#37335) Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119) Move review request functions to a standalone file (go-gitea#37358) Fix repo init README EOL (go-gitea#37388) Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365) Remove external service dependencies in migration tests (go-gitea#36866) Extend issue context popup beyond markdown content (go-gitea#36908) fix: commit status reporting (go-gitea#37372) Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356) Fix cmd tests by mocking builtin paths (go-gitea#37369) chore: upgrade Go version in devcontainer image to 1.26 (go-gitea#37374) Fix button layout shift when collapsing file tree in editor (go-gitea#37363) Update `Block a user` form (go-gitea#37359) Remove IsValidExternalURL/IsAPIURL and use IsValidURL at call sites (go-gitea#37364) ... # Conflicts: # modules/eventsource/event.go # tests/e2e/events.test.ts
silverwind
added a commit
to TheFox0x7/gitea
that referenced
this pull request
Apr 24, 2026
* origin/main: feat(security): set X-Content-Type-Options: nosniff by default (go-gitea#37354) Refactor pull request view (1) (go-gitea#37380) Improve AGENTS.md (go-gitea#37382) Remove dead CSS (go-gitea#37376) Add pr-review e2e test and speed up e2e tests (go-gitea#37345) Drop Fomantic tab, checkbox and form patches (go-gitea#37377)
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Apr 25, 2026
* origin/main: (51 commits) Fix color regressions, add `priority` color (go-gitea#37417) [skip ci] Updated translations via Crowdin Stabilize e2e logout propagation test (go-gitea#37403) refactor: serve site manifest via `/assets/site-manifest.json` endpoint (go-gitea#37405) feat(security): set X-Content-Type-Options: nosniff by default (go-gitea#37354) Refactor pull request view (1) (go-gitea#37380) Improve AGENTS.md (go-gitea#37382) Remove dead CSS (go-gitea#37376) Add pr-review e2e test and speed up e2e tests (go-gitea#37345) Drop Fomantic tab, checkbox and form patches (go-gitea#37377) fix: dump with default zip type produces uncompressed zip (go-gitea#37401) Allow fast-forward-only merge when signed commits are required (go-gitea#37335) Introduce `ActionRunAttempt` to represent each execution of a run (go-gitea#37119) Move review request functions to a standalone file (go-gitea#37358) Fix repo init README EOL (go-gitea#37388) Fix org team assignee/reviewer lookups for team member permissions (go-gitea#37365) Remove external service dependencies in migration tests (go-gitea#36866) Extend issue context popup beyond markdown content (go-gitea#36908) fix: commit status reporting (go-gitea#37372) Support for Custom URI Schemes in OAuth2 Redirect URIs (go-gitea#37356) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was written with the help of Claude Opus 4.7