You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unit tests in a project always run background 2nd time by fcc. I don't understand why it is necessary to trigger 2nd time. It is also triggered when a unit test has been updated.
Steps to recreate
You must have a unit test that uses a process object like this -> var process = new Process();
And then this process must be started with notepad like this -> var process = new Process { StartInfo = new ProcessStartInfo { FileName = "notepad.exe" } };
Ran the tests or update a random test
Wait for a couple of minutes
Current behavior
notepad.exe triggered 2nd time after running a unit test or updating a unit test.
Expected behavior
I do not want a 2nd trigger
The text was updated successfully, but these errors were encountered:
FCC hooks into the test execution to obtain all the necessary information required to run code coverage. As such it is the code coverage that is the second test run.
There are three possible solutions to this.
FCC provides its own UI.
We cancel the first run based upon a flag and of course the test explorer will report cancelled test/s.
Hacky - You cancel the test run and FCC does not cancel coverage as it currently does.
You do not run the test with the ui from test explorer but another.
1 Requires time and effort that I nor @FortuneN have at our disposal currently.
2 Is probably not possible. The interface that is provided to us does not have such functionality. We use reflection on the implementation to get the hidden information that we require. A quick look in vs and I do not see a cancellation method.
3 This can work but it is dependent upon the test/s being run from test explorer. For instance in a demo project with single test that starts the notepad process this does not work. If you add a dummy test with a Thread.Sleep of sufficient duration that is named to execute before the real test and you run both then there is sufficient time to cancel. Of course if you do not cancel then there will be two triggers if you do not disable FCC.
4 FCC just needs the hook to get the dll that needs coverage. It can get that from running any test. Choose a test that does not start notepad and if necessary create a dummy test. Of couse if you need to see your test passing you will have to run it and there will be 2 triggers.
For now your only option is option 4 and to disable FCC when you want to execute the test.
Installed product versions
Description
Unit tests in a project always run background 2nd time by fcc. I don't understand why it is necessary to trigger 2nd time. It is also triggered when a unit test has been updated.
Steps to recreate
Current behavior
notepad.exe triggered 2nd time after running a unit test or updating a unit test.
Expected behavior
I do not want a 2nd trigger
The text was updated successfully, but these errors were encountered: