From 03dfdf6e65e103cc12f43053d8929315a86efeb1 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 29 Oct 2023 17:03:25 +0100 Subject: [PATCH] document how to manually run the actions tests --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 21a0270..535b88a 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,36 @@ specifically for testing such as They are designed to run using Forgejo releases and development versions compiled from designated repositories. + +## Hacking + +### Local testing + +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/actions.yml` does. There +may be some manual tweaking (such as creating temporary directories) +because the tests run as root, but they do not need to run as root. + +* `forgejo-curl.sh logout` +* `forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo 1.21` +* `firefox http://$(cat forgejo-ip):3000` +* `forgejo-runner.sh setup` +* `export example=pull-request` +* `export EXAMPLE_DIR=$(pwd)/actions/example-$example` +* `$EXAMPLE_DIR/setup.sh` # if it exists +* `$EXAMPLE_DIR/run.sh` or +* `forgejo-test-helper.sh run_workflow actions/example-$example http://root:admin1234@$(cat forgejo-ip):3000 root example-$example setup-forgejo $(cat forgejo-token)` +* `forgejo-runner.sh teardown` +* `forgejo.sh teardown` + +### Remote testing + +To reduce the runtime the following variables can be set to control +the number of cases run by the +[actions](.forgejo/workflows/actions.yml) tests. If set to +**none** they are not run at all for that version of Forgejo. If +it does not exist, all tests are run. + +* `V1_21_TESTS` +* `V1_20_TESTS`