packages: simplify the setup to use the same as upgrades

the packages tests control which Forgejo version they run against so
they can test a feature on version X+1 and not on version X
This commit is contained in:
Twenty Panda 2024-03-15 14:34:55 +07:00 committed by p
parent dd35a9f1a8
commit 9ff495254a
8 changed files with 64 additions and 153 deletions

View file

@ -95,34 +95,19 @@ it does not exist, all tests are run.
* `V1_21_TESTS`
* `V1_20_TESTS`
## Running packages locally
## Running other tests locally
To run and debug package tests, from the root of the source directory.
To run and debug tests, from the root of the source directory.
Run one test
Run one test. When the test fails the instance can be inspected at http://0.0.0.0:3000
```sh
packages/run.sh https://codeberg.org/forgejo-experimental/forgejo/releases/download/v7.0-test/forgejo-7.0-test-linux-amd64 v7.0.0-test v7_0 alpine # runs packages/alpine.sh
VERBOSE=true ./forgejo/upgrades/test-upgrade.sh test_packages_alpine
VERBOSE=true ./forgejo/upgrades/test-upgrade.sh test_storage_stable_s3 minio
```
Cleanup. It will teardown Forgejo and not run them because there is nothing to test.
Cleanup. It will teardown the Forgejo instance.
```sh
packages/run.sh https://codeberg.org/forgejo-experimental/forgejo/releases/download/v7.0-test/forgejo-7.0-test-linux-amd64 v7.0.0-test v7_0 none
./forgejo/upgrades/test-upgrade.sh stop
```
Run all examples for v7_0
```sh
packages/run.sh https://codeberg.org/forgejo-experimental/forgejo/releases/download/v7.0-test/forgejo-7.0-test-linux-amd64 v7.0.0-test v7_0
```
Remote testing
To reduce the runtime the following variables can be set to control
the number of cases run by the
[packages test](.forgejo/workflows/packages.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.
* `v7_0_PACKAGES_TESTS`
* `V1_21_PACKAGES_TESTS`