Commit graph

93 commits

Author SHA1 Message Date
Earl Warren
d29439c5f7
fix: actions: refactor force-rebuild tests to use a remote action (#991)
The local actions are always rebuilt with a random tag and cannot be used to verify the force_rebuild setting is working.

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/991
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-01 17:14:24 +00:00
Earl Warren
ecff9c4c70
actions: context: verify RUNNER_TOOL_CACHE exists (#968)
As of [Forgejo runner 5.0.1](5889426664), RUNNER_TOOL_CACHE is set but it is not pre-populated. By default it does not exist but a dedicated container image my place shared tools at that location for actions / workflows that expect them to be advertised by this environment variable.

Resolves forgejo/runner#901

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/968
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-29 13:51:34 +00:00
Earl Warren
fea037d403
actions: context: verify RUN_ID (#951)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/951
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-17 17:50:19 +00:00
Earl Warren
44f2cf9cf1
actions: show how secrets & outputs work with workflow_call (#934)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/934
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-16 20:47:03 +00:00
Earl Warren
20f170d4a0
actions: add trivial needs output example (#915)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/915
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-12 10:37:15 +00:00
Earl Warren
15cfe2f55c
actions: add trivial matrix example (#912)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/912
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-12 07:48:14 +00:00
Earl Warren
47f50d3257
actions: add test for reusable workflows (#839)
It is working although undocumented. It appears that Forgejo Actions users depend on it and breaking it would meet some non negligible push back. This test ensures that future Forgejo runner versions do not break what is working. This came to light because some fixes are necessary to the schema validation to allow for that to keep working (see https://code.forgejo.org/forgejo/act/pulls/194).

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/839
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-26 11:23:39 +00:00
Earl Warren
841ca7c2c6
actions: as of Forgejo runner v8.0.0 FORGEJO_ACTION_PATH is hash based (#823)
Refs: https://code.forgejo.org/forgejo/act/pulls/186
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/823
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-21 20:31:52 +00:00
Earl Warren
0b826217a9
actions: shell: assert sh fallback (#790)
Refs forgejo/runner#150

Local testing [following instructions](https://code.forgejo.org/forgejo/end-to-end/src/branch/main/README.md#running-from-locally-built-binary) and [the matching ACT PR](https://code.forgejo.org/forgejo/act/pulls/177).

Once merged this will be a noop and actually remove coverage for shell test that was added earlier today. It will reactivate once the runner v8.0.0 is published.

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/790
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-12 09:59:00 +00:00
Earl Warren
b2d99f4c4a
actions: shell: assert shell behavior (#788)
Refs https://code.forgejo.org/forgejo/runner/issues/150

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/788
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-12 08:08:25 +00:00
Earl Warren
b67f9e1a70
chore: s/GITHUB_*/FORGEJO_*/ & s/github./forge./ (#776)
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/776
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-09 14:09:48 +00:00
Earl Warren
49c2072cbe
actions: use FORGEJO_* instead of GITHUB_* and test backward compatibility (#758)
Refs forgejo/act#171
Refs actions/setup-forgejo#461

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/758
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-08 04:51:37 +00:00
Earl Warren
cd1a0f5076
chore: add assertions for the forge context and use it instead of github where relevant (#748)
Refs forgejo/act#37

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/748
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-06 12:15:38 +00:00
Earl Warren
07b9318ff7
actions: config-options: mount read-only (#718)
To illustrate (partially) [this feature request](https://code.forgejo.org/forgejo/runner/issues/79#issuecomment-43844)

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/718
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-02 10:54:26 +00:00
Earl Warren
dd31a59c1e
actions: config-options: test for envs and env-file (#722)
Refs: forgejo/runner#287
Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/722
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-02 10:53:36 +00:00
Earl Warren
3d5a218709
actions: add test for hashFiles()
As of

7c7d80ebdd

a step with hashFiles('...') will lookup the file from the container
running the job.
2025-06-30 18:34:00 +02:00
famfo
652cf00186
update logger mode in forgejo configs 2025-06-07 12:36:27 +02:00
Earl Warren
2819929687
actions: set insecure: true for better coverage
Refs: https://code.forgejo.org/forgejo/runner/pulls/535
2025-04-06 10:50:03 +02:00
Earl Warren
e63a861f43
actions: cache: use separate jobs for restore and save 2025-03-26 15:35:59 +00:00
Earl Warren
b2471a699d
chore: s/code.forgejo.org/data.forgejo.org/ for actions 2025-03-22 16:07:29 +01:00
Kwonunn
f3a9672647
add cache-proxy test (#557)
test to verify that a cache stored in one repo can't be restored in another

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/557
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Kwonunn <kwonunnx@gmail.com>
Co-committed-by: Kwonunn <kwonunnx@gmail.com>
2025-03-22 12:34:06 +00:00
Earl Warren
c29e1e64e7
feat: actions: verify LXC backend can checkout (#522)
ACT is expected to provide an LXC backend with node pre-installed by default to allow for running commonly used actions written in JS.

It also includes an upgrade to setup-forgejo 2.0.8 which contains a fix to teardown the runner properly even in the event where it contains files owned by root. This happens when running a workflow within a LXC container.

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/522
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-29 06:57:27 +00:00
Earl Warren
429d5584e1
feat: actions: add LXC backend example (#520)
Without such an example, there is no test that would verify a modification of the ACT LXC backend is working when running a cascading pull request.

Trace of the run at: https://code.forgejo.org/forgejo/end-to-end/actions/runs/2433/jobs/2#jobstep-4-28

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/520
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-28 17:16:51 +00:00
Earl Warren
ff2c6790b3
feat: actions: verify that container.options --hostname is valid
Refs: https://code.forgejo.org/forgejo/act/pulls/95
2025-01-22 18:46:02 +01:00
Earl Warren
beae8629a6
fix: use code.forgejo.org instead of docker.io
to avoid throttling

Fixes: https://code.forgejo.org/forgejo/end-to-end/actions/runs/2316
2025-01-13 05:30:48 +01:00
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