Skip to content

Commit 41213e9

Browse files
committed
Revert "remove calling CleanupEphemeralRunners in test"
This reverts commit f4b6e60.
1 parent e4908f9 commit 41213e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/integration/actions_job_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"code.gitea.io/gitea/modules/json"
2222
"code.gitea.io/gitea/modules/setting"
2323
api "code.gitea.io/gitea/modules/structs"
24+
actions_service "code.gitea.io/gitea/services/actions"
2425

2526
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
2627
"connectrpc.com/connect"
@@ -452,6 +453,9 @@ func TestActionsGiteaContextEphemeral(t *testing.T) {
452453
runner := newMockRunner()
453454
runner.registerAsRepoRunner(t, baseRepo.OwnerName, baseRepo.Name, "mock-runner", []string{"ubuntu-latest"}, true)
454455

456+
// verify CleanupEphemeralRunners does not remove this runner
457+
actions_service.CleanupEphemeralRunners(t.Context())
458+
455459
// init the workflow
456460
wfTreePath := ".gitea/workflows/pull.yml"
457461
wfFileContent := `name: Pull Request
@@ -524,12 +528,18 @@ jobs:
524528
token := gtCtx["token"].GetStringValue()
525529
assert.Equal(t, actionTask.TokenLastEight, token[len(token)-8:])
526530

531+
// verify CleanupEphemeralRunners does not remove this runner
532+
actions_service.CleanupEphemeralRunners(t.Context())
533+
527534
resp, err := runner.client.runnerServiceClient.FetchTask(t.Context(), connect.NewRequest(&runnerv1.FetchTaskRequest{
528535
TasksVersion: 0,
529536
}))
530537
assert.NoError(t, err)
531538
assert.Nil(t, resp.Msg.Task)
532539

540+
// verify CleanupEphemeralRunners does not remove this runner
541+
actions_service.CleanupEphemeralRunners(t.Context())
542+
533543
runner.client.runnerServiceClient.UpdateTask(t.Context(), connect.NewRequest(&runnerv1.UpdateTaskRequest{
534544
State: &runnerv1.TaskState{
535545
Id: actionTask.ID,

0 commit comments

Comments
 (0)