Skip to content

Commit

Permalink
global: upgrade GO to 1.23 golangci-lint to 1.61 (#244)
Browse files Browse the repository at this point in the history
Co-authored-by: nkononov <[email protected]>
  • Loading branch information
kononovn and kononovn authored Oct 8, 2024
1 parent 9256566 commit 469c725
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 32 deletions.
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ run:
# modules-download-mode: readonly

linters-settings:
misspell:
ignore-words:
- "nto"
revive:
rules:
- name: indent-error-flow
Expand Down Expand Up @@ -63,7 +66,7 @@ linters-settings:
statements: 40
unused:
check-exported: true
go: "1.22"
go: "1.23"
stylecheck:
dot-import-whitelist:
- github.com/onsi/gomega
Expand All @@ -86,7 +89,7 @@ linters-settings:
- github.com/openshift-kni/eco-gotests/tests/lca/imagebasedinstall/mgmt/internal/mgmtinittools
- github.com/openshift-kni/eco-gotests/tests/system-tests/diskencryption/internal/diskencryptioninittools
# Select the Go version to target. The default is '1.13'.
go: "1.22"
go: "1.23"
# https://staticcheck.io/docs/options#checks
checks:
- all
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi9/ubi:latest

ARG GO_VER=go1.22.6
ARG GO_VER=go1.23.2
ARG [email protected]
ARG CONTAINERUSER=testuser

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The [eco-gotests](https://github.com/openshift-kni/eco-gotests) is the downstrea
The project is based on golang+[ginkgo](https://onsi.github.io/ginkgo) framework.

### Project requirements
* golang v1.22.x
* golang v1.23.x
* ginkgo v2.x

## eco-gotests
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/openshift-kni/eco-gotests

go 1.22
go 1.23

require (
github.com/Juniper/go-netconf v0.3.0
Expand Down
2 changes: 1 addition & 1 deletion images/cnf/network/eco-gotests-network-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build testcmd bin
FROM docker.io/library/golang:1.22 AS builder
FROM docker.io/library/golang:1.23 AS builder
RUN git clone https://github.com/kononovn/testcmd.git
WORKDIR ./testcmd
ENV CGO_ENABLED=0
Expand Down
2 changes: 1 addition & 1 deletion scripts/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

. "$(dirname "$0")"/common.sh

GOLANGCI_LINT_VERSION="1.56.2"
GOLANGCI_LINT_VERSION="1.61.0"

# IsGoLangCiLintInstalled is used to check whether golangci-lint executable is on the $PATH.
function IsGolangCiLintInstalled() {
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/core/network/internal/netenv/netenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/openshift-kni/eco-goinfra/pkg/mco"
"github.com/openshift-kni/eco-goinfra/pkg/namespace"
"github.com/openshift-kni/eco-goinfra/pkg/nodes"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/pod"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netconfig"
"github.com/openshift-kni/eco-gotests/tests/cnf/core/network/internal/netparam"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ func DefineIterationParams(
doesIPListsHaveEnoughAddresses(ipv6AddrList, nodeExtIPv6AddrList, ipFamily)
}

return "", "", nil, nil, nil, nil, fmt.Errorf(fmt.Sprintf(
"ipStack parameter is invalid allowed values are %s, %s ", netparam.IPV4Family, netparam.IPV6Family))
return "", "", nil, nil, nil, nil, fmt.Errorf(
"ipStack parameter is invalid allowed values are %s, %s ", netparam.IPV4Family, netparam.IPV6Family)
}

func doesIPListsHaveEnoughAddresses(mlbAddrList, nodeExtAddrList []string, ipFamily string) error {
Expand Down
4 changes: 2 additions & 2 deletions tests/cnf/core/network/sriov/tests/externalllymanaged.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ func defineIterationParams(ipFamily string) (clientIPs, serverIPs []string, err
[]string{tsparams.ServerIPv4IPAddress, tsparams.ServerIPv6IPAddress}, nil
}

return nil, nil, fmt.Errorf(fmt.Sprintf(
return nil, nil, fmt.Errorf(
"ipStack parameter %s is invalid; allowed values are %s, %s, %s ",
ipFamily, netparam.IPV4Family, netparam.IPV6Family, netparam.DualIPFamily))
ipFamily, netparam.IPV4Family, netparam.IPV6Family, netparam.DualIPFamily)
}

func getVlanIDAndMaxTxRateForVf(nodeName, sriovInterfaceName string) (maxTxRate, vlanID int) {
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/core/network/sriov/tests/rdmametrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var _ = Describe("rdmaMetrics", Ordered, Label(tsparams.LabelRdmaMetricsTestCase
fmt.Sprintf("Failed to run command %s on node %s",
fmt.Sprintf("ls /sys/bus/pci/devices/%s/infiniband/%s/ports/1/hw_counters",
pciAddress, rdmaDevice), testPod.Object.Spec.NodeName))
Expect(nodeOutput[fmt.Sprintf(testPod.Object.Spec.NodeName)]).To(ContainSubstring("out_of_buffer"),
Expect(nodeOutput[testPod.Object.Spec.NodeName]).To(ContainSubstring("out_of_buffer"),
fmt.Sprintf("Failed to find the counters in the output %s", nodeOutput[testPod.Object.Spec.NodeName]))
})

Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/ran/powermanagement/internal/collect/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/pod"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/stats"
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/ran/powermanagement/internal/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/golang/glog"
"github.com/openshift-kni/eco-goinfra/pkg/mco"
"github.com/openshift-kni/eco-goinfra/pkg/nodes"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/pod"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/ranparam"
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/ran/powermanagement/tests/cpufreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/ranparam"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/version"
Expand Down
2 changes: 1 addition & 1 deletion tests/cnf/ran/powermanagement/tests/powersave.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
. "github.com/onsi/gomega"
"github.com/openshift-kni/eco-goinfra/pkg/mco"
"github.com/openshift-kni/eco-goinfra/pkg/nodes"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/reportxml"
. "github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/raninittools"
"github.com/openshift-kni/eco-gotests/tests/cnf/ran/internal/ranparam"
Expand Down
2 changes: 1 addition & 1 deletion tests/hw-accel/kmm/modules/tests/realtime-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/openshift-kni/eco-goinfra/pkg/kmm"
"github.com/openshift-kni/eco-goinfra/pkg/mco"
"github.com/openshift-kni/eco-goinfra/pkg/namespace"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/reportxml"
"github.com/openshift-kni/eco-goinfra/pkg/serviceaccount"
"github.com/openshift-kni/eco-gotests/tests/hw-accel/kmm/internal/await"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/openshift-kni/eco-goinfra/pkg/clusteroperator"
"github.com/openshift-kni/eco-goinfra/pkg/mco"
"github.com/openshift-kni/eco-goinfra/pkg/nodes"
"github.com/openshift-kni/eco-goinfra/pkg/nto" //nolint:misspell
"github.com/openshift-kni/eco-goinfra/pkg/nto"
"github.com/openshift-kni/eco-goinfra/pkg/service"
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/apiobjectshelper"
"github.com/openshift-kni/eco-gotests/tests/system-tests/vcore/internal/vcoreparams"
Expand All @@ -40,28 +40,28 @@ var (
// VerifyNTOSuite container that contains tests for Node Tuning Operator verification.
func VerifyNTOSuite() {
Describe(
"NTO validation", //nolint:misspell
"NTO validation",
Label(vcoreparams.LabelVCoreOperators), func() {
It(fmt.Sprintf("Verifies %s namespace exists", vcoreparams.NTONamespace),
Label("nto"), VerifyNTONamespaceExists) //nolint:misspell
Label("nto"), VerifyNTONamespaceExists)

It("Verify Node Tuning Operator successfully installed",
Label("nto"), reportxml.ID("63656"), VerifyNTODeployment) //nolint:misspell
Label("nto"), reportxml.ID("63656"), VerifyNTODeployment)

It("Create new performanceprofile",
Label("nto"), reportxml.ID("63741"), CreatePerformanceProfile) //nolint:misspell
Label("nto"), reportxml.ID("63741"), CreatePerformanceProfile)

It("Create new nodes tuning",
Label("nto"), reportxml.ID("63740"), CreateNodesTuning) //nolint:misspell
Label("nto"), reportxml.ID("63740"), CreateNodesTuning)

It("Verify CPU Manager config",
Label("nto"), reportxml.ID("63809"), VerifyCPUManagerConfig) //nolint:misspell
Label("nto"), reportxml.ID("63809"), VerifyCPUManagerConfig)

It("Verify Node Tuning Operator Huge Pages configuration",
Label("nto"), reportxml.ID("60062"), VerifyHugePagesConfig) //nolint:misspell
Label("nto"), reportxml.ID("60062"), VerifyHugePagesConfig)

It("Verify System Reserved memory for user-plane-worker nodes configuration",
Label("nto"), //nolint:misspell
Label("nto"),
reportxml.ID("60047"), SetSystemReservedMemoryForWorkers)
})
}
Expand All @@ -88,7 +88,7 @@ func VerifyNTODeployment(ctx SpecContext) {
vcoreparams.NTODeploymentName, vcoreparams.NTONamespace, err))

