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:
commit
b53e1ea539
@ -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:
|
||||
|
@ -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}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user