mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-31 06:34:00 +00:00
Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
parent
51ff4970ec
commit
fed2d81c44
427 changed files with 2043 additions and 2046 deletions
|
@ -24,9 +24,9 @@ func TestActions_RegisterRunner_Token(t *testing.T) {
|
|||
version := "v1.2.3"
|
||||
runner, err := RegisterRunner(db.DefaultContext, ownerID, repoID, token, &labels, name, version)
|
||||
require.NoError(t, err)
|
||||
assert.EqualValues(t, name, runner.Name)
|
||||
assert.Equal(t, name, runner.Name)
|
||||
|
||||
assert.EqualValues(t, 1, subtle.ConstantTimeCompare([]byte(runner.TokenHash), []byte(auth_model.HashToken(token, runner.TokenSalt))), "the token cannot be verified with the same method as routers/api/actions/runner/interceptor.go as of 8228751c55d6a4263f0fec2932ca16181c09c97d")
|
||||
assert.Equal(t, 1, subtle.ConstantTimeCompare([]byte(runner.TokenHash), []byte(auth_model.HashToken(token, runner.TokenSalt))), "the token cannot be verified with the same method as routers/api/actions/runner/interceptor.go as of 8228751c55d6a4263f0fec2932ca16181c09c97d")
|
||||
}
|
||||
|
||||
// TestActions_RegisterRunner_TokenUpdate tests that a token's secret is updated
|
||||
|
@ -73,19 +73,19 @@ func TestActions_RegisterRunner_CreateWithLabels(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Check that the returned record has been updated, except for the labels
|
||||
assert.EqualValues(t, ownerID, runner.OwnerID)
|
||||
assert.EqualValues(t, repoID, runner.RepoID)
|
||||
assert.EqualValues(t, name, runner.Name)
|
||||
assert.EqualValues(t, version, runner.Version)
|
||||
assert.EqualValues(t, labelsCopy, runner.AgentLabels)
|
||||
assert.Equal(t, ownerID, runner.OwnerID)
|
||||
assert.Equal(t, repoID, runner.RepoID)
|
||||
assert.Equal(t, name, runner.Name)
|
||||
assert.Equal(t, version, runner.Version)
|
||||
assert.Equal(t, labelsCopy, runner.AgentLabels)
|
||||
|
||||
// Check that whatever is in the DB has been updated, except for the labels
|
||||
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: runner.ID})
|
||||
assert.EqualValues(t, ownerID, after.OwnerID)
|
||||
assert.EqualValues(t, repoID, after.RepoID)
|
||||
assert.EqualValues(t, name, after.Name)
|
||||
assert.EqualValues(t, version, after.Version)
|
||||
assert.EqualValues(t, labelsCopy, after.AgentLabels)
|
||||
assert.Equal(t, ownerID, after.OwnerID)
|
||||
assert.Equal(t, repoID, after.RepoID)
|
||||
assert.Equal(t, name, after.Name)
|
||||
assert.Equal(t, version, after.Version)
|
||||
assert.Equal(t, labelsCopy, after.AgentLabels)
|
||||
}
|
||||
|
||||
func TestActions_RegisterRunner_CreateWithoutLabels(t *testing.T) {
|
||||
|
@ -100,19 +100,19 @@ func TestActions_RegisterRunner_CreateWithoutLabels(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Check that the returned record has been updated, except for the labels
|
||||
assert.EqualValues(t, ownerID, runner.OwnerID)
|
||||
assert.EqualValues(t, repoID, runner.RepoID)
|
||||
assert.EqualValues(t, name, runner.Name)
|
||||
assert.EqualValues(t, version, runner.Version)
|
||||
assert.EqualValues(t, []string{}, runner.AgentLabels)
|
||||
assert.Equal(t, ownerID, runner.OwnerID)
|
||||
assert.Equal(t, repoID, runner.RepoID)
|
||||
assert.Equal(t, name, runner.Name)
|
||||
assert.Equal(t, version, runner.Version)
|
||||
assert.Equal(t, []string{}, runner.AgentLabels)
|
||||
|
||||
// Check that whatever is in the DB has been updated, except for the labels
|
||||
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: runner.ID})
|
||||
assert.EqualValues(t, ownerID, after.OwnerID)
|
||||
assert.EqualValues(t, repoID, after.RepoID)
|
||||
assert.EqualValues(t, name, after.Name)
|
||||
assert.EqualValues(t, version, after.Version)
|
||||
assert.EqualValues(t, []string{}, after.AgentLabels)
|
||||
assert.Equal(t, ownerID, after.OwnerID)
|
||||
assert.Equal(t, repoID, after.RepoID)
|
||||
assert.Equal(t, name, after.Name)
|
||||
assert.Equal(t, version, after.Version)
|
||||
assert.Equal(t, []string{}, after.AgentLabels)
|
||||
}
|
||||
|
||||
func TestActions_RegisterRunner_UpdateWithLabels(t *testing.T) {
|
||||
|
@ -132,19 +132,19 @@ func TestActions_RegisterRunner_UpdateWithLabels(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Check that the returned record has been updated
|
||||
assert.EqualValues(t, newOwnerID, runner.OwnerID)
|
||||
assert.EqualValues(t, newRepoID, runner.RepoID)
|
||||
assert.EqualValues(t, newName, runner.Name)
|
||||
assert.EqualValues(t, newVersion, runner.Version)
|
||||
assert.EqualValues(t, labelsCopy, runner.AgentLabels)
|
||||
assert.Equal(t, newOwnerID, runner.OwnerID)
|
||||
assert.Equal(t, newRepoID, runner.RepoID)
|
||||
assert.Equal(t, newName, runner.Name)
|
||||
assert.Equal(t, newVersion, runner.Version)
|
||||
assert.Equal(t, labelsCopy, runner.AgentLabels)
|
||||
|
||||
// Check that whatever is in the DB has been updated
|
||||
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: recordID})
|
||||
assert.EqualValues(t, newOwnerID, after.OwnerID)
|
||||
assert.EqualValues(t, newRepoID, after.RepoID)
|
||||
assert.EqualValues(t, newName, after.Name)
|
||||
assert.EqualValues(t, newVersion, after.Version)
|
||||
assert.EqualValues(t, labelsCopy, after.AgentLabels)
|
||||
assert.Equal(t, newOwnerID, after.OwnerID)
|
||||
assert.Equal(t, newRepoID, after.RepoID)
|
||||
assert.Equal(t, newName, after.Name)
|
||||
assert.Equal(t, newVersion, after.Version)
|
||||
assert.Equal(t, labelsCopy, after.AgentLabels)
|
||||
}
|
||||
|
||||
func TestActions_RegisterRunner_UpdateWithoutLabels(t *testing.T) {
|
||||
|
@ -162,17 +162,17 @@ func TestActions_RegisterRunner_UpdateWithoutLabels(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
// Check that the returned record has been updated, except for the labels
|
||||
assert.EqualValues(t, newOwnerID, runner.OwnerID)
|
||||
assert.EqualValues(t, newRepoID, runner.RepoID)
|
||||
assert.EqualValues(t, newName, runner.Name)
|
||||
assert.EqualValues(t, newVersion, runner.Version)
|
||||
assert.EqualValues(t, before.AgentLabels, runner.AgentLabels)
|
||||
assert.Equal(t, newOwnerID, runner.OwnerID)
|
||||
assert.Equal(t, newRepoID, runner.RepoID)
|
||||
assert.Equal(t, newName, runner.Name)
|
||||
assert.Equal(t, newVersion, runner.Version)
|
||||
assert.Equal(t, before.AgentLabels, runner.AgentLabels)
|
||||
|
||||
// Check that whatever is in the DB has been updated, except for the labels
|
||||
after := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: recordID})
|
||||
assert.EqualValues(t, newOwnerID, after.OwnerID)
|
||||
assert.EqualValues(t, newRepoID, after.RepoID)
|
||||
assert.EqualValues(t, newName, after.Name)
|
||||
assert.EqualValues(t, newVersion, after.Version)
|
||||
assert.EqualValues(t, before.AgentLabels, after.AgentLabels)
|
||||
assert.Equal(t, newOwnerID, after.OwnerID)
|
||||
assert.Equal(t, newRepoID, after.RepoID)
|
||||
assert.Equal(t, newName, after.Name)
|
||||
assert.Equal(t, newVersion, after.Version)
|
||||
assert.Equal(t, before.AgentLabels, after.AgentLabels)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue