Jenkins Job DSL plugin is an extremely nice way to store CI config in repo and vary it from branch to branch.
The question is - is there a natural or close to natural way to run MSTest tests, parse results and display them.
Right now I do a powershell call, but that gives me only logs, not UI integration.
def testSomeProjectJob = job(testSomeProjectJobName) {
steps {
powerShell("& ${vstest} '${root}/SomeProject/SomeProject.Tests/bin/Debug/SomeProject.Tests.dll' ")
}
}
May be there is a publisher or a trick with templating, or some tips of writing a plugin to JOB DSL for that
UPD: final script template for MSTest and VSTest using @daspilker answer, jenkins xUnit Plugin and archiveXUnit
job('RunTests') {
steps {
// VSTEST
powerShell("& ${vstest} 'path/to/Tests.dll' /logger:trx ")
// Or MSBUILD
powerShell("& ${msbuild} /testcontainer:'path/to/Tests.dll' ")
}
publishers {
archiveXUnit {
msTest {
pattern('**/*.trx')
// deleteOutputFiles()
}
}
}
}