Skip to content

Commit 8922924

Browse files
committed
Test
1 parent 7e6e6ae commit 8922924

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

models/fixtures/action_run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
commit_sha: "c2d72f548424103f01ee1dc02889c1e2bff816b0"
4949
event: "push"
5050
is_fork_pull_request: 0
51-
status: 1
51+
status: 6 # running
5252
started: 1683636528
5353
stopped: 1683636626
5454
created: 1683636108

tests/integration/api_actions_delete_run_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ func TestAPIActionsDeleteRun(t *testing.T) {
3535
testAPIActionsDeleteRun(t, repo, token, http.StatusNotFound)
3636
}
3737

38+
func TestAPIActionsDeleteRunRunning(t *testing.T) {
39+
defer prepareTestEnvActionsArtifacts(t)()
40+
41+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 4})
42+
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID})
43+
session := loginUser(t, user.Name)
44+
token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteRepository)
45+
46+
req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/actions/runs/793", repo.FullName())).
47+
AddTokenAuth(token)
48+
MakeRequest(t, req, http.StatusBadRequest)
49+
}
50+
3851
func testAPIActionsDeleteRun(t *testing.T, repo *repo_model.Repository, token string, expected int) {
3952
req := NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/actions/runs/795", repo.FullName())).
4053
AddTokenAuth(token)

0 commit comments

Comments
 (0)