Why Running Test, Visual Studio executes full solution Rebuild - visual-studio

This problem is only when I right-click on exact test, and call Run Tests.
When I build projects, including project with tests, VS build only dependencies.
Is this normal?

Related

How to run unit tests in TFS (using vNext)

I have the following project in my Visual Studio 2015 solution. I want to execute jasmine tests as part of our TFS CI build. I can run my tests successfully when I open the SpecRunner.html file although I'm failing to get them to run as part of the TFS build. I've included a screen shot of my TFS build step definition. The build is successful but the tests are not executed.
Please advise, any help greatly appreciated.
Many thanks,
Project and file locations
TFS build step
First make sure your environment on the build sever is set correct. You could manually run the test on the build server.
To use a NuGet package for the Chutzpah test runner , then you can avoid having to manually unpack the VSIX and get it into source control to deploy it to the build host.
About the detail step and build definition you could take a look at this tutorial: nUnit and Jasmine.JS unit tests in TFS/VSO vNext build

Unit Tests are failing on a "Build failed" in the Session window with no message providing a reason for failure in Visual Studios 2010

I had recently installed VS 2010 on my local machine, and cannot seem to get Resharper 5.1 and the unit tests to work correctly.
Whenever I try and run Unit tests I get a "Build failed" with the test icon remaining gray, but with no info in the output window and no discernible reason why.
The Unit Tests run perfectly fine when doing a nant build.
Running a previous branch of the code on VS 2008 does not have this same issue as a result.
Any ideas?
Check your build configuration. If you're using a build configuration that is set to not build your test projects (like your release configuration) then the Resharper test runner will fail this way. The output looks like a perfectly successful build but if you inspect the output you'll find your tests are not in it.
Another symptom of this issue is if you set the test runner to not build as suggested above, next time you attempt to run the test it will be crossed out in the test runner.
Build configurations can be found in Build->Configuration Manager in Visual Studio.
If you change the build settings to 'never build' in the unit test sessions window, it works ok (providing you pre-build the dll using visual studio). It appears to be a Resharper bug.
In my case this did solve the issue:
http://www.shirmanov.com/2011/07/project-has-not-been-built-resharper.html
I had the UnitTests set "to not build" in my solution configuration.
The above mentioned article shows this very detailed.
In my case I was missing a DLL that was not added to the project. I added it, cleaned and build and everything was okay.
Verify in Visual Studio Configuration Manager that your test projects are marked to be build.

How can I run all NUnit Tests in Team City?

We are using TeamCity 6.0 to build VS C# solutions each commit.
Once the build is complete, a different test TC project runs. So that developers can add/remove/edit VS unit test projects, how can I make TeamCity use the the sln file or search for test dll's?
I don't want to have to edit the build each time a new test project is added to the VS solution.
Run tests from: **\*Test*.dll Doesn't appear to work, it only get s the first Test (which is currently failing)
Fixed :) -
RTFL (Read the log!)
Run tests from: **\bin\debug\*Test*.dll

Running Unit Test Projects on TFS 2010. Team Build 2010 Is Not Compiling Test DLLs

I have set up a TFS 2010 Team Build Configuration to run continuous builds.
I currently have 2 Test Projects that run inside Visual Studio 2010 IDE with no problems.
When I queue the solution (with the test projects) to build, the build log reports:
"No Test Results".
My Build Process parameters Automated Test Rule matches my test assembly names:
Run tests in assemblies matching **\*_Test.dll.
After inspecting the Build folder C:/Builds/2/[ProjectName]/[BuildName]/Binaries, I noticed that there were no .dll/.pdb files for my test projects built; even though all other project required dlls are in here.
The Test Project folders do exist in C:/Builds/2/[ProjectName/[BuildName]/Sources.
My Build Process parameters referenced under "Items to Build" => "Configurations to Build" :
Any CPU|Relase
Under Configuration Manager for my soltuion, for Any CPU and Release, I Do have my Test Projects checked off under the Build column.
From all of the documentation I have read, my tests should be running, but from the above inspection it appears that they are not even building.
Any insight or ideas into getting these unit test projects to compile and run on my TFS 2010 Build Server would be greatly appreciated.
Thanks!
When setting up the build, you can point to the vsmdi file instead of putting in the wildcard. Does that yield the same result?

Visual Studio and Google Test: Forcing Re-Run of Test Project When Dependencies Change

I have a set of Google Test-based unit tests for a native C++ DLL I'm developing. The DLL is in its own project, and the test project is dependent upon it. The test project has a Post-Build Event script that runs the tests.
My problem: Whenever the test project gets rebuilt, it runs the tests as expected. However, making a change to the dependent DLL does not always cause the test project to be rebuilt. Specifically, it seems that if none of the DLL's header files change, Visual Studio decides that the test project doesn't need to be rebuilt.
Is there any way to force Visual Studio to rebuild the test project, or to run the post-build event, whenever the DLL gets rebuilt?
I can force the tests to be re-run by right-clicking one of the files in the test project and choosing the Compile menu item, then doing a build. I'd prefer to eliminate that manual-and-often-forgotten step.
I suspect I could get the result I want if I were to include the DLL project's source files in my test project, but I'd really like to run the tests against the actual DLL.
Related but unhelpful question: How to setup Google C++ Testing Framework (gtest) on Visual Studio 2005

Resources