Locally only Chromium runs for fast feedback. On CI, tests also run
on Firefox for broader coverage.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
This simplifies the Makefile by removing the whole-file wrapping that
creates a tempdir introduced by
https://github.com/go-gitea/gitea/pull/11126. REPO_TEST_DIR is removed
as well.
Also clean up a lot of legacy code: unnecessary XSS test, incorrect test
env init, unused "_old_uid" hack, etc
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Fixes: https://github.com/go-gitea/gitea/issues/36612
This new setting controls which workflow directories are searched. The
default value matches the previous hardcoded behaviour.
This allows users for example to exclude `.github/workflows` from being
picked up by Actions in mirrored repositories by setting `WORKFLOW_DIRS
= .gitea/workflows`.
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite `build/generate-go-licenses.go` to use `go list -m -json all`
and read license files directly from the Go module cache instead of
relying on the buggy `google/go-licenses` tool.
This removes the need for CGO, GOOS=linux, and the intermediate temp
directory, while being like 100 times faster than before:
```
$ rm assets/go-licenses.json && time make assets/go-licenses.json
go run build/generate-go-licenses.go assets/go-licenses.json
make assets/go-licenses.json 0.21s user 0.22s system 173% cpu 0.247 total
---------
Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Clean up linter configs, removing redundant rules or dead disables. One
new rule enabled, no violations. Many revive rules had same or better
rules in staticcheck or govet.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Revert createRepo/deleteRepo to API-based functions for test
reliability. The UI-based versions were flaky due to navigation
timing. Also double all playwright timeouts (local and CI), rename
API functions to apiX convention, and disable playwright/expect-expect
lint rule.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The UI-based deleteOrg and deleteUser functions fail due to
form-fetch-action issues. Revert these to API calls while keeping
the working UI-based createRepo/deleteRepo functions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Declare E2E_USER, E2E_PASSWORD and E2E_URL as string in ProcessEnv so
non-null assertions are no longer needed throughout the e2e tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use locator('input[name="repo_name"]') instead of getByLabel which
can fail when Fomantic UI interferes with label-input association.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accept optional username/password in the login utility so the register
test can use it for the newly-created account instead of duplicating
the sign-in steps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use browser-based user actions for test setup and cleanup instead of
direct API/fetch calls, making tests exercise the same code paths as
real users.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The `make test-e2e` target depends on $(EXECUTABLE), and the Makefile
detects tag changes via TAGS_PREREQ. Without passing TAGS, the binary
gets rebuilt without SQLite support, causing the e2e user creation to
fail.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
The fomantic dropdown JS does not reliably initialize on CI headless
Chromium, making dropdown-based Sign Out impossible. Use clearCookies
to destroy the session and verify logout state instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The link-action handler does an async fetch POST then a form-based
redirect chain which can be slow on CI. Wait for the /user/logout
response to confirm session destruction, then navigate to verify.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace JS-dependent getByLabel (aria-label set by Fomantic init) with
getByTitle targeting the avatar's server-rendered title attribute, scoped
to the navigation bar. Extract reusable clickDropdownItem helper.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dropdown already gets aria-label from data-tooltip-content via
the ARIA dropdown patch, so we can open it with getByLabel and then
click Sign Out normally.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dispatchEvent('click') on Sign Out triggers a navigation. Wait
for it to complete before checking for the Sign In link.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>