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

fix(golangBuild): cyclonedx-gomod import path (#3541)

* fix(golangBuild): cyclonedx-gomod import path

* fix tests
This commit is contained in:
Christian Volk 2022-02-14 12:07:25 +01:00 committed by GitHub
parent dddb5992b9
commit 6a466b28fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ const (
golangIntegrationTestOutput = "TEST-integration.xml"
golangCoberturaPackage = "github.com/boumenot/gocover-cobertura@latest"
golangTestsumPackage = "gotest.tools/gotestsum@latest"
golangCycloneDXPackage = "github.com/CycloneDX/cyclonedx-gomod@latest"
golangCycloneDXPackage = "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest"
sbomFilename = "bom.xml"
)

View File

@ -202,7 +202,7 @@ func TestRunGolangBuild(t *testing.T) {
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@latest"}, utils.ExecMockRunner.Calls[0].Params)
assert.Equal(t, []string{"install", "github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest"}, utils.ExecMockRunner.Calls[0].Params)
assert.Equal(t, "cyclonedx-gomod", utils.ExecMockRunner.Calls[1].Exec)
assert.Equal(t, []string{"mod", "-licenses", "-test", "-output", "bom.xml"}, utils.ExecMockRunner.Calls[1].Params)
assert.Equal(t, "go", utils.ExecMockRunner.Calls[2].Exec)
@ -226,7 +226,7 @@ func TestRunGolangBuild(t *testing.T) {
CreateBOM: true,
}
utils := newGolangBuildTestsUtils()
utils.ShouldFailOnCommand = map[string]error{"go install github.com/CycloneDX/cyclonedx-gomod@latest": fmt.Errorf("install failure")}
utils.ShouldFailOnCommand = map[string]error{"go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest": fmt.Errorf("install failure")}
telemetryData := telemetry.CustomData{}
err := runGolangBuild(&config, &telemetryData, utils)