Skip to content

Commit

Permalink
Merge branch 'main' into results-google-sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
shirmoran committed Sep 4, 2024
2 parents f28b095 + 78f8ec8 commit 427125f
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 34 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/pre-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ jobs:
run: ./certsuite run --label-filter="${SMOKE_TESTS_LABELS_FILTER}" --output-dir=certsuite-out --log-level="${SMOKE_TESTS_LOG_LEVEL}"

- name: Upload smoke test results as an artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: always()
with:
name: smoke-tests
Expand All @@ -251,7 +251,7 @@ jobs:
run: ./certsuite run --label-filter=preflight --log-level="${SMOKE_TESTS_LOG_LEVEL}"

- name: Upload preflight smoke test results as an artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: always()
with:
name: preflight-smoke-tests
Expand Down Expand Up @@ -387,14 +387,23 @@ jobs:
--label-filter="${SMOKE_TESTS_LABELS_FILTER}"
- name: Run sanity check on collector
id: collector_sanity_check
uses: ./collector/.github/actions/run-sanity-check
with:
working_directory: collector
collector_username: ${COLLECTOR_CIUSER}
collector_password: ${COLLECTOR_CIPASSWORD}
continue-on-error: true

- name: Send chat msg to dev team if collector's sanity check failed.
if: ${{ steps.collector_sanity_check.outcome == 'failure' }}
uses: ./.github/actions/slack-webhook-sender
with:
message: 'Collector sanity check has failed'
slack_webhook: '${{ secrets.SLACK_ALERT_WEBHOOK_URL }}'

- name: Upload container test results as an artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: always()
with:
name: smoke-tests-container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qe-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
outputs: type=docker,dest=/tmp/testimage.tar

- name: Store image as artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: testimage
path: /tmp/testimage.tar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qe-ocp-arm-416.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
outputs: type=docker,dest=/tmp/testimage.tar

- name: Store image as artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: testimage
path: /tmp/testimage.tar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qe-ocp-pre-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
outputs: type=docker,dest=/tmp/testimage.tar

- name: Store image as artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: testimage
path: /tmp/testimage.tar
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: SARIF file
path: results.sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-rhcos-mapping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: make test

