Remco;2904 wrote:I really recommend trying a slow transition into the use of a continuous test runner for this solution. Try ignoring (with NCrunch) all your integration tests to start with, and just using NCrunch to execute unit tests for a week or so. If nothing else, this will help you to evaluate the tool in a usable and trouble-free scenario to see whether it really is worth your while. As you learn more about the behaviour of the engine and discover how best to utilise it in your environment, you can start selectively turning on integration tests and examining how they behave while being executed continuously. In this way, you should also immediately become aware of any tests that may be causing excessive system load (as many of them are backing onto a database, the DBMS can do a fine job of degrading system performance if it's being hammered). This approach can also save you from stress-related disaster, as there is no telling how long it may take to get the integration tests running continuously and the last thing you need is to deal with pressing deadlines while evaluating a tool on the job.
We consider all of the tests, even those that go against a database, to be unit tests. We don't have many. We have perhaps 700 unit tests. We can execute all of them in NUnit in about 15 seconds. So they aren't particularly long running as far as we're concerned.
I'm not convinced it is a big project getting NCrunch working with our stuff. I would say if the time/stamp issue were resolved and the SetUpFixture's SetUp and TearDown were called once each for a batch of unit tests (for example, all of those that are queued or whatever), then we are very close. Even with just the time/stamp issue resolved I think we are able to use your product.
We are not interested in using your product with only a portion of our unit tests (those that don't go against the database). For us, we will need it to work with all of our unit tests or it won't be something we will use.
Remco;2904 wrote:
Problem 1: Absolute file paths to business directories - Your described solution to this is sensible. NCrunch doesn't deal well with absolute file paths as they prevent it from properly isolating components under test. Make sure the configuration file you've placed doesn't sit within any of the generated NCrunch directories, as these will be routinely removed (which could cause the loss of your configuration file).
It wasn't an absolute file path issue. It was a conflict with the design of our system where we use the name of the root folder under, ultimately, which the source code is checked out, as the name of the system (because our code base is shared by two different companies/products). I resolved it with a code change and don't see that NCrunch needs to be changed in any way to resolve this issue.
Remco;2904 wrote:
Problem 2: This is a concern to me. Files that are included in the .proj XML should ALWAYS be copied into a workspace (especially if they are included with a Content tag). Are there any build or test steps you're aware of that may remove the files? There is a way to confirm whether the files have been copied by inspecting the NCrunch diagnostic log written out when the workspace is built. To view this log, you'll need to set the 'Log verbosity' to 'Detailed' under you global configuration, then reset the NCrunch engine (i.e. disable and enable). After the offending project has been built, go to the processing queue and select it in the list. You should see a large dump of text output in the lower pane. Look through entries in the log such as 'Writing new workspace member ....' to see if you can find evidence of the files that are missing. If the files are shown to be written in the diagnostic log, then this means that the files were copied to the workspace but subsequently removed by something else (misbehaving build or test logic perhaps?).
I will get back to you on this one.
Remco;2904 wrote:
Problem 3: From your description, I think this is caused by Problem 4 ... let me know if there isn't the case and I'll help you delve a bit deeper into what happened here.
Problem 4: NCrunch will always build projects using the default MSBuild $(Configuration) specified in the .proj file, in the same manner as if you built the project using a command-line MSBuild invocation. From your description, I suspect that you have Visual Studio configured to inject a non-default configuration into the build, which means that your build experience between Visual Studio and NCrunch would be inconsistent. I would say it's a high priority to properly fix this issue before addressing any others, as your system would have been tested and developed with the configuration selected by Visual Studio in mind. There are two clean ways you can solve this - either you can change the default configuration inside the .proj files to be consistent with your Visual Studio configuration, or you can configure NCrunch to use the same configuration as Visual Studio. There is a project-level NCrunch configuration value called 'Use Build Configuration' that allows you to specify the name of the $(Configuration) property in free-form. Try selecting all the projects in the configuration pane and applying this setting in bulk. I really recommend against re-engineering your tests to work from a different output path, as this would create an inconsistency between your non-NCrunch testing environment and your NCrunch testing environment (which is undesirable!).
I solved this one by adding a few lines of code to detect if the project was built into bin\Debug or bin\x86\Debug and adjust accordingly. It wasn't a big deal.
However, I would like to understand more about what you mean by "Visual Studio [is] configured to inject a non-default configuration into the build".
The "Active solution configuration" in the Configuration Manager for the solution is set to "Debug". The "Active solution platform" is set to our company name, which is a solution platform I created. Each of the .NET projects in this configuration are set to build on the x86 Platform (not
Any Cpu or anything else) and each of their configurations is set to Debug.
Our automated build process does not use MSBuild to build the solution. When we have used MSBuild to build the solution in the past, we have had problems. Perhaps this indicates there is a problem like what you are describing.
At any rate, the Output path for the Debug configuration of each of our projects is set to bin\x86\Debug, which was the default Visual Studio 2005 applied way back when we used it. Visual Studio 2008, I believe, changed this default to bin\Debug even for x86 built projects. So I suppose I could go through all of my projects and change this, but I'm not sure it is worth it at this point since I solved the issue with a few lines of code.
Remco;2904 wrote:
Visual Studio lockups: NCrunch doesn't make blocking calls to the task runner .exes from the IDE on the primary thread, so my feeling is that most likely these lockups are being caused somehow by test behaviour or through system load. Problems like this can be VERY hard to diagnose because when the lockups occur, it can be very difficult to get meaningful information about the state of the test runner or which tests are being executed. If this keeps happening, I recommend selectively ignoring sections of your tests with NCrunch to see if you can find a failure pattern. Something that may also help is if you want to try hooking a debugger onto the locked up Visual Studio instance itself and inspecting the stack traces of running threads - this could help to confirm or deny whether I can help solve the problem for you with an NCrunch fix.
I think this is a symptom of the date/time stamp issue (and consequently, the huge amounts of database load) I've brought up in a different thread.
Remco;2904 wrote:
'Run all tests manually' not being remembered: NCrunch stores your currently selected engine mode in a solution-specific file, i.e. 'MySolution.ncrunchsolution.user'. It will only save this engine mode on close of the solution or clean exit of Visual Studio. Check that the file isn't read-only (sometimes source control software can lock the file). Based on the previous issue you've described (VS lockups), I'm wondering if it might be possible that you haven't experienced a clean exit after setting the engine mode?
Could be. I'll watch out for this. Probably was never properly saved because of the other issues ultimately, I think, caused by the date/time stamp issue.
Remco;2904 wrote:
Circle markers not updating: This is a symptom of a solution that has many long running tests. If you haven't yet completed a full end-to-end test run with all tests passing (which I strongly suspect is the case), then NCrunch won't have much reliable information about how long each of your tests takes to execute. This means that the execution engine won't be able to make intelligent decisions about how to prioritise tests or threading/task resources, and it will probably be tying up too many of its tasks in long running tests. This issue should effectively solve itself once you've managed a full run through of the entire solution with all enabled tests behaving themselves properly. The processing queue window can be helpful in understanding the behaviour of the engine and why it may seem to be taking a long time to return results.
Yeah, this is likely a symptom of the date/time stamp issue (and consequently, huge amounts of database load).
Remco;2904 wrote:
Inconsistent results in files copied: Can you share any more details about the proxy DLL you are using or how it is generated? Is it created using a build step? Is the DLL being generated using a cross-project dependency of some kind? This could be quite a complex situation that perhaps should be failing consistently and has been working due to a side-effect. I'm not sure if adding the file to the additional files to include setting is the right way to solve this problem.. If you can share some more details, I'll help you to work it out.
I'll try to get you additional details on this one.
Remco;2904 wrote:
"Running" state test: There are certain error conditions that can create this scenario. They are rare and infrequent, and usually benign (i.e. the test will return to a normal state the next time it is run). If you can find a way to reproduce this issue, I'd really like to take a closer look at it. Most likely it was caused by an internal problem in the engine (in which case submitting a bug report may very well give me the information I need to fix it).
Could be another symptom of the date/time stamp issue.
Remco;2904 wrote:
Thanks for all your effort in trying to get NCrunch to work on this solution. I appreciate going through this process with you as it better enables me to understand the sorts of pains people go through when first introducing the tool into such a complex environment. I hope I can continue to be of help in your implementation/evaluation of the tool.
I would like to see this work with our environment. We are likely not doing things as non-standard as you would think. Ours is a very clean system and the unit test framework we have created to perform unit tests against our database is relatively simple and hands-off for our programmers. I think we just need the date/time stamp and SetUpFixture SetUp/TearDown issues resolved (actually, this last one might not even be a big deal if the date/time stamp issue were resolved).
I am the architect of all of our stuff and the founder/owner of the company, so I can make adjustments to our stuff on a whim whenever I want to try and get this going.
We would be a good customer. We would ultimately need at least 8 fixed seat licenses (the $259 variety... I think that is what you said the cost will be). Considering you are just getting your company off the ground, we would be an excellent early adopting paying customer if we could get this going with our environment.
-Corey