Running NUnit through Resharper 8 tests fails when crossing projects due to AppDomain

I recently upgraded to Resharper 8, and when I tried to start a set of projects. These tests contain two sets of integration tests that IISExpress uses to run a website, create web requests, and check responses.

Running them in isolation is successful, and running all the tests previously was successful. However, upon completion, the second set of tests to run will fail.

The study showed that AppDomain.CurrentDomain.BaseDirectory remains as the first test to run instead of changing. Since the integration tests consist of two projects, this leads to the failure of the second project because it cannot find any necessary configuration file.

I cannot find any option to disable this other behavior in Resharper 8, which is apparently the behavior of the /domain:Single nunit flag. Without waiting for the transition to Resharper 7, does anyone know about this? And is this the intended behavior of Resharper 8 or an error?

+48
c # integration-testing nunit resharper appdomain
Jul 26 '13 at 9:17
source share
3 answers

Workaround:

Have you tried in Visual Studio on ReSharper -> Options -> Tools -> Unit Testing

Change the option "Run up to 1 assembly in parallel" to a larger number. I tried one for each test project. Max is the number of cores, I think.

I know counterintuitive, but it worked for me and I use AppDomain.CurrentDomain.BaseDirectory in unsuccessful tests

Cause Error caching optimization in ReSharper 8. The working directory is not set correctly. Perhaps parallel work creates a separate process for each test, so they do not switch to each other.

Fix JetBrains claim this will be fixed in version 8.0.1

Update: A new unit testing option has been added in Resharper 8.1 to accommodate this scenario. Find it in ReSharper -> Options -> Tools -> Testing Devices -> " Use a separate AppDomain for each build with tests.

+55
Aug 07 '13 at 13:22
source share

We see the same problem. I think this is a mistake. See: http://youtrack.jetbrains.com/issue/RSRP-380761

+9
Jul 26 '13 at 17:48
source share

This is now fixed in Resharper 8.0.2: http://youtrack.jetbrains.com/issue/RSRP-374143#comment=27-572929

Do not forget to mention the new version of ReSharper | Options | Tools | Units ism Testing | β€œUse a separate AppDomain for each build with the test” to get it working.

i.e. Now in the settings of Unit Testing there is a new option.

+6
Nov 29 '13 at 1:39
source share



All Articles