What is the global namespace for NUnit tests and where is it coming from?

I'm running into issues running unit tests with NUnit in Rider and I've narrowed down the issue to the test namespacing within Rider's test explorer. 

 

Our test project has a setupfixture in the Tests namespace to handle the one time setup of the main test project.  If I try to run the tests under Tests/Unit/*, they all instantly fail due to nullpointers as it jumps straight into the tests without running the setup fixture.  If I run the tests under Tests/Global/Unit/*, they all start up and complete successfully, as the global setup runs before the tests so all of the necessary data is in place. 

We have no global namespace for the tests, everything is of the format Tests.Unit.MyTestClass1 or Tests.Integration.MyTestClass2, so I have no idea where Rider is parsing that from. What also makes me think this is a rider issue is the test location will change.  So if I open up the project, right click the test project and click run unit tests, the global namespace is absent and everything runs in the Unit or Integration namespace, so they instantly fail.. However, if I edit a test file at all, even something as simple as just adding a dummy variable line and then removing it, after I do that the test window refreshes and moves the test into the global window, so then it starts working.  So if I want to run my full test suite, I have to open and make edits to every test file to get them to load correctly.

Does anyone know where this global namespace is coming from, and how I can configure my tests to end up in the right location so that I can actually execute my tests?

 

EDIT NOTE: Tests all work fine in visual studio and run as expected, which makes me think this is potentially related to how Rider is parsing its nested tree for tests.

Screenshot below shows after moving most of my tests into the global folder by editing them manually and them actually running, but the main focus of this screenshot should be the nested test name structure and trying to figure out where global comes from.

0
2 comments

Hello Zak Thompson,

So far, we were unable to reproduce the issue based on your description. Would it be possible for you to provide a sample solution we could use to reproduce and investigate the issue on our side?

Thank you in advance.

0

Hi Ivan Skorikov, I don't think any action is needed here.  After updating to the latest version of rider it seems to be parsing the tests into the global namespace correctly on IDE startup and I haven't run into any issues running my tests.  Not sure what changes were made behind the scenes with the latest release but it seems to be stable for me now.

Thanks for the response!

0

Please sign in to leave a comment.