Forgejo end-to-end tests
Find a file
Renovate Bot 22004ebe73
Update code.forgejo.org/oci/debian Docker tag to v13 (#1070)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| code.forgejo.org/oci/debian | container | major | `bookworm` -> `trixie` |
| code.forgejo.org/oci/debian | service | major | `bookworm` -> `trixie` |

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMjIuMyIsInVwZGF0ZWRJblZlciI6IjQxLjEyMi4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1070
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-10-18 06:11:46 +00:00
.forgejo feat: federation: upgrade to trixie (#1069) 2025-09-28 14:46:16 +00:00
actions Update code.forgejo.org/oci/debian Docker tag to v13 (#1070) 2025-10-18 06:11:46 +00:00
federation fix: federation: federation_verify_scenario is missing variables 2025-06-07 15:30:36 +01:00
forgejo chore(release): v14.0 exists (#1057) 2025-09-25 15:06:50 +00:00
lib chore(release): v12.0 is EoL (#1058) 2025-09-26 14:15:12 +00:00
packages update logger mode in forgejo configs 2025-06-07 12:36:27 +02:00
storage update logger mode in forgejo configs 2025-06-07 12:36:27 +02:00
upgrade Merge pull request 'Update data.forgejo.org/oci/pyroscope Docker tag to v1.12.1' (#616) from renovate/data.forgejo.org-oci-pyroscope-1.x into main 2025-06-21 05:06:06 +00:00
.dockerignore add Dockerfile to run tests in 2025-06-07 12:26:56 +02:00
.editorconfig actions: add automerge example 2024-05-27 20:57:40 +02:00
.gitignore upgrades: remove ad-hoc code and use forgejo-curl.sh instead 2024-03-15 10:21:58 +07:00
Dockerfile add Dockerfile to run tests in 2025-06-07 12:26:56 +02:00
end-to-end.sh README: link to v7.0 documentation instead of v1.21 2024-08-07 11:42:22 +02:00
LICENSE import from forgejo 2023-10-26 21:21:20 +02:00
README.md fix: actions: refactor force-rebuild tests to use a remote action (#991) 2025-09-01 17:14:24 +00:00
renovate.json Add renovate.json 2024-11-21 07:32:07 +00:00

Forgejo end-to-end tests

A series of tests scenarios and assertions covering Forgejo and the Forgejo runner.

They are designed to run using Forgejo releases and development versions compiled from designated repositories.

Removing legacy tests

End-to-end tests cover the supported range of releases and when one of them is EOL, it must be removed as well as the tests that target it specifically. Otherwise the test suite would grow indefinitely.

When a release is EOL, a branch is cut with a name following the pattern legacy/vX.Y-vA.B. For instance when v8.0 is published and v1.21 is EOL, the branch legacy/v8.0-v1.21 is cut.

Hacking

docker and sudo must be installed with insecure registries allowed in /etc/docker/daemon.json for the IP that will be used for forgejo such as:

{
  "insecure-registries": [ "10.0.0.0/8" ]
}

Use setup-forgejo from source.

The setup-forgejo repository is a Forgejo Action which is meant to be used in workflows. However, it is implemented as shell scripts that can also be used to create Forgejo instances and runners locally. This is convenient for testing and the reason why it needs to be added to the PATH. For instance, it is a dependency of the end-to-end.sh script.

git clone https://code.forgejo.org/actions/setup-forgejo
export PATH=$(pwd)/setup-forgejo:$PATH
git clone https://code.forgejo.org/forgejo/end-to-end
cd end-to-end

Running from locally built binary

Before injecting a manually built binary, make sure a simple test was run so that the directories are populated.

Forgejo

From a checkout of https://codeberg.org/forgejo/forgejo/

make clean-all && make frontend && make TAGS='bindata sqlite sqlite_unlock_notify' generate forgejo
cp -a forgejo /srv/forgejo-binaries/forgejo-11.0

It will be used whenever the version 11.0 is specified in a test.

Forgejo runner

From a checkout of https://code.forgejo.org/forgejo/runner

make --always-make forgejo-runner
cp forgejo-runner /tmp/forgejo-end-to-end/forgejo-runner

Running actions tests locally

To run and debug workflows from actions/example-*, from the root of the source directory, with docker and forgejo-curl.sh installed, mimic what .forgejo/workflows/end-to-end.yml does. There may be some manual tweaking (such as creating temporary directories) because the tests run as root in the context of Forgejo Actions and assume they have admin permissions. But they do not need to run as root and must work fine when run as a regular user.

export FORGEJO_RUNNER_LOGS=/tmp/forgejo-end-to-end/forgejo-runner.log
./end-to-end.sh run dependencies
./end-to-end.sh actions_setup 10.0
firefox 0.0.0.0:3000 # user root / admin1234
./end-to-end.sh actions_verify_example echo
./end-to-end.sh actions_teardown

Note that with-docker-tcp requires the docker daemon listens to tcp://127.0.0.1:2375. See actions/actions.sh for how to do that.

Running federation tests locally

To run and debug scenarios from federation/*, from the root of the source directory, mimic what .forgejo/workflows/end-to-end.yml does.

./end-to-end.sh run dependencies
./end-to-end.sh federation_setup 12.0
firefox 0.0.0.0:3001 # user root / admin1234
firefox 0.0.0.0:3002 # user root / admin1234
./end-to-end.sh federation_verify_scenario star
./end-to-end.sh federation_teardown

Running other tests locally

To run and debug tests, from the root of the source directory.

Run one test. When the test fails the instance can be inspected at http://0.0.0.0:3000

./end-to-end.sh test_packages_alpine
./end-to-end.sh test_storage_stable_s3 minio

Cleanup. It will teardown the Forgejo instance.

./end-to-end.sh stop

Running tests in Docker/Podman

There is an included Dockerfile in which the tests can be run. Building the conatiner will copy the the entire repo state into the container from which changes to the tests can be tested. Note: running in podman requires the --privileged flag because this will run podman in podman for some tests.