Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to never be prompted to run last successful build when unit testing

I want to get rid of the dialog saying

There were build errors. Would you like to continue and run tests from the last successful build

when I am running unit tests (I use test -> run -> all tests).

How do I do that? I already know how to disable it when running a normal project.

I also want to know how this can ever be a useful feature?

like image 303
Anders Lindén Avatar asked Apr 04 '13 17:04

Anders Lindén


People also ask

How do you fix there were build errors would you like?

In Visual Studio 2019 Update 16.5 or later you can go to Tools > Options > Projects and Solutions > Build and Run and set 'On Run, when build or deployment error occurs' to one of the options below. Once this is set, running and debugging tests will honor this option as well.

When should unit tests be executed?

Unit testing is the first testing phase and it is practiced before moving to the phase of integration testing. Hence, before moving for the next testing level, make sure to fix all the identified bugs in the unit testing phase.

How do I stop a test case from running in Visual Studio?

You need to close the Test Explorer Window to prevent automatic running.


2 Answers

How do I do that?

You can't.

I also want to know how this can ever be a useful feature?

I find it useful when I am working closely with someone who is configuring test data. I can re-run tests to ensure new test data is valid, without having to worry about compiling any changes that I have done in the meantime.

For example if someone has changed some data in a database, I want to be able to run my tests to ensure that this new data is valid, and I want to be able to run the tests whether the current state of my code compiles or not.

like image 68
lockstock Avatar answered Sep 28 '22 04:09

lockstock


For Visual Studio 2017 / MSTestV2 you can do:

Tools > Options > Project and Solutions > Build and Run

"On Run, when build or deployment errors occur:" "Do not launch"

like image 22
Etherman Avatar answered Sep 28 '22 03:09

Etherman