Commit graph

68 commits

Author SHA1 Message Date
Earl Warren
adb09f901b
actions: force-rebuild use code.forgejo.org/oci to avoid throttling 2025-01-12 08:21:50 +01:00
Earl Warren
65e3fafd02
actions: force-rebuild must use a copy of the repository
it may not have permission to write on the repository itself, nor
should it.
2025-01-12 08:06:46 +01:00
Earl Warren
dacb3b0fac
chore(cleanup): log compression test does not belong
It is a feature and best tested in Forgejo itself, not in
end-to-end. It is a recurring source of false negative and there is
little to no value is fixing the associated border case because it
only applies to short lived Forgejo instances used during tests.

Fixes: https://code.forgejo.org/forgejo/end-to-end/issues/431
2025-01-11 18:07:48 +01:00
gratux
dbe50bffc7 add test for force_rebuild (#448)
see also [forgejo/runner #406](https://code.forgejo.org/forgejo/runner/pulls/406)

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/448
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: gratux <gratux@noreply.code.forgejo.org>
Co-committed-by: gratux <gratux@noreply.code.forgejo.org>
2025-01-11 15:27:44 +00:00
Earl Warren
f6f0acae0e
actions: verify runner config options for the container
- is not restricted to --volume (can use --env, etc.)
- --volume is sanitized with valid_volumes
2025-01-11 09:02:39 +01:00
Earl Warren
d142c4a60d
fix: actions: verify the docker_host socket works
It could be mounted but not functional.
2024-12-08 16:18:15 +01:00
Earl Warren
33749f5a5e
actions: runner [container].docker_host variations
* automount
* "" or "-"
* unix:///var/run/docker.sock
* tcp://127.0.0.1:2375
2024-11-27 09:33:08 +00:00
Earl Warren
c4b3c61325
actions: fix: wait for the action logs to show up
The Forgejo instance completed the echo test successfully, there must
be a log at some point. But since Forgejo is still running, it may not
had time to write the logs just yet. Retry instead of giving up
immediately.
2024-11-12 15:40:12 +01:00
Earl Warren
8bf5b2c802
actions: run echo and compression tests first 2024-11-11 08:30:01 +01:00
Kwonunn
3433d6ced2 forgot two of the configs 2024-10-28 14:55:49 +01:00
Kwonunn
6508a9e2ca set runner loglevel to debug 2024-10-28 13:52:33 +00:00
Kwonunn
3875197a1b fix: attempt to avoid database timeouts due to locking 2024-10-17 11:48:22 +02:00
Earl Warren
f7d1900c5b
actions: logs-compression check depends on echo
There is no guarantee that a test will not reset the actions logs from a
previous test. Since logs-compression depends on the logs from the
echo test, make that dependency explicit.
2024-10-15 13:02:02 +02:00
Kwonunn
222313181f Add schedule-noncancel test to 9.0 suite 2024-10-13 13:57:07 +02:00
Kwonunn
c3eb8918b4 implement waiting based on a file 2024-10-13 12:45:19 +02:00
Kwonunn
631055d190 rewrite schedule cancelling test 2024-10-12 15:11:22 +02:00
Kwonunn
f48fa02916 WIP: Add test for schedule not being cancelled 2024-10-09 15:50:17 +02:00
Earl Warren
75503c5396
actions: feature: compression: do not hardcode the log path
The log path depends on the previous actions run and may not always
be 01/1.log.zst. Assuming it is makes this test fragile as it is
influenced by which previous tests are run and what they do.
2024-08-23 16:53:03 +02:00
Earl Warren
8636471d63
actions: verify the log compression feature
If running Forgejo >= v9.0, verify the logs are compressed by default
2024-08-11 16:47:14 +02:00
Earl Warren
427c46dbf9
lib: remove RELEASE_NUMBERS_AND_DEV, use RELEASE_NUMBERS
In the lifecycle of vX.Y.Z, all tests are run against vX.Y-test
before it is published, including when the tag is pushed because the
automated release process now runs end-to-end before pushing the
release to forgejo-experimental.

Running end-to-end against vX.Y-dev is therefore redundant with at least
two other runs with exactly the same SHA (the one before the tag is
pushed and the one when the tag is pushed). There would be value in
doing that if it allowed to detect race conditions in Forgejo. But
such races were not found in the past six months and there is a lot
more scrutiny on commits merged in Forgejo which makes it even less
likely than it was before.

Running the tests on vX.Y instead of also including the built version
provide the same coverage and reduces the workload.
2024-08-08 17:46:04 +02:00
Earl Warren
497a5d76bb
actions: trim v1.20 & v1.21 specific comment 2024-08-07 11:42:22 +02:00
Earl Warren
50c5908a91
Forgejo v1.21 is EOL, v9.0 is dev 2024-08-07 11:42:22 +02:00
Earl Warren
d5f66e4c0a
shfmt -w globally 2024-08-07 08:31:33 +02:00
Earl Warren
05a341e201
actions: add an example for workflow-dispatch
/repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches

* fails if the required inputs are not provided
* sets defaults to inputs that are not provided

The type of inputs are only used for building the web UI interface,
not for validation. All values are strings.
2024-07-05 07:16:35 +02:00
Earl Warren
64489247aa
actions: run in development mode for debug purposes 2024-07-04 20:15:10 +02:00
Earl Warren
87df9095b9
Revert "actions: use Forgejo runner v3.5.0"
Do not force the runner version, use whatever default setup-forgejo
provides.

Forcing the version will break the cascading-pr workflow. It will
attempt to download a version that does not exist instead of building
it from sources.

This reverts commit dca3641cf3.
2024-07-02 20:54:27 +02:00
Twenty Panda
8b3c0a55e7 actions: test cache/{restore,save}@v4 support 2024-06-22 20:27:04 +02:00
Twenty Panda
dca3641cf3 actions: use Forgejo runner v3.5.0 2024-06-22 20:24:47 +02:00
Earl Warren
2461666aca
lib: use the WORK_PATH base instead of forgejo for the daemon
Instead of hardcoding "forgejo" as the base for the daemon to store
the PID and the logs, use the base of the WORK_PATH so that a given
work path can run a dedicated forgejo instance by the same name.
2024-06-04 13:04:05 +02:00
Earl Warren
4a19e9c90b
lib: get the base of WORK_PATH from app.ini
instead of hardcoding forgejo-work-path to be the base of WORK_PATH
relative to DIR, read it from the app.ini file. It will allow
multiple Forgejo instances to run simultaneously, each using a
different directory.
2024-06-04 12:00:42 +02:00
Earl Warren
9e60ae4449
actions: post-7-0-schedule: create /srv/example/post-7-0-schedule/contexts first
A loop is waiting for /srv/example/post-7-0-schedule-volume/DONE to exist before
declaring the workflow is successfully run. But it is not really until
/srv/example/post-7-0-schedule/contexts is created with the event content and they
will race.

Fixes: https://code.forgejo.org/forgejo/end-to-end/issues/181

Exactly the same as 57fdd1cd49 but for
post-7-0-schedule instead of cron
2024-06-01 09:36:45 +02:00
Earl Warren
fcb48eff5c
actions: automerge: check when review happens after CI success 2024-05-28 00:47:02 +02:00
Earl Warren
f9e20e7770
actions: add automerge example 2024-05-27 20:57:40 +02:00
Earl Warren
57fdd1cd49
actions: cron: create /srv/example/cron/contexts first
A loop is waiting for /srv/example/cron-volume/DONE to exist before
declaring the workflow is successfully run. But it is not really until
/srv/example/cron/contexts is created with the event content and they
will race.

Fixes: https://code.forgejo.org/forgejo/end-to-end/issues/181
2024-05-21 08:16:39 +02:00
Earl Warren
9f55d67bd2
actions: push-cancel intermitent failure
A) When both push happen within the same second, the SHA will be
  identical and there will not be any cancelation.
B) When `sleep infinity` happens after the reload of the runner, it
   will block the following tests forever because it has a capacity of one.

