Visual Studio 2012 doesn't find tests from a project - testing

I know that this question has been answered here, Visual Studio 2013 doesn't discover unit tests , and I also have searched at many forums, but after 6 hours, I still haven't found a solution for this.
In a solution with several projects, I have some test classes in almost all projects. Tests are done with the library Microsoft.VisualStudio.TestTools.UnitTesting (10.0) of Microsoft. I also have Resharped installed. Since today I can't execute test methods from a project. The tests of the other class are being executed right, but in one class are not being executed anymore.
If I execute tests with Resharper I get this message error: Inconclusive: Test wasn't run.
If I disable Resharper and execute tests with VS I don't get any message error, but tests don't execute.
I have checked all these solutions but not any of them work:
Disable Resharper
Clear test cache
Remove temp directory from my system drive
Enable/Disable shadow-copy
To check that the directory of the project is not shared.
To delete .suo file from solution
And tests of this .dll not yet work.
Any suggestion?
Thank you very much.

It's already solved. It was because Nuget dependency conflicts.

Related

Run Xamarin android unit tests for result

I had a question regarding the Test APK topic.
Is there a way to use the tests/RunApkTests.targets and
build-tools/scripts/TestApks.targets
files. so I can reuse the targets to run my own android unit tests and get results as part as our continuous integration?
I tried using the NUnit Tutorial with no success. I also created an issue here but I kept researching and found some potentially useful targets there.
I'd rather use these targets through a nuget package as opposed to manually downloading the target files and their associated files.
Any suggestions?
Thank you for your time!

Fail build on static code analysis warnings with msbuild and bamboo

Using bamboo v5.7 with msbuild v12, how do I fail a build if there are any static code analysis warnings? We do have our projects all set to treat all warnings as errors so the project itself doesn't build, but bamboo is not detecting this and continues on.
This seems basic, what might I be doing wrong?
The simple answer is you are doing nothing wrong, nor are you missing anything.
While it seems like basic functionality, Bamboo's MSBuild task currently doesn't support reading, reporting or failing the build on Warnings or Errors. The task only fails because MSBuild (or XBuild if you are using Mono) returns with an error code when a compiler error occurs.
Also, MSBuild doesn't actually support failing on all warnings either, as you can see here.
You have a couple options.
You can use one of the options in the referenced post
You could roll your own MSBuild log parser plugin using Atlassian's Plugin SDK.
You could make a simple script that is executed after the build, reads the logs and returns a non-zero integer if there were compiler warnings.
You can vote for the issue in the Atlassian Jira and also for the related issue for parsing build details.
Whatever your solution, I hope you share it with the many of us that have run into the same problem. It seems to be something quite common, so I was surprised there wasn't an issue already open for this in Atlassian's Jira instance
For VS 2008 and later, a new project setting was added for this. See this link.

Can I use StopOnFirstFailure to halt building of an sln file with MSBuild?

We build our solution using msbuild 4.0 from TeamCity. Our continuous build uses up quite a lot of resources, both on the build machine, and on our central signing and obfuscation servers. One thing I've noticed is that even when a project fails to compile, the build continues, and other projects that do compile get signed and obfuscated.
Is there some way to make the build halt as soon as something fails?
The MsBuild task actually supports a parameter StopOnFirstFailure. However, I can't seem to get it to have any effect.
Can I use this feature to do what I need? I'm prepared to edit e.g. the Microsoft.Common.Targets file on the build servers.
I found this answer on StackOverflow that involves emitting a proj file from the solution and then editing it. I guess I could automate that process on our build servers, but it seems a lot of work to achieve a fairly basic requirement.

Very long build time in Visual Studio

I've a solution with 15 projects (14 class libraries and one web application). Each class library has corresponding test project (i.e. if I have MyApp.Services project there exists MyApp.Services.Tests -- using NUnit). Everything is written in VB.NET. The problem is that when VS tries to compile any of *.Tests project it stops responding (the bigger the project the longer the period without reposnse). I don't know where to start looking for an issue. I'll add that I've R# 4.5 installed.
UPDATE 1:
Is there any way to benchmark a build in visual studio? To get build times for every project?
UPDATE 2:
It seems that there is no difference after disabling R#.
Try turning on verbose logging for the build
Tools...Options...Projects and Solutions...Build and Run..."MSBuild project build output verbosity"
This should help you get a better picture of what is going on.
Disabling Resharper will probably help.
As for the benchmark, try building with msbuild with the following options, it will print statistics on build process at the end.
msbuild yoursolution.sln /verbosity:diagnostic
Try closing the tool panes associated with unit testing.
Have you tried disabling Resharper 4.5, using the Tools->Addins menu, and tried building again?
Also, is there a difference in time if you shutdown VS, restart it and load your solution and try building again before you do anything else. It might be that the build times get slower over time?

Using MSTest with CruiseControl.NET

We have been using CruiseControl for quite a while with NUnit and NAnt. For a recent project we decided to use the testing framework that comes with Visual Studio, which so far has been adequate.
I'm attempting to get the solution running in CruiseControl. I've finally got the build itself to work; however, I have been unable to get any tests to show up in the CruiseControl interface despite adding custom build tasks and components designed to do just that. Does anyone have a definitive link out there to instructions on getting this set up?
Not sure if that helps (i found the ccnet Documentation somewhat unhelpful at times):
Using CruiseControl.NET with MSTest
The CC.Net interface is generated via an XSL transform on your XML files put together as specified in the ccnet.config file for your projects. The XSL is already written for things like FxCop - check your server's CC xsl directory for examples - shouldn't be too hard to write your own to add in the info - just remember to add the XML output from your tests into the main log.