glog.V(vcoreparams.VCoreLogLevel).Infof(
"Confirm that NTO %s pod was deployed and running in %s namespace", //nolint:misspell
"Confirm that NTO %s pod was deployed and running in %s namespace",
vcoreparams.NTODeploymentName, vcoreparams.NTONamespace)

ntoPods, err := pod.ListByNamePattern(APIClient, vcoreparams.NTODeploymentName, vcoreparams.NTONamespace)
Expand All @@ -107,7 +107,7 @@ func VerifyNTODeployment(ctx SpecContext) {
ntoPodName, vcoreparams.NTONamespace, ntoPodLog)
}

glog.V(vcoreparams.VCoreLogLevel).Infof("Verify NTO service %s created in the namespace %s", //nolint:misspell
glog.V(vcoreparams.VCoreLogLevel).Infof("Verify NTO service %s created in the namespace %s",
ntoServiceName, vcoreparams.NTONamespace)

ntoService, err := service.Pull(APIClient, ntoServiceName, vcoreparams.NTONamespace)
Expand All @@ -116,7 +116,7 @@ func VerifyNTODeployment(ctx SpecContext) {
Expect(ntoService.Exists()).To(Equal(true), fmt.Sprintf("no service %s was found in the namespace %s",
ntoServiceName, vcoreparams.NTONamespace))

glog.V(vcoreparams.VCoreLogLevel).Infof("Verify NTO service %s created in the namespace %s", //nolint:misspell
glog.V(vcoreparams.VCoreLogLevel).Infof("Verify NTO service %s created in the namespace %s",
ntoServiceName, vcoreparams.NTONamespace)

paoService, err := service.Pull(APIClient, paoServiceName, vcoreparams.NTONamespace)
Expand Down
2 changes: 0 additions & 2 deletions tests/system-tests/vcore/internal/vcorecommon/odf.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ func VerifyODFStorageSystemConfig(ctx SpecContext) {
} // func VerifyODFStorageSystemConfig (ctx SpecContext)

// VerifyOperatorsConfigForODFNodes asserts operators configuration for ODF nodes.
//
//nolint:goconst
func VerifyOperatorsConfigForODFNodes(ctx SpecContext) {
glog.V(vcoreparams.VCoreLogLevel).Infof("Configuring operators for ODF nodes")

Expand Down

0 comments on commit 469c725

Please sign in to comment.