Fixes: https://code.forgejo.org/forgejo/end-to-end/issues/144

2024-05-13T00:58:49.1453499Z actions_verify_example.out:[main (root-commit) cbf3afb] initial commit
2024-05-13T00:58:49.1453528Z actions_verify_example.out: 3 files changed, 28 insertions(+)
2024-05-13T00:58:49.1453556Z actions_verify_example.out: create mode 100644 .forgejo/workflows/test.yml
2024-05-13T00:58:49.1453585Z actions_verify_example.out: create mode 100755 run.sh
2024-05-13T00:58:49.1453611Z actions_verify_example.out: create mode 100644 teardown.sh
2024-05-13T00:58:49.1453638Z actions_verify_example.out:+ git remote add origin http://root:admin1234@10.201.14.172:3000/root/example-push-cancel
2024-05-13T00:58:49.1453669Z actions_verify_example.out:+ git push --force -u origin main
2024-05-13T00:58:49.1453699Z actions_verify_example.out:remote: . Processing 1 references
2024-05-13T00:58:49.1453728Z actions_verify_example.out:remote: Processed 1 references in total
2024-05-13T00:58:49.1453758Z actions_verify_example.out:To http://10.201.14.172:3000/root/example-push-cancel
2024-05-13T00:58:49.1453786Z actions_verify_example.out: * [new branch]      main -> main
2024-05-13T00:58:49.1453814Z actions_verify_example.out:branch 'main' set up to track 'origin/main'.
...
2024-05-13T00:58:49.1458629Z actions_verify_example.out:[main (root-commit) cbf3afb] initial commit
2024-05-13T00:58:49.1458656Z actions_verify_example.out: 3 files changed, 28 insertions(+)
2024-05-13T00:58:49.1458683Z actions_verify_example.out: create mode 100644 .forgejo/workflows/test.yml
2024-05-13T00:58:49.1458711Z actions_verify_example.out: create mode 100755 run.sh
2024-05-13T00:58:49.1458738Z actions_verify_example.out: create mode 100644 teardown.sh
2024-05-13T00:58:49.1458764Z actions_verify_example.out:+ git remote add origin http://root:admin1234@10.201.14.172:3000/root/example-push-cancel
2024-05-13T00:58:49.1458795Z actions_verify_example.out:+ git push --force -u origin main
2024-05-13T00:58:49.1458822Z actions_verify_example.out:Everything up-to-date
2024-05-13 19:42:42 +02:00
Earl Warren
e80f12ace9
chore(cleanup): v1.20 is EOL, trim it 2024-04-25 14:24:50 +02:00
TheFox0x7
416db9031b add schedule runs-on variables test for post 7.0 releases (#151)
reimplements: forgejo/end-to-end#146 for 8.0-dev and 8.0-test
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/151
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
2024-04-07 20:25:02 +00:00
Earl Warren
e3a6e1fd8a
Revert "actions: workaround for possible 404 transient bug on artifacts"
Refs: https://code.forgejo.org/forgejo/end-to-end/issues/144

This reverts commit 191976a836.
2024-04-05 05:24:04 +02:00
Earl Warren
191976a836
actions: workaround for possible 404 transient bug on artifacts
Refs: https://codeberg.org/forgejo/forgejo/issues/2949
2024-04-02 07:40:08 +02:00
Earl Warren
cd377ddbad
actions: push-cancel: fix typo 2024-03-26 09:21:32 +01:00
Earl Warren
d8673b8c0b
actions: pull-request: squash main/setup functions 2024-03-26 08:35:16 +01:00
Earl Warren
36456ee74f
actions: pull-request: assert the existence of contexts
and not the existence of tokens
2024-03-26 08:31:26 +01:00
Earl Warren
be033071a4
actions: services: cover the case when no container is specified
When the container for running the steps is specificied, it is setup
differently than when it is implicit. This test adds coverage for both
instead of running all examples with an explicitly specified container
image.
2024-03-24 10:51:02 +01:00
Earl Warren
13f18f9f47
actions: Forgejo 7.0 is equivalent to 7.0-test and run artifacts v4 2024-03-21 17:16:05 +01:00
Earl Warren
a9a46b7b7d
actions: display the runner version 2024-03-21 15:34:38 +01:00
Earl Warren
e1fd4cbc0f
actions: test {upload,download}-artifacts@v4 support
If Forgejo version is >= 7.0 and Forgejo runner > 3.3.0 artifacts@v4
are tested to work with a forked modified version that claims to be
compatible.
2024-03-21 14:25:28 +01:00
Twenty Panda
96f91063c9 merge actions test into end-to-end.sh
* replace the high level test running actions tests with end-to-end.sh
* set DOMAIN to the IP instead of 127.0.0.1 for runner <-> forgejo communications
* move forgejo_cli from a function to a file so that it can be used by forgejo-runner.sh
* keep the documentation updates workflows separate because they need to open one PR per version
2024-03-20 13:42:44 +01:00
Earl Warren
78027e672d
Forgejo v1.22 will actually be Forgejo v7.0 2024-02-28 17:38:31 +01:00
username
5cdebe65db
actions/example-cron: verify the type of the event 2024-01-18 18:06:08 +00:00
Earl Warren
dcc61603a2
actions: add example-tag 2024-01-13 18:21:50 +01:00