Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
973ae22
Make integration tests cacheable, dedupe Makefile DB targets
silverwind Apr 28, 2026
d4e49d9
Chdir to source root in SetupGiteaTestEnv
silverwind Apr 28, 2026
4adf51d
Drop stale /integrations.test from .gitignore
silverwind Apr 28, 2026
32d2f02
Move test cwd anchor out of SetupGiteaTestEnv
silverwind Apr 28, 2026
2ef5389
Use t.Chdir in migration test init
silverwind Apr 28, 2026
9ffdbc4
Make test fixture paths package-relative
silverwind Apr 28, 2026
8568769
Make test-echo render command path package-relative
silverwind Apr 28, 2026
11c0ef4
Anchor test fixture paths at GetGiteaTestSourceRoot
silverwind Apr 28, 2026
3572731
Drop integration benchmarks, superseded by package-level benchmarks
silverwind Apr 28, 2026
9d32c0a
Use GITEA_TEST_ROOT for ini render-command substitution
silverwind Apr 28, 2026
d7e4fd5
clean up
wxiaoguang Apr 28, 2026
f1afc4a
fix
wxiaoguang Apr 28, 2026
845f7de
fix makefile
wxiaoguang Apr 28, 2026
a5fbaa0
fix
wxiaoguang Apr 28, 2026
f931b8e
Merge branch 'main' into cacheable-integration-tests
wxiaoguang Apr 28, 2026
5b45220
Drop test-integration binary, stream progress via go test -v
silverwind Apr 28, 2026
cf032e3
Capture test logs internally instead of routing through t.Log
silverwind Apr 28, 2026
c75829d
Revert "Capture test logs internally instead of routing through t.Log"
silverwind Apr 28, 2026
26bf533
Revert "Drop test-integration binary, stream progress via go test -v"
silverwind Apr 28, 2026
2cb3bd5
Merge branch 'cacheable-integration-tests' of github.com:silverwind/g…
lunny Apr 28, 2026
631f733
Upgrade xgo to 1.26.x
lunny Apr 28, 2026
ccd655e
Split e2e CI step so build and test durations are visible
silverwind Apr 28, 2026
ae602f6
Fix Test_DropTableColumns skip and rewrite test-integration FIXME
silverwind Apr 28, 2026
73e1a7b
Merge branch 'main' into cacheable-integration-tests
silverwind Apr 28, 2026
c8e0df7
Merge branch 'main' into cacheable-integration-tests
silverwind Apr 29, 2026
2b22e24
docke dryrun in parallel
wxiaoguang Apr 29, 2026
54243d7
Merge branch 'main' into cacheable-integration-tests
wxiaoguang Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ cpu.out
*.log

/gitea
/gitea-vet
/debug
/integrations.test

