|
9 | 9 | "slices" |
10 | 10 | "testing" |
11 | 11 |
|
12 | | - actions_model "code.gitea.io/gitea/models/actions" |
13 | 12 | auth_model "code.gitea.io/gitea/models/auth" |
14 | | - "code.gitea.io/gitea/models/db" |
15 | 13 | api "code.gitea.io/gitea/modules/structs" |
16 | 14 | "code.gitea.io/gitea/tests" |
17 | 15 |
|
@@ -185,7 +183,6 @@ func testActionsRunnerOwner(t *testing.T) { |
185 | 183 | assert.Equal(t, "linux", runner.Labels[1].Name) |
186 | 184 |
|
187 | 185 | // Verify delete the runner by id |
188 | | - // TODO: what's the different from the test "DeleteNoConflictWhileJobIsDone"? |
189 | 186 | req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/orgs/org3/actions/runners/%d", runnerList.Entries[0].ID)).AddTokenAuth(token) |
190 | 187 | MakeRequest(t, req, http.StatusNoContent) |
191 | 188 |
|
@@ -228,22 +225,6 @@ func testActionsRunnerOwner(t *testing.T) { |
228 | 225 | req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/orgs/org3/actions/runners/%d", 34349)).AddTokenAuth(token) |
229 | 226 | MakeRequest(t, req, http.StatusNotFound) |
230 | 227 | }) |
231 | | - |
232 | | - t.Run("DeleteNoConflictWhileJobIsDone", func(t *testing.T) { |
233 | | - userUsername := "user2" |
234 | | - token := getUserToken(t, userUsername, auth_model.AccessTokenScopeWriteOrganization) |
235 | | - |
236 | | - _, err := db.GetEngine(t.Context()).Insert(&actions_model.ActionTask{ |
237 | | - RunnerID: 34347, |
238 | | - Status: actions_model.StatusSuccess, |
239 | | - }) |
240 | | - assert.NoError(t, err) |
241 | | - |
242 | | - // FIXME: CI fails because the runner has been deleted in the "Access" test |
243 | | - // Verify delete the runner by id is ok |
244 | | - req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/orgs/org3/actions/runners/%d", 34347)).AddTokenAuth(token) |
245 | | - MakeRequest(t, req, http.StatusNoContent) |
246 | | - }) |
247 | 228 | } |
248 | 229 |
|
249 | 230 | func testActionsRunnerRepo(t *testing.T) { |
@@ -306,7 +287,6 @@ func testActionsRunnerRepo(t *testing.T) { |
306 | 287 | assert.Equal(t, "linux", runner.Labels[1].Name) |
307 | 288 |
|
308 | 289 | // Verify delete the runner by id |
309 | | - // TODO: what's the different from the test "DeleteNoConflictWhileJobIsDone"? |
310 | 290 | req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/user2/repo1/actions/runners/%d", runnerList.Entries[0].ID)).AddTokenAuth(token) |
311 | 291 | MakeRequest(t, req, http.StatusNoContent) |
312 | 292 |
|
@@ -349,20 +329,4 @@ func testActionsRunnerRepo(t *testing.T) { |
349 | 329 | req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/user2/repo1/actions/runners/%d", 34349)).AddTokenAuth(token) |
350 | 330 | MakeRequest(t, req, http.StatusNotFound) |
351 | 331 | }) |
352 | | - |
353 | | - t.Run("DeleteNoConflictWhileJobIsDone", func(t *testing.T) { |
354 | | - userUsername := "user2" |
355 | | - token := getUserToken(t, userUsername, auth_model.AccessTokenScopeWriteRepository) |
356 | | - |
357 | | - _, err := db.GetEngine(t.Context()).Insert(&actions_model.ActionTask{ |
358 | | - RunnerID: 34348, |
359 | | - Status: actions_model.StatusSuccess, |
360 | | - }) |
361 | | - assert.NoError(t, err) |
362 | | - |
363 | | - // FIXME: CI fails because the runner has been deleted in the "Access" test |
364 | | - // Verify delete the runner by id is ok |
365 | | - req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/user2/repo1/actions/runners/%d", 34348)).AddTokenAuth(token) |
366 | | - MakeRequest(t, req, http.StatusNoContent) |
367 | | - }) |
368 | 332 | } |
0 commit comments