What is the difference between step vs steps in jenkinsfile?

37 views
Skip to first unread message

red 888

unread,
Aug 16, 2017, 1:44:17 PM8/16/17
to Jenkins Users

I'm trying to run xunit and I keep seeing examples with only "step" like this:


step([$class : 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1,
    thresholds: [
        [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'],
        [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
 ],
    tools : [[$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: false, pattern: "TestResults\\*.trx", skipNoTestFiles: false, stopProcessingIfError: true]]
])


But I want to run multiple "steps" inside a stage. I don't understand step vs steps.


For example this isn't working:

stage('Test') {
    steps {
        bat "\"${tool 'VSTestRunner'}\" %WORKSPACE%\\MyApp\\bin\\Debug\\MyAppTest.dll /logger:trx",
        step([$class : 'XUnitPublisher',
            testTimeMargin: '3000',
            thresholdMode: 1,
            thresholds: [
                [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'],
                [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
            ],
            tools : [[$class: 'MSTestJunitHudsonTestType',
                deleteOutputFiles: true,
                failIfNotNew: false,
                pattern: "TestResults\\*.trx",
                skipNoTestFiles: false,
                stopProcessingIfError: true
            ]]
        ])
    }
}
Reply all
Reply to author
Forward
0 new messages