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

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>
This commit is contained in:
silverwind 2026-02-16 03:02:38 +01:00
parent 6ea6c37762
commit e9e676d553
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
3 changed files with 6 additions and 2 deletions

View File

@ -47,6 +47,9 @@ jobs:
HTTP_PORT = 3000
ROOT_URL = http://localhost:3000
[service]
ENABLE_CAPTCHA = false
[security]
INSTALL_LOCK = true
EOF

View File

@ -15,7 +15,7 @@ async function apiRetry(fn: () => Promise<{ok: () => boolean; status: () => numb
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const response = await fn();
if (response.ok()) return;
if (response.status() === 500 && attempt < maxAttempts - 1) {
if ([500, 502, 503].includes(response.status()) && attempt < maxAttempts - 1) {
const jitter = Math.random() * 500;
await new Promise((resolve) => globalThis.setTimeout(resolve, 1000 * (attempt + 1) + jitter));
continue;
@ -57,7 +57,7 @@ export async function login(page: Page) {
}
export async function logout(page: Page) {
await page.context().clearCookies(); // workarkound issues related to fomantic dropdown
await page.context().clearCookies(); // workaround issues related to fomantic dropdown
await page.goto('/');
await expect(page.getByRole('link', {name: 'Sign In'})).toBeVisible();
}

View File

@ -10,6 +10,7 @@ if [ -z "${E2E_URL:-}" ]; then
echo " E2E_URL=http://localhost:3000 make test-e2e" >&2
exit 1
fi
# Note: this does not respect INI sections, assumes ROOT_URL only appears under [server]
ROOT_URL=$(sed -n 's/^ROOT_URL\s*=\s*//p' "$INI_FILE" | tr -d '[:space:]')
if [ -z "$ROOT_URL" ]; then
echo "error: ROOT_URL not found in $INI_FILE" >&2