Fix lint in integration/client

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2023-10-27 21:37:44 -07:00
parent ddd73ad300
commit abfc8be530
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB
5 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,8 @@ issues:
- path: 'archive[\\/]tarheader[\\/]' - path: 'archive[\\/]tarheader[\\/]'
# conversion is necessary on Linux, unnecessary on macOS # conversion is necessary on Linux, unnecessary on macOS
text: "unnecessary conversion" text: "unnecessary conversion"
- path: 'integration[\\/]client'
text: "dot-imports:"
- linters: - linters:
- revive - revive
text: "if-return" text: "if-return"
@ -63,6 +65,8 @@ linters-settings:
- G306 - G306
- G402 - G402
- G404 - G404
nolintlint:
allow-unused: true
run: run:
timeout: 8m timeout: 8m

View File

@ -33,6 +33,7 @@ const (
testNamespace = "testing" testNamespace = "testing"
) )
//nolint:unused // some variables used in fuzz but not all platforms
var ( var (
address string address string
ctrdStdioFilePath string ctrdStdioFilePath string

View File

@ -18,6 +18,7 @@
package client package client
//nolint:unused // some variables used for fuzz
const ( const (
defaultRoot = "/var/lib/containerd-test" defaultRoot = "/var/lib/containerd-test"
defaultState = "/run/containerd-test" defaultState = "/run/containerd-test"

View File

@ -25,6 +25,7 @@ import (
_ "github.com/Microsoft/hcsshim/test/functional/manifest" // For rsrc_amd64.syso _ "github.com/Microsoft/hcsshim/test/functional/manifest" // For rsrc_amd64.syso
) )
//nolint:unused // some variables used for fuzz
const ( const (
defaultAddress = `\\.\pipe\containerd-containerd-test` defaultAddress = `\\.\pipe\containerd-containerd-test`
) )

View File

@ -41,7 +41,6 @@ import (
exec "golang.org/x/sys/execabs" exec "golang.org/x/sys/execabs"
) )
//nolint:unused // Ignore on non-Linux
func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, func()) { func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, func()) {
if testing.Short() { if testing.Short() {
t.Skip() t.Skip()
@ -263,11 +262,6 @@ func testRestartMonitorPausedTaskWithAlways(t *testing.T, client *Client, interv
t.Skip("Pause task is not supported on Windows") t.Skip("Pause task is not supported on Windows")
} }
const (
epsilon = 1 * time.Second
count = 20
)
var ( var (
ctx, cancel = testContext(t) ctx, cancel = testContext(t)
id = strings.ReplaceAll(t.Name(), "/", "_") id = strings.ReplaceAll(t.Name(), "/", "_")