1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-31 18:30:58 +00:00

chore: use t.Context for tests, activate usetesting for lint + add t.TempDir and t.Chdir (#844)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/844): <!--number 844 --><!--line 0 --><!--description Y2hvcmU6IHVzZSB0LkNvbnRleHQgZm9yIHRlc3RzLCBhY3RpdmF0ZSB1c2V0ZXN0aW5nIGZvciBsaW50ICsgYWRkIHQuVGVtcERpciBhbmQgdC5DaGRpciBbc2tpcCBjYXNjYWRlXQ==-->chore: use t.Context for tests, activate usetesting for lint + add t.TempDir and t.Chdir [skip cascade]<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/844
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>
This commit is contained in:
Earl Warren 2025-08-11 13:21:42 +00:00 committed by earl-warren
parent 66bb63ea18
commit 0520ff4e05
No known key found for this signature in database
GPG key ID: F128CBE6AB3A7201
22 changed files with 126 additions and 153 deletions

View file

@ -99,7 +99,7 @@ func TestSetRef(t *testing.T) {
Event: table.event,
}
ghc.SetRef(context.Background(), "main", "/some/dir")
ghc.SetRef(t.Context(), "main", "/some/dir")
ghc.SetRefTypeAndName()
assert.Equal(t, table.ref, ghc.Ref)
@ -117,7 +117,7 @@ func TestSetRef(t *testing.T) {
Event: map[string]interface{}{},
}
ghc.SetRef(context.Background(), "", "/some/dir")
ghc.SetRef(t.Context(), "", "/some/dir")
assert.Equal(t, "refs/heads/master", ghc.Ref)
})
@ -204,7 +204,7 @@ func TestSetSha(t *testing.T) {
Event: table.event,
}
ghc.SetSha(context.Background(), "/some/dir")
ghc.SetSha(t.Context(), "/some/dir")
assert.Equal(t, table.sha, ghc.Sha)
})