When running NCrunch using test-files on MSTest, the outcome is not consistent.
Almost always upon loading the solution, or starting NCrunch the unit tests that require deployed files fail.
Upon automated execution when a code change has been detected, they are successful.
I have applied deploymentitem attributes at class level as:
Code:
DeploymentItem("testfiles/details.pdf", "testfiles")
It seems to have to do with the location of the directory the testrunner uses, which is varying (maybe dependent on the last build performed, being tracked by NCrunch?)
It switches between (success):
Code:
[MyAppData]\Local\NCrunch\[SOMENUMBER]\[SOMENUMBER]\[NAMESPACE OF MY UNIT TEST LIBRARY]\bin\Out\
and (failure):
Code:
[MyAppData]\Local\NCrunch\[SOMENUMBER]\[SOMENUMBER]\TestResults\[SOMEGUID]\Out\
Some cases that some reproducible:
Code:
//Upon opening solution (FAILURE):
[MyAppData]\Local\NCrunch\10600\13\[NAMESPACE OF MY UNIT TEST LIBRARY]\bin\Out\testfiles\details.pdf
//Automated after trivial code change (SUCCESS):
[MyAppData]\Local\NCrunch\10600\13\TestResults\29fc99ad-5fd7-439f-83a8-8c2f68b04775\Out\testfiles\details.pdf
//After manual rebuild in NCrunch window (FAILS/SOMETIMES SUCCES)
[MyAppData]\Local\NCrunch\6584\30\[NAMESPACE OF MY UNIT TEST LIBRARY]\bin\Out\testfiles\details.pdf
//Manual execution in NCrunch (SUCCESS)
[code=csharp][MyAppData]\Local\NCrunch\6584\30\TestResults\5130ecf5-309b-4dfb-be30-9802f41eec8c\Out\testfiles\details.pdf
Within the failing tests' folder: [NAMESPACE OF MY UNIT TEST LIBRARY]\bin the deployed files are actually present at the compiler output folder but are somehow not copied to the 'Out' folder.
- Debug
- testfiles (containing testfiles)
- In
- [name of my machine] (empty)
- Out (empty)
Any suggestions?
The 'deployment' option is switched on in my .testsettings file, but that should not matter, as NCrunch state it ignores these file altogether.