Auto run tests after Release build - unit-testing

I want to test my app only when I build it under Release configuration.
I am using Visual Studio 2013, and I haven't TFS.
I saw an option in Test > Test Settings > Run Tests After Build. Its working perfectly, but it works also in Debug configuration.
There is a way to run tests after build only when Release configuration is selected?

Related

How to let VS Code discover Bazel tests?

When opening a Bazel project in VS Code, it does not automatically discover the Bazel tests in the test runner, even with the bazel plugin installed.
I had to run tests using terminal commands.
Is there a way to run Bazel tests in the VS Code test runner?

Flutter Android Studio unit tests - need to delete run/debug config to pick up changed code

In Android Studio, running unit tests for a Flutter project, after having run a unit test once, in order for code changes to be picked up, I need to delete the run / debug config before re-running the unit test.
Why?
Is there a unit test cache build setting I can disable so I don't need to delete the config prior to re-running the test? I don't need to do this for re-running unit tests in IDEA when working on a pure Dart project.
I delete the run/debug config in Android Studio Run > Edit Configurations... > Flutter Test > [delete any configs for unit tests I want to re-run].
For example, the below, I would delete any unit tests (which I mostly run individually) from underneath the Flutter Test section of this Run/Debug Configurations window in Android Studio.

Team Foundation Build 2013 and Octopus Deploy - How to reject a package when build or unit test fail?

We are using Team Build 2013 to create builds, and Octopus to deploy. The problem is that I can't figure out how to prevent my builds to reach the build server on failure, and finally prevent them from appearing on Octopus when the build or unit test fail. I have change the "Retention Policy" to erase builds when it fails, but Octopus still sees the empty builds.
My ultimate goal is to rollback the checkin if the build or unit test fails. But again, I can't find an event called "On Build failure" or something similar. I tried to use the Post-Build Script, but it is not called when a build fails.
I am using the new style builds not the XAML builds, but I find the following build steps effective:
Build Solution
Run Tests
MSBUILD with RunOctoPack=true
If the build or tests fail, Octopack doesn't send anything to Octopus Deploy.
So I don't set RunOctoPack in the project file or on the initial build.

TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid but can't see MSTest.exe

I'm getting the following error on a TFS2013 build:
TF900547: The directory containing the assemblies for the Visual Studio Test Runner is not valid ''.
Looking here, it would seem that the answer to this is to change the test runner from VS test runner to MSTest. However, when I try to edit the Test Run in the build definition, the test runner option is set to Visual Studio Test Runner and greyed out. What determined what is shown in this box, and how can I add MSTest?
I have installed VS2012 agents for handling tests on the server.
I fixed this by installing VS2013 on the build agent
We had the same problem as the OP but, because the TFS server is considered a production box (other departments use it for other things), we were not permitted to install VS2013 on the server. The same applied to any third party tools needed for builds, they were a pain to integrate into the build.
I eventually worked round this by using another dev box to act as a build server for TFS. By installing the Build Server component of TFS on the dev box and setting up a controller and build agents on that box, TFS could pass the responsibility for the actual build to the dev box, on which we could install anything, without compromising the TFS server itself.
While it is not perfect - an extra box and VS2013 license needed - it is by far the easiest way to avoid poluting a production TFS box. Alternatively, nominate a developer's own box and install the build agent there - the environment is ready built, it will simply slow down a little during a build.
Look at section Define Multiple Test Runs of this article. It is very informative and explains different configuration in dept. Hope this helps !!!

Running NUnit tests in TeamCity 6.5.X with NUnit addins

We are using TeamCity 6.5.1 to manage the compilation, testing and deployment of our builds. Up until now we have been using the NUnit Build Runner from TeamCity to run our tests with NUnit 2.5.8 and had great success.
http://confluence.jetbrains.com/display/TCD65/NUnit
All of our tests are written in C# and .Net 4.0 using Visual Studio 2010. The test projects are compiled into an assembly that we reference through the TeamCity interface.
Now we are adding in a new test project for UI tests that require a custom NUnit addin that we developed to extend the native NUnit functionality. When running the tests in a local development environment with NUnit 2.5.8 installed we are able to place the custom addin in the NUnit addins directory. When NUnit is loaded our addin is picked up automatically.
C:\Program Files (x86)\NUnit 2.5.8\bin\net-2.0\addins
Using the NUnit Build Runner in TeamCity 6.5.1 we cannot see of a way to install our addin. Unlike the native installation of NUnit, TeamCity does not appear to pick up an addin just by placing it inside a sub directory of the NUnit installation.
Does anyone know of a way to install/use an addin using the NUnit Build Runner? Existing documentation discusses the NUnit command line console runner which we are not using. We are using the NUnit Build Runner as the method to run all of our tests so it would be most ideal if we could maintain a standard testing mechanism.
Thank you!
I was trying to solve the same problem.
As I found out TeamCity uses its assembly Nunit.
Therefore there is no possibility of expansion. You can use the command line to run tests via Nunit. And TeamCity use step "Build Failure Conditions" for reading logs and view the results.