From 153536f5d39fbd3b6b585b9d81a25837758f1978 Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Thu, 12 Jul 2018 23:31:15 +0200 Subject: [PATCH] create collectionDisplayName inside of the step --- vars/newmanExecute.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vars/newmanExecute.groovy b/vars/newmanExecute.groovy index 4bc721318..876622641 100644 --- a/vars/newmanExecute.groovy +++ b/vars/newmanExecute.groovy @@ -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}" }