/bin
/dist
Expand All @@ -54,12 +52,6 @@ cpu.out
/indexers
/log
/tests/integration/gitea-integration-*
/tests/integration/indexers-*
/tests/e2e/gitea-e2e-*
/tests/e2e/indexers-*
/tests/e2e/reports
/tests/e2e/test-artifacts
/tests/e2e/test-snapshots
/tests/*.ini
/node_modules
/yarn.lock
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cache-seeder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
include:
- { job: lint-backend, tags: "bindata sqlite sqlite_unlock_notify", target: "lint-backend" }
- { job: lint-go-windows, tags: "bindata sqlite sqlite_unlock_notify", target: "lint-go-windows" }
- { job: lint-go-gogit, tags: "bindata sqlite sqlite_unlock_notify gogit", target: "lint-go" }
- { job: lint-go-gogit, tags: "bindata gogit sqlite sqlite_unlock_notify", target: "lint-go" }
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/part-docker-dryrun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Reusable workflow that performs the container build steps for a single platform.
# Used by `pull-docker-dryrun.yml` to run builds in parallel per-platform.
on:
workflow_call:
inputs:
platform:
description: 'The target platform(s) to build for (e.g. linux/amd64)'
required: true
type: string

jobs:
build-dryrun:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Build rootful image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
platforms: ${{ inputs.platform }}
push: false
file: Dockerfile
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful
- name: Build rootless image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
platforms: ${{ inputs.platform }}
push: false
file: Dockerfile.rootless
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless
42 changes: 21 additions & 21 deletions .github/workflows/pull-db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ jobs:
env:
TAGS: bindata
- name: run migration tests
run: make test-pgsql-migration
run: GITEA_TEST_DATABASE=pgsql make test-migration
- name: run tests
run: make test-pgsql
run: GITEA_TEST_DATABASE=pgsql make test-integration
timeout-minutes: 50
env:
TAGS: bindata gogit
TEST_TAGS: gogit
TEST_LDAP: 1

test-sqlite:
Expand All @@ -84,18 +83,21 @@ jobs:
with:
cache-name: sqlite
- run: make deps-backend
- run: GOEXPERIMENT='' make backend
- run: make backend
env:
Comment thread
wxiaoguang marked this conversation as resolved.
TAGS: bindata gogit sqlite sqlite_unlock_notify
GOEXPERIMENT:
- name: run migration tests
run: make test-sqlite-migration
run: GITEA_TEST_DATABASE=sqlite make test-migration
env:
TAGS: bindata gogit
- name: run tests
run: GOEXPERIMENT='' make test-sqlite
run: GITEA_TEST_DATABASE=sqlite make test-integration
timeout-minutes: 50
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
RACE_ENABLED: true
TEST_TAGS: gogit sqlite sqlite_unlock_notify
TAGS: bindata gogit
GOEXPERIMENT:
GOTEST_FLAGS: -race -timeout=40m

test-unit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
Expand Down Expand Up @@ -156,16 +158,15 @@ jobs:
- name: unit-tests
run: make test-backend test-check
env:
TAGS: bindata
RACE_ENABLED: true
GOTESTFLAGS: -timeout=20m
TAGS: bindata sqlite sqlite_unlock_notify
GOTEST_FLAGS: -race -timeout=20m
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
- name: unit-tests-gogit
run: GOEXPERIMENT='' make test-backend test-check
run: make test-backend test-check
env:
TAGS: bindata gogit
RACE_ENABLED: true
GOTESTFLAGS: -timeout=20m
TAGS: bindata gogit sqlite sqlite_unlock_notify
GOEXPERIMENT:
GOTEST_FLAGS: -race -timeout=20m
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}

test-mysql:
Expand Down Expand Up @@ -215,10 +216,9 @@ jobs:
env:
TAGS: bindata
- name: run migration tests
run: make test-mysql-migration
run: GITEA_TEST_DATABASE=mysql make test-migration
- name: run tests
# run: make integration-test-coverage (at the moment, no coverage is really handled)
run: make test-mysql
run: GITEA_TEST_DATABASE=mysql make test-integration
env:
TAGS: bindata
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
Expand Down Expand Up @@ -258,9 +258,9 @@ jobs:
- run: make backend
env:
TAGS: bindata
- run: make test-mssql-migration
- run: GITEA_TEST_DATABASE=mssql make test-migration
- name: run tests
run: make test-mssql
run: GITEA_TEST_DATABASE=mssql make test-integration
timeout-minutes: 50
env:
TAGS: bindata
47 changes: 23 additions & 24 deletions .github/workflows/pull-docker-dryrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,33 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
files-changed:
uses: ./.github/workflows/files-changed.yml
permissions:
contents: read

container:
# dryrun build is slow, so run them in parallel per-platform
container-amd64:
if: needs.files-changed.outputs.docker == 'true'
needs: files-changed
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Build regular container image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
platforms: linux/amd64,linux/arm64,linux/riscv64
push: false
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootful
- name: Build rootless container image
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
with:
context: .
push: false
platforms: linux/amd64,linux/arm64,linux/riscv64
file: Dockerfile.rootless
cache-from: type=registry,ref=ghcr.io/go-gitea/gitea:buildcache-rootless
needs: [files-changed]
uses: ./.github/workflows/part-docker-dryrun.yml
with:
platform: linux/amd64

container-arm64:
if: needs.files-changed.outputs.docker == 'true'
needs: [files-changed]
uses: ./.github/workflows/part-docker-dryrun.yml
with:
platform: linux/arm64

container-riscv64:
if: needs.files-changed.outputs.docker == 'true'
needs: [files-changed]
uses: ./.github/workflows/part-docker-dryrun.yml
with:
platform: linux/riscv64
5 changes: 4 additions & 1 deletion .github/workflows/pull-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ jobs:
- run: make deps-frontend
- run: make frontend
- run: make deps-backend
- run: make gitea-e2e
- run: make backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
- run: make playwright
- run: make test-e2e
timeout-minutes: 10
env:
TAGS: bindata sqlite sqlite_unlock_notify
FORCE_COLOR: 1
GITEA_TEST_E2E_DEBUG: 1
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ cpu.out
*.log.*.gz

/gitea
/gitea-e2e
/gitea-vet
/debug
/integrations.test

/bin
/dist
Expand All @@ -68,7 +65,6 @@ cpu.out
/indexers
/log
/public/assets/img/avatar
/tests/e2e-output
/tests/integration/gitea-integration-*
/tests/integration/indexers-*
/tests/*.ini
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ Here's how to run the test suite:

- run tests (we suggest running them on Linux)

| Command | Action | |
| :------------------------------------------ | :------------------------------------------------------- | ------------------------------------------- |
|``make test[\#SpecificTestName]`` | run unit test(s) | |
|``make test-sqlite[\#SpecificTestName]`` | run [integration](tests/integration) test(s) for SQLite | [More details](tests/integration/README.md) |
|``make test-e2e`` | run [end-to-end](tests/e2e) test(s) using Playwright | |
| Command | Action | |
|:----------------------------------------------|:-----------------------------------------------------| ------------------------------------------- |
| ``make test-backend[\#SpecificTestName]`` | run unit test(s) | |
| ``make test-integration[\#SpecificTestName]`` | run [integration](tests/integration) test(s) | [More details](tests/integration/README.md) |
| ``make test-e2e`` | run [end-to-end](tests/e2e) test(s) using Playwright | |

- E2E test environment variables

Expand Down
Loading