Jenkins job dsl and MSTest integration Jenkins job dsl and MSTest integration jenkins jenkins

Jenkins job dsl and MSTest integration


Using a PowerShell step is a good start. Install the xUnit Plugin to parse and display the results. It can parse all sorts of test results including MSTest. And you can use the DSL to configure the plugin.

Example:

job('example') {  steps {    powerShell('...')  }  publishers {    archiveXUnit {      msTest {        pattern('path/to/test/results')      }    }  }}


Its for VSTest but I had to end up using the configure block to be able to use it in the DSL jobs.

static Closure useVsTest(List<String> dlls) { return { it / 'builders' << 'org.jenkinsci.plugins.vstest__runner.VsTestBuilder' { vsTestName 'VS 14.0' testFiles dlls.join('\n') settings '' testCaseFilter '' enablecodecoverage false useVsixExtensions true platform 'x86' otherPlatform '' framework 'framework45' otherFramework '' logger 'trx' otherLogger '' cmdLineArgs '/TestAdapterPath:"."' failBuild true } } }