NCrunch Forum
»
General Support
»
Build/Test Issues
»
DeploymentItem with Environment Variable not working
Rank: Newbie
Groups: Registered
Joined: 6/28/2012(UTC) Posts: 4 Location: Redmond
|
I've just tried using NCrunch for the first time. My project currently builds and passes all unit tests from Visual Studio.
However, when NCrunch runs the tests I get many test failures due to deployment items not being deployed.
It appears that MSTest DeploymentItem is supported. However I wonder if it could be because of the environment variable I use.
[DeploymentItem(@"%LABDIR%\Microsoft.Activities.Extensions\Microsoft.Activities.Extensions.Tests\ServiceExtensionTest.xamlx")]
I use the %LABDIR% variable because DeploymentItem uses either a full path or relative to the solution file path. But in my case, this test file is included in multiple solution files so I can't use a relative path. I use the %LABDIR% variable to make sure the deployment item is found regardless of the solution path.
Could that be the issue?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2012(UTC) Posts: 4 Location: Redmond
|
As a quick test I replaced the environment variable with the actual path and the test is now passing.
Please make the DeploymentItem expand the environment variable
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/28/2012(UTC) Posts: 4 Location: Redmond
|
Here is my workaround
#if NCRUNCH /// <summary> /// The Lab directory /// </summary> /// <remarks> /// NCrunch does not expand environment variables /// </remarks> internal const string Labdir = @"D:\wf.codeplex.com\src\wf\labs"; #else /// <summary> /// The test projects folder. /// </summary> internal const string Labdir = "%LABDIR%"; #endif
|
|
|
|
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,143
Thanks: 959 times Was thanked: 1290 time(s) in 1196 post(s)
|
Hi, thanks for posting!
It's true that NCrunch currently doesn't parse environment variables specified in the DeploymentItem. Thanks for making me aware of this issue, I'll note it down for a fix in a future revision.
Cheers,
Remco
|
|
|
|
Rank: NCrunch Developer
Groups: Administrators
Joined: 4/16/2011(UTC) Posts: 7,143
Thanks: 959 times Was thanked: 1290 time(s) in 1196 post(s)
|
For anyone interested, NCrunch 1.41b has just been released including a fix for the above issue. NCrunch should now automatically resolve and handle deployment items making use of environment variables.
|
|
|
|
NCrunch Forum
»
General Support
»
Build/Test Issues
»
DeploymentItem with Environment Variable not working
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.NETThis page was generated in 0.035 seconds.