mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Fix mtarName config param handling (#1570)
This commit is contained in:
parent
550651187d
commit
ac122a84e7
@ -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
|
||||
|
||||
}
|
||||
|
||||
|
@ -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\"}"
|
||||
|
Loading…
Reference in New Issue
Block a user