Skip to content

Update common to v3.2.1 to fix gotestsum cmd

What does this MR do?

Add junit report for Go tests (gitlab-org/security-products/ci-templates!326 - merged) added gotestsum to the go test job, which has resulted in failures in the job output:

=== FAIL: scanner TestScanner/ScanProjects (unknown)
[WARN] [2022-09-30T04:04:15Z] [/builds/gitlab-org/security-products/analyzers/gemnasium/scanner/parser/golang/golang.go:35] ▶ Selecting "go.sum" parser for "testdata/depfiles/go/go.sum". False positives may occur. See https://gitlab.com/gitlab-org/gitlab/-/issues/321081.
=== RUN   TestScanner/scanFile
=== FAIL: scanner TestScanner/scanFile/Gemfile.lock (unknown)
=== FAIL: scanner TestScanner/scanFile/pipdeptree.json (unknown)
DONE 334 tests, 5 failures in 64.682s

These failures do not cause the go test job to fail, however, they cause gotestsum to incorrectly populate the MR test widget with false positive failures:

The root cause of the issue is that gotestsum is interpreting coloured log output which has been formatted by common/logutil/format.go as a failure, as described here.

This behaviour has been fixed in v3.2.1 of the common package in Do not color newline in log messages (common!163 - merged).

This MR updates the version of the common package to v3.2.1 to fix this issue and remove false-positives from the MR test widget.

What are the relevant issue numbers?

Fix coloured log output in logutil package of s... (gitlab-org/gitlab#375625 - closed)

Testing

After this change, the go test job passes:

$ gotestsum --junitfile report.xml --format testname -- -race -coverprofile=coverage.txt -covermode atomic ./...
PASS advisory.TestAdvisory_Decode/Minimal (0.00s)
DONE 333 tests in 65.676s

and the MR test widget now reports all tests passing:

Does this MR meet the acceptance criteria?

Edited by Lucas Charles

Merge request reports