Ray Cheng
Ray Cheng

Reputation: 12576

Running NUnit tests written in C# with Jenkins on Linux

Is it possible to run tests (written in C# with NUnit) with Jenkins on Linux OS?

I can find a lot of info on running NUnit tests with Jenkins but can't find any speak of my situation.

UPDATE

Looks like it's possible. I'll need to use a Master Jenkins in Linux to run a Slave Jenkins in Windows. Described in the article.

Upvotes: 8

Views: 3160

Answers (2)

Tristan
Tristan

Reputation: 661

This turned out to be relatively painless using mono on Linux

1) Install NUnit Console.

sudo apt-get install monodevelop-nunit

2) Under Build in your Jenkins project "Add build step" "Execute shell" after your MSBuild step

cd "$WORKSPACE"
# so nunit does not fail on file operations
export MONO_IOMAP=all
nunit-console ./UnitTests/UnitTests.csproj

The only problem I ran into were failing tests involving NancyFx due to Nancy trying to access the projects bin/Debug directory. (The project runs normally with mono under the same environment setup) This turned out not to be a problem as we moved away from Nancy.

Upvotes: 2

Ray Cheng
Ray Cheng

Reputation: 12576

Looks like it's possible. I'll need to use a Master Jenkins in Linux to run a Slave Jenkins in Windows. Described in the article.

Upvotes: 2

Related Questions