1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Merge remote-tracking branch 'github/master' into HEAD

This commit is contained in:
Marcus Holl 2018-07-13 08:55:15 +02:00
commit b53e1ea539
2 changed files with 6 additions and 2 deletions

View File

@ -95,7 +95,7 @@ steps:
newmanCollection: '**/*.postman_collection.json'
newmanEnvironment: ''
newmanGlobals: ''
newmanRunCommand: "run ${config.newmanCollection} --environment '${config.newmanEnvironment}' --globals '${config.newmanGlobals}' --reporters junit,html --reporter-junit-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()}.xml --reporter-html-export target/newman/TEST-${config.newmanCollection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()}.html"
newmanRunCommand: "run ${config.newmanCollection} --environment '${config.newmanEnvironment}' --globals '${config.newmanGlobals}' --reporters junit,html --reporter-junit-export target/newman/TEST-${collectionDisplayName}.xml --reporter-html-export target/newman/TEST-${collectionDisplayName}.html"
pipelineStashFilesAfterBuild:
runOpaTests: false
stashIncludes:

View File

@ -37,10 +37,14 @@ def call(Map parameters = [:]) {
) {
sh 'npm install newman --global --quiet'
for(String collection : collectionList){
def collectionDisplayName = collection.toString().replace(File.separatorChar,(char)'_').tokenize('.').first()
// resolve templates
def command = SimpleTemplateEngine.newInstance()
.createTemplate(config.newmanRunCommand)
.make([config: config.plus([newmanCollection: collection])]).toString()
.make([
config: config.plus([newmanCollection: collection]),
collectionDisplayName: collectionDisplayName
]).toString()
if(!config.failOnError) command += ' --suppress-exit-code'
sh "newman ${command}"
}