- name: Create PR
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7.0.0
env:
GITHUB_TOKEN: ${{ secrets.UPDATE_CERTIFIED_DB_TOKEN }}
with:
Expand Down
13 changes: 5 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ linters-settings:
# do not include the "operation" and "assign"
checks: argument,case,condition,return
govet:
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
disable:
- printf
gosec:
excludes:
- G115
lll:
line-length: 250
maligned:
Expand Down Expand Up @@ -92,7 +90,6 @@ linters:
# - prealloc
# - revive
# - copyloopvar
# - structcheck
# - testpackage
# - wsl
issues:
Expand Down
2 changes: 0 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func PrintBanner() {
type cliCheckLogSniffer struct{}

func isTTY() bool {
//nolint:gosec
return term.IsTerminal(int(os.Stdin.Fd()))
}

Expand Down Expand Up @@ -95,7 +94,6 @@ func updateRunningCheckLine(checkName string, stopChan <-chan bool) {
}

func getTerminalWidth() int {
//nolint:gosec
width, _, _ := term.GetSize(int(os.Stdin.Fd()))
return width
}
Expand Down
2 changes: 1 addition & 1 deletion internal/clientsholder/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (clientsholder *ClientsHolder) ExecCommandContainer(
commandStr := []string{"sh", "-c", command}
var buffOut bytes.Buffer
var buffErr bytes.Buffer
//nolint:govet

log.Debug(fmt.Sprintf("execute command on ns=%s, pod=%s container=%s, cmd: %s", ctx.GetNamespace(), ctx.GetPodName(), ctx.GetContainerName(), strings.Join(commandStr, " ")))
req := clientsholder.K8sClient.CoreV1().RESTClient().
Post().
Expand Down
1 change: 0 additions & 1 deletion internal/results/archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const (
)

func generateZipFileName() string {
//nolint:govet
return fmt.Sprintf(time.Now().Format(tarGzFileNamePrefixLayout) + "-" + tarGzFileNameSuffix)
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/provider/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ func (c *Container) GetUID() (string, error) {
uid = split[len(split)-1]
}
if uid == "" {
//nolint:govet
log.Debug(fmt.Sprintf("could not find uid of %s/%s/%s\n", c.Namespace, c.Podname, c.Name))
return "", errors.New("cannot determine container UID")
}
//nolint:govet
log.Debug(fmt.Sprintf("uid of %s/%s/%s=%s\n", c.Namespace, c.Podname, c.Name, uid))
return uid, nil
}
Expand Down Expand Up @@ -138,7 +136,6 @@ func (c *Container) SetPreflightResults(preflightImageCache map[string]Preflight
}

// Take all of the Preflight logs and stick them into our log.
//nolint:govet
log.Info(logbytes.String())

// Store the Preflight test results into the container's PreflightResults var and into the cache.
Expand Down
1 change: 0 additions & 1 deletion pkg/provider/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ func (op *Operator) SetPreflightResults(env *TestEnvironment) error {
}

// Take all of the preflight logs and stick them into our log.
//nolint:govet
log.Info(logbytes.String())

e := os.RemoveAll("artifacts/")
Expand Down
2 changes: 0 additions & 2 deletions tests/accesscontrol/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,6 @@ func testAutomountServiceToken(check *checksdb.Check, env *provider.TestEnvironm
client := clientsholder.GetClientsHolder()
podPassed, newMsg := rbac.EvaluateAutomountTokens(client.K8sClient.CoreV1(), put)
if !podPassed {
//nolint:govet
check.LogError(newMsg)
nonCompliantObjects = append(nonCompliantObjects, testhelper.NewPodReportObject(put.Namespace, put.Name, newMsg, false))
} else {
Expand Down Expand Up @@ -916,7 +915,6 @@ func testNoSSHDaemonsAllowed(check *checksdb.Check, env *provider.TestEnvironmen
}

// 2. Check if SSH port is listening
//nolint:gosec
sshPortInfo := netutil.PortInfo{PortNumber: int32(sshServicePortNumber), Protocol: sshServicePortProtocol}
listeningPorts, err := netutil.GetListeningPorts(cut)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions tests/lifecycle/scaling/deployment_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func TestScaleDeploymentFunc(t *testing.T) {
for _, tc := range testCases {
var runtimeObjects []runtime.Object
intVar := new(int32)
//nolint:gosec
*intVar = int32(tc.replicaCount)
tempDP := generateDeployment(tc.deploymentName, intVar)
runtimeObjects = append(runtimeObjects, tempDP)
Expand All @@ -89,7 +88,6 @@ func TestScaleDeploymentFunc(t *testing.T) {
// Get the deployment from the fake API
dp, err := c.K8sClient.AppsV1().Deployments("namespace1").Get(context.TODO(), tc.deploymentName, metav1.GetOptions{})
assert.Nil(t, err)
//nolint:gosec
assert.Equal(t, int32(tc.replicaCount), *dp.Spec.Replicas)
}
}
Expand Down Expand Up @@ -144,7 +142,6 @@ func TestScaleHpaDeploymentFunc(t *testing.T) {

for _, tc := range testCases {
intVar := new(int32)
//nolint:gosec
*intVar = int32(tc.replicaCount)
tempDP := generateDeployment(tc.deploymentName, intVar)

Expand Down Expand Up @@ -187,7 +184,6 @@ func TestScaleHpaDeploymentFunc(t *testing.T) {
// Get the deployment from the fake API
hpa, err := c.AutoscalingV1().HorizontalPodAutoscalers("namespace1").Get(context.TODO(), "hpaName", metav1.GetOptions{})
assert.Nil(t, err)
//nolint:gosec
assert.Equal(t, int32(tc.expectedReplicaCount), hpa.Spec.MaxReplicas)
}
}
Expand Down
1 change: 0 additions & 1 deletion tests/lifecycle/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ func testPodsRecreation(check *checksdb.Check, env *provider.TestEnvironment) {
needsPostMortemInfo := true
defer func() {
if needsPostMortemInfo {
//nolint:govet
check.LogDebug(postmortem.Log())
}
// Since we are possible exiting early, we need to make sure we set the result at the end of the function.
Expand Down
1 change: 0 additions & 1 deletion tests/networking/netutil/netutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func parseListeningPorts(cmdOut string) (map[PortInfo]bool, error) {
return nil, fmt.Errorf("string to int conversion error, err: %v", err)
}
protocol := strings.ToUpper(fields[indexProtocol])
//nolint:gosec
portInfo := PortInfo{int32(port), protocol}

portSet[portInfo] = true
Expand Down
1 change: 0 additions & 1 deletion tests/platform/hugepages/hugepages.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ func logMcKernelArgumentsHugepages(hugepagesPerSize map[int]int, defhugepagesz i
for size, count := range hugepagesPerSize {
sb.WriteString(fmt.Sprintf(", size=%dkB - count=%d", size, count))
}
//nolint:govet
log.Info(sb.String())
}

Expand Down
1 change: 0 additions & 1 deletion webserver/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ func runHandler(w http.ResponseWriter, r *http.Request) {
log.SetLogger(log.GetMultiLogger(buf))

jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
//nolint:govet
log.Info(jsonData)
var data RequestedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
Expand Down

0 comments on commit 427125f

Please sign in to comment.