1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

Fix mtarName config param handling (#1570)

This commit is contained in:
Stephan Aßmus
2020-05-19 22:02:47 +02:00
committed by GitHub
parent 550651187d
commit ac122a84e7
2 changed files with 6 additions and 6 deletions

View File

@@ -228,15 +228,15 @@ func getMtarName(config mtaBuildOptions, mtaYamlFile string, p piperutils.FileUt
}
if len(mtaID) == 0 {
return "", fmt.Errorf("Invalid mtar name. Was empty")
return "", fmt.Errorf("Invalid mtar ID. Was empty")
}
log.Entry().Debugf("mtar name extracted from file \"%s\": \"%s\"", mtaYamlFile, mtaID)
mtarName = mtaID
mtarName = mtaID + ".mtar"
}
return mtarName + ".mtar", nil
return mtarName, nil
}

View File

@@ -163,7 +163,7 @@ func TestMarBuild(t *testing.T) {
e := mock.ExecMockRunner{}
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtarName: "myName"}
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtarName: "myName.mtar"}
cpe.mtarFilePath = ""
@@ -210,7 +210,7 @@ func TestMarBuild(t *testing.T) {
e := mock.ExecMockRunner{}
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtaJarLocation: "/opt/sap/mta/lib/mta.jar", MtarName: "myName"}
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "classic", BuildTarget: "CF", MtaJarLocation: "/opt/sap/mta/lib/mta.jar", MtarName: "myName.mtar"}
existingFiles := make(map[string]string)
existingFiles["package.json"] = "{\"name\": \"myName\", \"version\": \"1.2.3\"}"
@@ -232,7 +232,7 @@ func TestMarBuild(t *testing.T) {
cpe.mtarFilePath = ""
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "cloudMbt", Platform: "CF", MtarName: "myName"}
options := mtaBuildOptions{ApplicationName: "myApp", MtaBuildTool: "cloudMbt", Platform: "CF", MtarName: "myName.mtar"}
existingFiles := make(map[string]string)
existingFiles["package.json"] = "{\"name\": \"myName\", \"version\": \"1.2.3\"}"