mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-06 07:10:28 +00:00
test(e2e): cover host mode, reusable workflows, scheduling, reconnect and CLI flags (#1347)
Extends the e2e suite with scenarios for host labels, local `workflow_call`, label routing, `runner.capacity`, a dropped and restored connection to Gitea, and the daemon's `--once`, `--labels` and `shutdown_timeout` behaviour. Stacked on https://gitea.com/gitea/runner/pulls/1346, so its commit shows here until that merges. The new scenarios pass locally against gitea/gitea:latest and main-nightly. Assisted-by: Codet:codet Co-authored-by: Zettat123 <[email protected]> Co-authored-by: bircni <[email protected]> Reviewed-on: https://gitea.com/gitea/runner/pulls/1347 Reviewed-by: Zettat123 <[email protected]>
This commit is contained in:
1 parent
d77e216674
commit
b712c91c2d
21 files changed
+661
-65
No files matched your search
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
name: capacity
|
||||
on: push
|
||||
jobs:
|
||||
one:
|
||||
runs-on: e2e-capacity
|
||||
steps:
|
||||
- run: |
|
||||
echo "span-start=$(date +%s%N)"
|
||||
sleep 8
|
||||
echo "span-end=$(date +%s%N)"
|
||||
two:
|
||||
runs-on: e2e-capacity
|
||||
steps:
|
||||
- run: |
|
||||
echo "span-start=$(date +%s%N)"
|
||||
sleep 8
|
||||
echo "span-end=$(date +%s%N)"
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
name: cli-labels
|
||||
on: push
|
||||
jobs:
|
||||
hello:
|
||||
runs-on: e2e-override
|
||||
steps:
|
||||
- run: echo e2e-override-ran
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
name: cli-once
|
||||
on: push
|
||||
jobs:
|
||||
first:
|
||||
runs-on: e2e-once
|
||||
steps:
|
||||
- run: echo e2e-once-first
|
||||
second:
|
||||
runs-on: e2e-once
|
||||
steps:
|
||||
- run: echo e2e-once-second
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
name: cli-shutdown
|
||||
on: push
|
||||
jobs:
|
||||
slow:
|
||||
runs-on: e2e-shutdown
|
||||
steps:
|
||||
- run: |
|
||||
echo e2e-shutdown-started
|
||||
sleep 8
|
||||
echo e2e-shutdown-finished
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
name: host
|
||||
on: push
|
||||
jobs:
|
||||
host:
|
||||
runs-on: e2e-host
|
||||
steps:
|
||||
- run: |
|
||||
test "$(hostname)" = "${{ vars.E2E_HOSTNAME }}"
|
||||
test -n "$GITHUB_WORKSPACE"
|
||||
echo e2e-host-job-ran
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
name: reconnect
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .gitea/workflows/reconnect.yml
|
||||
jobs:
|
||||
slow:
|
||||
runs-on: e2e-reconnect
|
||||
steps:
|
||||
- run: |
|
||||
echo e2e-before-outage
|
||||
for i in $(seq -w 1 15); do
|
||||
echo "tick-$i"
|
||||
sleep 1
|
||||
done
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
name: reconnect-idle
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- .gitea/workflows/reconnect_idle.yml
|
||||
jobs:
|
||||
hello:
|
||||
runs-on: e2e-reconnect
|
||||
steps:
|
||||
- run: echo e2e-idle-recovered
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
name: reusable-callee
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
who:
|
||||
type: string
|
||||
required: true
|
||||
outputs:
|
||||
greeting:
|
||||
value: ${{ jobs.say.outputs.greeting }}
|
||||
jobs:
|
||||
say:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
greeting: ${{ steps.greet.outputs.greeting }}
|
||||
steps:
|
||||
- id: greet
|
||||
run: |
|
||||
echo "greeting=hello-${{ inputs.who }}" >> "$GITHUB_OUTPUT"
|
||||
echo e2e-reusable-ran
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
name: reusable-caller
|
||||
on: push
|
||||
jobs:
|
||||
call:
|
||||
uses: ./.gitea/workflows/reusable_callee.yml
|
||||
with:
|
||||
who: e2e
|
||||
verify:
|
||||
needs: call
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: test "${{ needs.call.outputs.greeting }}" = "hello-e2e"
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
name: route
|
||||
on: push
|
||||
jobs:
|
||||
a:
|
||||
runs-on: e2e-route-a
|
||||
steps:
|
||||
- run: echo route-a
|
||||
b:
|
||||
runs-on: e2e-route-b
|
||||
steps:
|
||||
- run: echo route-b
|
||||
unmatched:
|
||||
runs-on: e2e-route-none
|
||||
steps:
|
||||
- run: echo route-none
|
||||
Reference in new issue
Block a user