Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x](backport #2705) [updatecli] Update hermit and pre-commit dependencies #2710

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ linters:
- containedctx
- contextcheck
- exhaustruct
- exportloopref
- copyloopvar
- fatcontext
- gci
- gocritic
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ repos:
files: deploy/cloudformation/.*yml

- repo: https://github.com/aws-cloudformation/cfn-lint
rev: v1.18.3
rev: v1.18.4
hooks:
- id: cfn-python-lint
files: deploy/cloudformation/.*.yml
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion bin/aws
2 changes: 1 addition & 1 deletion bin/aws_completer
2 changes: 1 addition & 1 deletion bin/bq
2 changes: 1 addition & 1 deletion bin/docker-credential-gcloud
2 changes: 1 addition & 1 deletion bin/gcloud
2 changes: 1 addition & 1 deletion bin/gh
2 changes: 1 addition & 1 deletion bin/git-credential-gcloud.sh
2 changes: 1 addition & 1 deletion bin/golangci-lint
2 changes: 1 addition & 1 deletion bin/gsutil
2 changes: 1 addition & 1 deletion bin/kind
1 change: 0 additions & 1 deletion internal/flavors/benchmark/aws_org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func TestAWSOrg_Initialize(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/flavors/benchmark/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func TestAWS_Initialize(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
6 changes: 3 additions & 3 deletions internal/flavors/benchmark/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ func calculateFetcherTimeout(period time.Duration) time.Duration {
roundedHours := math.Round(period.Hours() * 0.7)
to := time.Duration(roundedHours) * time.Hour

const min = 3 * time.Hour
if to < min {
return min
const minTimeout = 3 * time.Hour
if to < minTimeout {
return minTimeout
}

return to
Expand Down
1 change: 0 additions & 1 deletion internal/flavors/benchmark/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestAzure_Initialize(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tt := tt
t.Parallel()

testInitialize(t, &Azure{
Expand Down
1 change: 0 additions & 1 deletion internal/flavors/benchmark/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func TestEKS_Initialize(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/flavors/benchmark/gcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ func TestGCP_Initialize(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
tt := tt
t.Parallel()

testInitialize(t, &GCP{
Expand Down
1 change: 0 additions & 1 deletion internal/flavors/benchmark/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func TestK8S_Initialize(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/launcher/launcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ func (s *LauncherTestSuite) TestWaitForUpdates() {
}

for _, tt := range testcases {
tt := tt
s.Run(tt.name, func() {
mocks := s.initMocks()
sut := s.newLauncher(mocks, beaterMockCreator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func TestKeyVaultEnricher(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockProvider := azurelib.NewMockProviderAPI(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ func TestStorageAccountEnricher(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
cmd := cycle.Metadata{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func TestAzureInsightsBatchAssetFetcher(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
m := azurelib.NewMockProviderAPI(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ func TestAzureLocationsNetworkWatcherAssetBatchFetcher_Fetch(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
m := azurelib.NewMockProviderAPI(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ func TestAzureSecurityAssetFetcher(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
// tear up
m := azurelib.NewMockProviderAPI(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ func TestExtractCommandName(t *testing.T) {
}

for _, tc := range tests {
tc := tc
name := strings.ReplaceAll(tc.cmd, "/", "|") // For readability, because tests are also hierarchical with '/'.
t.Run(name, func(t *testing.T) {
got := extractCommandName(tc.cmd)
Expand Down
17 changes: 10 additions & 7 deletions internal/resources/providers/awslib/kms/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package kms
import (
"context"
"errors"
"fmt"
"testing"

kmsClient "github.com/aws/aws-sdk-go-v2/service/kms"
Expand All @@ -35,8 +34,10 @@ import (
type ProviderTestSuite struct {
suite.Suite
}
type mocks [2][]any
type kmsClientMockReturnVals map[string][]mocks
type (
mocks [2][]any
kmsClientMockReturnVals map[string][]mocks
)

func TestProviderTestSuite(t *testing.T) {
s := new(ProviderTestSuite)
Expand All @@ -47,11 +48,13 @@ func (s *ProviderTestSuite) SetupTest() {}

func (s *ProviderTestSuite) TearDownTest() {}

var keyId1 = "21c0ba99-3a6c-4f72-8ef8-8118d4804710"
var keyId2 = "21c0ba99-3a6c-4f72-8ef8-8118d4804711"
var (
keyId1 = "21c0ba99-3a6c-4f72-8ef8-8118d4804710"
keyId2 = "21c0ba99-3a6c-4f72-8ef8-8118d4804711"
)

func (s *ProviderTestSuite) TestProvider_DescribeSymmetricKeys() {
var tests = []struct {
tests := []struct {
name string
regions []string
kmsClientMockReturnVals kmsClientMockReturnVals
Expand Down Expand Up @@ -181,7 +184,7 @@ func (s *ProviderTestSuite) TestProvider_DescribeSymmetricKeys() {

// Using `ElementsMatch` instead of the usual `Equals` since iterating over the regions map does not produce a
// guaranteed order
s.ElementsMatch(test.expected, results, fmt.Sprintf("Test '%s' failed, elements do not match", test.name))
s.ElementsMatch(test.expected, results, "Test '%s' failed, elements do not match", test.name)
}
}

Expand Down
25 changes: 14 additions & 11 deletions internal/resources/providers/awslib/s3/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package s3
import (
"context"
"errors"
"fmt"
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -39,9 +38,11 @@ import (
type ProviderTestSuite struct {
suite.Suite
}
type mocks [2][]any
type s3ClientMockReturnVals map[string][]mocks
type s3ControlClientMockReturnVals map[string]mocks
type (
mocks [2][]any
s3ClientMockReturnVals map[string][]mocks
s3ControlClientMockReturnVals map[string]mocks
)

func TestProviderTestSuite(t *testing.T) {
s := new(ProviderTestSuite)
Expand All @@ -52,14 +53,16 @@ func (s *ProviderTestSuite) SetupTest() {}

func (s *ProviderTestSuite) TearDownTest() {}

var bucketName = "MyBucket"
var secondBucketName = "MyAnotherBucket"
var region types.BucketLocationConstraint = "eu-west-1"
var bucketPolicy BucketPolicy = map[string]any{"foo": "bar"}
var bucketPolicyString = "{\"foo\": \"bar\"}"
var (
bucketName = "MyBucket"
secondBucketName = "MyAnotherBucket"
region types.BucketLocationConstraint = "eu-west-1"
bucketPolicy BucketPolicy = map[string]any{"foo": "bar"}
bucketPolicyString = "{\"foo\": \"bar\"}"
)

func (s *ProviderTestSuite) TestProvider_DescribeBuckets() {
var tests = []struct {
tests := []struct {
name string
regions []string
s3ClientMockReturnVals s3ClientMockReturnVals
Expand Down Expand Up @@ -526,6 +529,6 @@ func (s *ProviderTestSuite) TestProvider_DescribeBuckets() {

// Using `ElementsMatch` instead of the usual `Equals` since iterating over the regions map does not produce a
// guaranteed order
s.ElementsMatch(test.expected, results, fmt.Sprintf("Test '%s' failed, elements do not match", test.name))
s.ElementsMatch(test.expected, results, "Test '%s' failed, elements do not match", test.name)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func TestGetAppServiceAuthSettings(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockWrapper := &mockAzureAppServiceWrapper{}
mockWrapper.Test(t)
Expand Down Expand Up @@ -284,7 +283,6 @@ func TestGetAppServiceSiteConfig(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockWrapper := &mockAzureAppServiceWrapper{}
mockWrapper.Test(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ func TestListKeyVaultDiagnosticSettings(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockWrapper := &mockAzureKeyVaultWrapper{}
mockWrapper.Test(t)
Expand Down Expand Up @@ -283,7 +282,6 @@ func TestListKeyVaultKeys(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockWrapper := &mockAzureKeyVaultWrapper{}
mockWrapper.Test(t)
Expand Down Expand Up @@ -403,7 +401,6 @@ func TestListKeyVaultSecrets(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
mockWrapper := &mockAzureKeyVaultWrapper{}
mockWrapper.Test(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func TestReadPager(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
pagerHandlerMock := runtime.PagingHandler[int]{
More: tc.moreFn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func TestListSecurityContacts(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
log := testhelper.NewLogger(t)

Expand Down Expand Up @@ -258,7 +257,6 @@ func TestListAutoProvisioningSettings(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
log := testhelper.NewLogger(t)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ func TestListSQLFirewallRules(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
fakeSrv := &fake.FirewallRulesServer{}
fakeSrv.NewListByServerPager = func(_, _ string, _ *armsql.FirewallRulesClientListByServerOptions) azfake.PagerResponder[armsql.FirewallRulesClientListByServerResponse] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func TestTransformStorageAccounts(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
got, err := transformStorageAccounts(tc.inputServicesPages, tc.inputSubscriptionId)
if tc.expectError {
Expand Down Expand Up @@ -152,7 +151,6 @@ func TestTransformBlobServices(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
got, err := transformBlobServices(tc.inputServicesPages, tc.inputStorageAccount)
if tc.expectError {
Expand Down Expand Up @@ -694,7 +692,6 @@ func TestListDiagnosticSettingsAssetTypes(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
t.Parallel()
provider := &storageAccountProvider{
Expand Down
1 change: 0 additions & 1 deletion internal/resources/utils/strings/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func TestFromMap(t *testing.T) {
}

for name, tc := range tests {
tc := tc
t.Run(name, func(t *testing.T) {
got := FromMap(tc.input, tc.inputKey)
require.Equal(t, tc.expected, got)
Expand Down
Loading
Loading