golangci-lint(unconvert): fix test files (#7608)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
pull/7670/head
Matthieu MOREL 2024-07-16 15:27:15 +02:00 committed by GitHub
parent 2b018272e6
commit 917b55e107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 6 deletions

View File

@ -347,7 +347,6 @@ issues:
- govet
- staticcheck
- stylecheck
- unconvert
- unparam
- unused
- path: test/
@ -359,7 +358,6 @@ issues:
- nilerr
- staticcheck
- stylecheck
- unconvert
- unparam
- unused

View File

@ -43,7 +43,7 @@ func TestThrottle_ShouldOutput(t *testing.T) {
for _, tc := range testCases {
// Setup
p.InitThrottle(tc.interval)
p.outputThrottle.throttle = int64(tc.throttle)
p.outputThrottle.throttle = tc.throttle
// Perform the test
output := p.outputThrottle.ShouldOutput()
@ -71,8 +71,8 @@ func TestProgress(t *testing.T) {
for _, tc := range testCases {
// Setup
p.InitThrottle(tc.interval)
p.outputThrottle.throttle = int64(tc.throttle)
p.InitThrottle(time.Duration(time.Second))
p.outputThrottle.throttle = tc.throttle
p.InitThrottle(time.Second)
// All below calls put together for the implementation are empty or just very simple and just want to cover testing
// If wanting to write unit tests for some functions could remove it and with writing new function alone
p.UpdateProgress()

View File

@ -50,7 +50,7 @@ func SSRTest() {
})
It(fmt.Sprintf("Should create an ssr object in the %s namespace and later removed by controller", veleroCfg.VeleroNamespace), func() {
ctx, ctxCancel := context.WithTimeout(context.Background(), time.Duration(time.Minute*10))
ctx, ctxCancel := context.WithTimeout(context.Background(), time.Minute*10)
defer ctxCancel()
defer DeleteNamespace(context.TODO(), *veleroCfg.ClientToInstallVelero, testNS, false)
By(fmt.Sprintf("Create %s namespace", testNS))