From 4df47de3f29cc11a397bf3f1e4da8176c0b57439 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 18 Oct 2022 14:57:22 +0200 Subject: [PATCH] add nolint to integrationtests, they are going away :tm: Signed-off-by: Kristoffer Dalby --- integration_cli_test.go | 1 + integration_common_test.go | 2 +- integration_embedded_derp_test.go | 5 ++--- integration_general_test.go | 3 ++- integration_oidc_test.go | 3 ++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/integration_cli_test.go b/integration_cli_test.go index 06771483..ee6a9e1f 100644 --- a/integration_cli_test.go +++ b/integration_cli_test.go @@ -1,3 +1,4 @@ +//nolint package headscale import ( diff --git a/integration_common_test.go b/integration_common_test.go index 4b931840..a1658863 100644 --- a/integration_common_test.go +++ b/integration_common_test.go @@ -1,3 +1,4 @@ +//nolint package headscale import ( @@ -326,7 +327,6 @@ func GetEnvBool(key string) (bool, error) { func GetFirstOrCreateNetwork(pool *dockertest.Pool, name string) (dockertest.Network, error) { networks, err := pool.NetworksByName(name) if err != nil || len(networks) == 0 { - if _, err := pool.CreateNetwork(name); err == nil { // Create does not give us an updated version of the resource, so we need to // get it again. diff --git a/integration_embedded_derp_test.go b/integration_embedded_derp_test.go index 0b7a8d27..5bd6deed 100644 --- a/integration_embedded_derp_test.go +++ b/integration_embedded_derp_test.go @@ -1,3 +1,4 @@ +//nolint package headscale import ( @@ -15,13 +16,12 @@ import ( "testing" "time" + "github.com/ccding/go-stun/stun" v1 "github.com/juanfont/headscale/gen/go/headscale/v1" "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - - "github.com/ccding/go-stun/stun" ) const ( @@ -122,7 +122,6 @@ func (s *IntegrationDERPTestSuite) SetupSuite() { } headscaleOptions := &dockertest.RunOptions{ - Name: headscaleDerpHostname, Mounts: []string{ fmt.Sprintf( diff --git a/integration_general_test.go b/integration_general_test.go index ad92a2b2..52bfddd4 100644 --- a/integration_general_test.go +++ b/integration_general_test.go @@ -1,3 +1,4 @@ +//nolint package headscale import ( @@ -506,7 +507,7 @@ func getIPsfromIPNstate(status ipnstate.Status) []netip.Addr { return ips } -// TODO: Adopt test for cross communication between namespaces +// TODO: Adopt test for cross communication between namespaces. func (s *IntegrationTestSuite) TestPingAllPeersByAddress() { for _, scales := range s.namespaces { ips, err := getIPs(scales.tailscales) diff --git a/integration_oidc_test.go b/integration_oidc_test.go index 2f4d7ddf..8ca46db7 100644 --- a/integration_oidc_test.go +++ b/integration_oidc_test.go @@ -1,3 +1,4 @@ +//nolint package headscale import ( @@ -199,7 +200,7 @@ oidc: log.Println(config) configPath := path.Join(currentPath, "integration_test/etc_oidc/config.yaml") - err = os.WriteFile(configPath, []byte(config), 0644) + err = os.WriteFile(configPath, []byte(config), 0o644) if err != nil { s.FailNow(fmt.Sprintf("Could not write config: %s", err), "") }