1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-18 05:18:24 +02:00

Pin version of golang BOM to 1.4.0 (#4462)

This commit is contained in:
Ashly Mathew 2023-07-12 17:49:11 +02:00 committed by GitHub
parent ef98a4351f
commit 9a0b84a953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ const (
integrationJsonReport = "integration-report.out"
golangCoberturaPackage = "github.com/boumenot/gocover-cobertura@latest"
golangTestsumPackage = "gotest.tools/gotestsum@latest"
golangCycloneDXPackage = "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest"
golangCycloneDXPackage = "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0"
sbomFilename = "bom-golang.xml"
)

View File

@ -284,7 +284,7 @@ go 1.17`
assert.NoError(t, err)
assert.Equal(t, 3, len(utils.ExecMockRunner.Calls))
assert.Equal(t, "go", utils.ExecMockRunner.Calls[0].Exec)
assert.Equal(t, []string{"install", "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest"}, utils.ExecMockRunner.Calls[0].Params)
assert.Equal(t, []string{"install", "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0"}, utils.ExecMockRunner.Calls[0].Params)
assert.Equal(t, "cyclonedx-gomod", utils.ExecMockRunner.Calls[1].Exec)
assert.Equal(t, []string{"mod", "-licenses", "-test", "-output", "bom-golang.xml", "-output-version", "1.4"}, utils.ExecMockRunner.Calls[1].Params)
assert.Equal(t, "go", utils.ExecMockRunner.Calls[2].Exec)
@ -330,7 +330,7 @@ go 1.17`
CreateBOM: true,
}
utils := newGolangBuildTestsUtils()
utils.ShouldFailOnCommand = map[string]error{"go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest": fmt.Errorf("install failure")}
utils.ShouldFailOnCommand = map[string]error{"go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0": fmt.Errorf("install failure")}
telemetryData := telemetry.CustomData{}
err := runGolangBuild(&config, &telemetryData, utils, &cpe)

View File

@ -29,7 +29,7 @@ func TestGolangIntegrationBuildProject1(t *testing.T) {
container.assertHasOutput(t,
"info golangBuild - running command: go install gotest.tools/gotestsum@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0",
"info golangBuild - running command: gotestsum --junitfile TEST-go.xml --jsonfile unit-report.out -- -coverprofile=cover.out -tags=unit ./...",
"info golangBuild - DONE 8 tests",
"info golangBuild - running command: go tool cover -html cover.out -o coverage.html",
@ -64,7 +64,7 @@ func TestGolangIntegrationBuildProject1MultiPackage(t *testing.T) {
assert.NoError(t, err)
container.assertHasOutput(t, "info golangBuild - running command: go install gotest.tools/gotestsum@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0",
"info golangBuild - running command: gotestsum --junitfile TEST-go.xml --jsonfile unit-report.out -- -coverprofile=cover.out -tags=unit ./...",
"info golangBuild - DONE 8 tests",
"info golangBuild - running command: go tool cover -html cover.out -o coverage.html",
@ -102,7 +102,7 @@ func TestGolangIntegrationBuildProject2(t *testing.T) {
container.assertHasNoOutput(t,
"info golangBuild - running command: go install gotest.tools/gotestsum@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest",
"info golangBuild - running command: go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@v1.4.0",
"info golangBuild - running command: gotestsum --junitfile TEST-go.xml --jsonfile unit-report.out -- -coverprofile=cover.out -tags=unit ./...",
"info golangBuild - running command: go tool cover -html cover.out -o coverage.html",
"info golangBuild - running command: gotestsum --junitfile TEST-integration.xml --jsonfile integration-report.out -- -tags=integration ./...",