Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Usage of DeploymentItem attribute
sholder
#1 Posted : Tuesday, January 24, 2012 2:48:33 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/24/2012(UTC)
Posts: 1
Location: US

I have a test which relies on being able to find files. I am using the TestContext.TestDeploymentDir to set the base directory where the structure will be located. I am also using the DeploymentItem attribute to tell VSTS that the items should be part of the test deployment, as well as set the Enable Deployment bit for the solution. The tests run successfully with VSTS and CodeRush Test Runner but do not in NCrunch.

<Edit>
Looks like CodeRush Test Runner is having an issue finding the resources also because it is now failing after a clean solution.
</Edit>

The error I get is a DirectoryNotFoundException on:

%USERPROFILE%\AppData\Local\NCrunch\4116\25\TestResults\1cb3ef5e-f7c3-4424-bb95-f910ea7ae16f\Out\Configurations\1234\configuration.js

I used ProcMon and found that the files are getting deployed to the following locations.

%USERPROFILE%\AppData\Local\NCrunch\4116\25\Absg.MyCubixx.FileSystemConfigurationProvider.Tests\Configurations\1234\configuration.js

and

%USERPROFILE%\AppData\Local\NCrunch\4116\25\Absg.MyCubixx.FileSystemConfigurationProvider.Tests\bin\Debug\Configurations\1234\configuration.js

Is there a better property to use to determine the base deployment directory? Or for that matter just a better method?

Regards,
Shane Holder
Remco
#2 Posted : Tuesday, January 24, 2012 8:18:53 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi Shane,

Thanks for reporting this. NCrunch does its best to emulate the deployment behaviour of MSTest, though many of the rules in this area are inconsistent and it wouldn't surprise me if there are a few gaps. You should be able to rely on the current directory being consistent with the deployment directory that has been created (Directory.GetCurrentDirectory()) - so I would consider using this. Are you able to share any of the code you use to determine the working directory of the configuration.js file during the execution of your test? This will help me with finding the compatibility gap and closing it in a future version.


Cheers,

Remco
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download