سؤال

I have a VSO (f.k.a TFS) Git project that builds and deploys properly but can't find the unit tests in the solution.

This is the message I see...

No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

In my build definition I specify

 - Run tests in test sources matching **\Test*.dll, Target platform: 'X86'

My solution structure is like this

/Tests.Unit.ProjectName/Tests.Unit.ProjectName.csproj
/ProjectName/ProjectName.csproj
هل كانت مفيدة؟

المحلول

Another option is to install the NUnit Test Adapter for VS2012 and VS2013 NuGet package in the unit test project. The build server will find it there. No other changes needed.

نصائح أخرى

To run NUnit tests, the build system needs to be told where it can find the 3rd party test runner assemblies. Currently it can't load those from a Git Repository. But... It can load them from a Team Foundation Source Control folder in another Team Project. So simply create an empty project using the standard source control and reference the assemblies from there.

In this doc, you're explained how to configure Team Build to load nUnit tests. The basic thing is that you need to copy the Test Runner assembles and stick them in a TFVC repository. You then need to tell the Build Controller where it can find these assemblies.

The hosted build controller can load these assemblies from any team project within your VSO account, so just create a second project which can store these.

See also:

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top