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:
parent
dddb5992b9
commit
6a466b28fd
@ -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"
|
||||
)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user