Hi, I am looking to use NCrunch in a rather unusual way.
At the moment, I have NCrunch setup with distributed processing to manually execute functional GUI tests on VirtualBox VM's. All these VM's are run locally, on my development laptop.
Since I am manipulating all kinds of Windows services during these GUI tests, I sometimes break the environment of the VM.
This gives me problems: all tests that run on this node after breaking the environment automatically fail.
To solve this issue, I would like to be able to setup the VM and tear it down again in my test code.
Ideally, the flow would go as this:
1: In Visual Studio 2015, I right click on an NCrunch test and choose 'Run selected test on server' -> 'Node 1'.
2: The VM of 'Node 1' is booted, NCrunch connects to this node and starts remote test execution (of only this test) after building the solution.
3: After test execution, the VM of 'Node 1' is shut down.
I understand that this might be impossible to do. However, the following flow would still be acceptable:
1: In Visual Studio 2015, I run a test from the VS Test Explorer (using NUnitV3 test adapter)
2: The test itself knows that it needs to boot up the VM 'Node 1'.
3: The VM of 'Node 1' is booted by the test, NCrunch connects to this node and starts remote test execution (of only this test) after building the solution.
4: After test execution, the test result is fed back into the VS Test Explorer.
5: The test shuts down the VM of 'Node 1'.
Now, I think that the 2nd scenario is possible using the Console version of NCrunch.
I've been looking through the documentation of the NCrunch console, however, and I can't seem to really figure it out.
I have the following questions:
- Is it possible to drive NCrunch programmatically to connect to a Node?
- Is it possible to tell an NCrunch node to only run 1 test programmatically? Do I have to create seperate engines for each test?
- How do I route the test results back into the NUnit test adapter?
The answer to some of these questions might be obvious.
I'm not very experienced in working with VM's and the documentation for the console is a little lacking, honestly.
The ideal solution would be that I could tell the host computer, which is running NCrunch in VS2015, to run some scripts (that setup the VM, for example) before building and testing the solution on a remote Node when I tell NCrunch to run the tests.
The problem I have at the moment is chicken and egg: all tests are run in the Node's NCrunch workspace, so I can't use a SetupFixture or anything to setup my VM, since the VM needs to already exist in order to run the test.