0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-03-08 05:02:49 +01:00

16 Commits

Author SHA1 Message Date
silverwind
a49aecf623
Fix FORCE_COLOR corrupting port number in e2e script
FORCE_COLOR=1 on CI caused console.log to wrap the port number in
ANSI color codes, breaking ROOT_URL parsing. Use process.stdout.write
which bypasses color formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 04:34:41 +01:00
silverwind
f6037c90d3
Rework e2e test setup for full isolation
Always start an isolated ephemeral Gitea instance with its own temp
directory, SQLite database, and config file. This addresses review
feedback that using the developer's existing instance is unreliable.

- Rewrite test-e2e.sh to create a temp workdir, find a free port,
  write a minimal app.ini, start the server, and clean up on exit
- Build a separate gitea-e2e binary using TEST_TAGS (includes sqlite)
- Simplify CI workflow: remove manual app.ini, server start, and
  redundant build steps
- Rename all env vars to use GITEA_TEST_E2E_* prefix
- Rename test user from "e2e" to "e2e-user"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 03:59:33 +01:00
silverwind
e9e676d553
Address e2e review feedback
- Add ENABLE_CAPTCHA=false to CI app.ini so the server starts with
  CAPTCHA disabled instead of relying on env var in test script
- Retry on 502/503 in addition to 500 in apiRetry helper
- Fix typo: workarkound → workaround
- Add comment about section-unaware INI parsing in test-e2e.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
76c0fff889
Rename test.gitea.io to e2e.gitea.com in e2e tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
4af15206cd
Add register e2e test and disable CAPTCHA for e2e
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
9a70946124
add temp server for local development, misc tweaks 2026-02-18 03:03:15 +01:00
silverwind
03f05abb67
Remove leftover EXECUTABLE reassignment in test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
cb1c0a9521
Use ./ prefix inline instead of rewriting EXECUTABLE
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
d91a8d886b
Move ./ prefix for EXECUTABLE into test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
61b75540a5
Quote shell variable expansions in test-e2e.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
bbfa948f51
Remove EXECUTABLE fallback in test-e2e.sh
The Makefile always passes EXECUTABLE, so the fallback is unnecessary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
734be7e3b5
Fix e2e CI: use ./gitea path for executable, show user creation errors
The EXECUTABLE was passed as 'gitea' without ./ prefix, which fails
in CI where the current directory is not in PATH. Also remove
2>/dev/null from user creation to surface errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
83a448c498
Rename e2e env vars to E2E_URL, simplify URL detection
Rename GITEA_TEST_SERVER_URL and GITEA_URL to E2E_URL for consistency
with E2E_USER and E2E_PASSWORD. Simplify the if/else in test-e2e.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
68acbd3ad4
Address review comments
Trim trailing slash from server URL, add retry loop for server
reachability, note in CONTRIBUTING.md that a running server is required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
625e46d033
Pass e2e credentials via environment variables
Remove login_user helper and LOGIN_PASSWORD constant, pass E2E_USER
and E2E_PASSWORD from the test script to playwright via env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
f76c0acf59
Rework e2e tests
Remove the Go test harness that compiled test binaries and bootstrapped
a full Gitea server with fixtures. Replace with a bash script that runs
Playwright directly against an already-running Gitea instance.

- Remove Go e2e test files (e2e_test.go, utils_e2e_test.go)
- Add tools/test-e2e.sh that detects server URL, creates e2e user, runs Playwright
- Simplify Makefile to single test-e2e target
- Rewrite playwright.config.ts with chromium-only, no file outputs
- Rewrite tests using semantic Playwright locators (getByLabel, getByRole, getByText)
- Add login/logout utilities in tests/e2e/utils.ts
- Add CI workflow for e2e tests (.github/workflows/pull-e2e-tests.yml)
- Install only chromium in playwright install step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00