I needed to do exactly what you do, here's how I setup Jenkins to do this:
- Add the NUnit Plugin to Jenkins
- In your project go to Configure -> Build -> Add a build step
- In the dropdown scroll down to -> Execute Windows Batch Command
- Ensure this step is placed after your MSBuild step
- Add the following, replacing the variables:
Single dll test:
[PathToNUnit]in
unit-console.exe [PathToTestDll]Selenium.Tests.dll
/xml=nunit-result.xml
Multiple dll test using NUnit test projects:
[PathToNUnit]in
unit-console.exe [PathToTests]Selenium.Tests.nunit
/xml=nunit-result.xml
- Under Post-build Actions, tick Publish NUnit test result report
- For the textbox Test report XMLs, enter nunit-result.xml
Once you project has been built, NUNit will now run and the results will be viewable either on the Dashboard(if you hover over the Weather report icon) or on the project page under Last Test Result.
You could also run the command from within Visual Studio or as part of you local build process.
Here's two blog posts I used for reference. I didn't find any that fitted my requirements exactly:
1-Hour Guide to Continuous Integration Setup: Jenkins meets .Net (2011)
Guide to building .NET projects using Hudson (2008)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…