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

Notification

Icon
Error

Way to get executable compiled project? And some more questions...
springjazzy
#1 Posted : Wednesday, June 6, 2012 5:54:37 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Hi! First of all - Thanks for NCrunch! I found that project while googling on increasing build performance. Thing is - we have a big solution with multiple projects, so building it takes time. We are using VS2010 and it is definitely not a building workspace. Also shadow accessors make build performance even worse. I got rid of accessors in some test projects and marked other as ignorable in NCrunch configuration - so I don't have any project with "Copy Referenced assemblies to workspace" selected. All looks great by now.

Problem 1:
Problems start when I'm trying to execute compiled .exe file. If NCrunch already compliled solution - why not use it? So, I'm selecting project -> Advanced -> Browse to workspace. I'm seeing .exe file there, but I don't see any .dll that are referenced by that project. I mean not only projects in solution, but also referenced .dll that have a checked option "Copy Local". Of course .exe crushes when I'm trying to execute it. Is there some way to get executable file working?

Problem 2:
Is there some way force build processes have a higher priority?

Problem 3:
In testing debug mode, VS2010 can't resolve some types, though "using" statement is there.

Problem 4:
We have 1000+ tests. NCrunch Code coverage and impacted tests are great, but they work only if they ran once. We have a special TFS server that runs tests every night. Is there some way to import test results from night builds to local workstations with NCrunch?
Remco
#2 Posted : Wednesday, June 6, 2012 6:48:50 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting! It's great to hear that you've been making good use of NCrunch and that you've found such value in the build optimisation features. I'll try to address your problems one at a time.

1: The NCrunch build itself is executed with the sole intention of building artifacts to be used in a testing environment. As such, DLLs and EXEs that are output from an NCrunch build will normally be manipulated at IL level (with instrumentation) and aren't really designed to be run independently from NCrunch. Most likely the reason for your EXE crashing is that its DLL dependencies aren't existing in the same directory (and therefore can't be resolved without help from NCrunch) - or it could be a side-effect of the instrumentation. You may be able to prove or disprove either of these theories by changing the 'Instrument output assembly' and 'Copy referenced assemblies to workspace' settings to see if this makes any difference.

2: Build processes will generally have a higher priority than test tasks in NCrunch's processing queue, although this may not be the case if test tasks are queued manually or if they represent impacted tests. If the execution of tests isn't particularly important to you, turning off instrumentation (using the 'Instrument output assembly' setting) will prevent the impact detection from working and should cause build tasks to generally sit higher in the queue .. although this may have some undesirable side-effects.

3: NCrunch does have some known issues around resolving some types in the debugging environment. These issues include lack of recognition of compiler-generated methods containing the 'yield' statement, and lack of namespace resolution for types and extension methods in a global space. I have an item on the backlog to address these issues, though due to their complexity it may take some time to resolve them. In most situations you can work around the issue by specifying a full namespace when referencing any type with the debugger.

4: This is a really, really interesting idea. Because of the need to obtain metrics and other information from the code being tested, it would be necessary for NCrunch to have control over the testing environment (so nightly builds on a TFS server probably wouldn't work for this). I do, however, have some long terms plans that may eventually make this sort of thing possible. Watch this space :)


Cheers,

Remco

springjazzy
#3 Posted : Wednesday, June 6, 2012 10:54:50 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Thanks for quick and informative reply!

Considering problem #1, I removed instrumentation and set "Copy referenced assemblies to workspace". Now I see most of my dll's in workspace, but .exe still doesn't work. And the problem is that it is compiled as x64 application. How can I force NCrunch to compile it as x86? I've tried to play with configuration a little bit - checked "Use CPU architecture - x86" on all projects and "Use build configuration - DEBUG" (DEBUG is a x86 configuration in our solution). Neither of it worked.

Also, is there some way to force NCrunch use older actual builds on startup. Right now NCrunch needs some time to initialize and build everything. In my case it takes me around 10 minutes. Considering "legendary" stability of MS products, VS2010 needs to be reopened several times per day )), so this option would be great!
Remco
#4 Posted : Wednesday, June 6, 2012 10:11:30 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch will always use the build configuration that's specified in your .proj file (it doesn't consider the build configuration selected in VS), so most likely you have the x64 configuration set as the default in the .proj file for this EXE. This should be a very simple fix - just adjust the lines of code that are something similar to:

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>

I've been looking at caching mechanisms to improve the initialisation time. Rest assured that I also start VS approx 20-30 times per day while working on NCrunch, so a slow startup does drive me crazy! It will happen soon :)


Thanks!

Remco
springjazzy
#5 Posted : Thursday, June 7, 2012 4:58:46 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Hi!

I've noticed some problem with configurations in projects.

For example we have:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
...
<PlatformTarget>x86</PlatformTarget>
...
</PropertyGroup>

VS2010 creates folders like obj\x86\Debug, while NCrunch tries to create folders like obj\Debug|x86\ and throw exception.
Remco
#6 Posted : Thursday, June 7, 2012 6:09:57 AM(UTC)
Rank: NCrunch Developer

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

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

The creation of these folders is handled by MSBuild. Most likely the reason you're seeing strange behaviour is because NCrunch doesn't override the $(Configuration) and $(Platform) build properties - it will instead use the defaults as provided in the .proj file.

The best way to get an understanding of how this works is to try building your project with msbuild.exe using the command line. You'll notice that the files are deposited in the same manner as NCrunch (as it works in the same way).

The only way to fix this is to modify your .proj files to ensure that the default $(Configuration) and $(Platform) properties are set to what you would normally expect for your test environment. NCrunch relies on these values where VS will typically just inject them, so adjusting them should solve issues such as this.

Cheers,

Remco
springjazzy
#7 Posted : Thursday, June 7, 2012 9:54:43 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Thanks! Made it )

I see another problem with failing tests.
If test fails:
1. I see absolutely no coverage details, though test fails on last line of test
2. I see some "abracadabra" message rather than meaningful Assert.AreEqual failed exception.

If test succeeds - all is ok.

I'll translate exception msg to you from russian:

[13:52:18.9496-TestExecutionTask-32] ERROR (Internal): System.ArgumentOutOfRangeException: Length cannot be less than 0
Parameter name: length
in System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
in nCrunch.TestExecution.ParsedException.#=qQbvnheWkBQFqDpTCtIFX9QtnTxhWxvCXmzx0Noz2cEg=(String #=qj7ubCJxBxzu_C2uSb6yIWwLNdTghdW7v4RVeqmXdS5w=, TestId #=qvf5uddLkvGHSS07FG2d7XA==)
in #=q4iEciqKEn0_pHtIeIlpQ6Hy1T8EODdmBUofvxsJFQAFcSGkUq$eqBX6XKe5AK2j4.#=qnFkBrVbPoh2xSNeWbEPVYA==(Boolean #=qQVMaxpcOq$5gOFGeybRa9A==, String #=qgV4gAYUP7OmC4p9RfhTK27Q0vN0IPzCdKR8yPqYy$GM=, TimeSpan #=qOPjxXvwV9XDUk1dfApFOMg==)
in #=q92eHOlQ2c_aLmKpJyKRTuUNKNXlkkzPlj7VL7fNaNsOv_KFccu3hIEwurrsyyCDP3ma8PwfMMfiHBf4pC5r6og==.#=qlPmuFo$pff8g9bW4aecn6A==(#=qvc18cdiL6yc1aJ5xHIj4dwAUSRDRq9PMKupgWms3hn0ZxFzRoN2LBnpS8jcqu884IiatOUBTcX3kxgN800g7Bw== #=qrjyEzpqMKi8iwT3g5bWbeA==)
in #=qRAvNqOfGW_gDnGlLan6s3S7xkR$sLLSeQJY8YpauNV5WjzVNCNpK9NdlCXq7M4kg5SL7mJdua0SSDR9dzpDOGQ==.#=q57Bn5_2lsPRPKwGb7j3AIjoCvp17k$GKkJ5fnSc9$ZM=(IList`1 #=qJGShiJNhf30EEqwX7TOqCw==, TestOutput #=qs91PSQ1u9f5xFsSJl5BFQA==)
in #=qRAvNqOfGW_gDnGlLan6s3S7xkR$sLLSeQJY8YpauNV5WjzVNCNpK9NdlCXq7M4kg5SL7mJdua0SSDR9dzpDOGQ==.#=q9trkZF2onfp$xf8tFBHA5g==(IList`1 #=qV2wQa28lJiLu3fWFbmulSw==, TestOutput #=qhuEpPoeE0eDtTCK7lC09tA==)
in nCrunch.TestExecution.Frameworks.MSTest.MSTestFramework.#=q2XKgKXNsGmbzK9IM7qoeWNPf$8HFliaAv4IMD7w14LM=.#=qGMR7Sjgu9aKXlSqEdKfmrQ==()
in #=qB8X_z5RT_Njd_dT1gO94_h9hW41kYhoPmj6SOQJ27rQdHMpYLMvIlvJ_6FI8qQ6k.#=qsFOJMHUNaNySUqAnDJhGodvs7LhVnUA86G2$KLTA7ao=(Action #=qe6PF5ZjA$EwiKzi4h$iXka5Q84b7bGM4J1y6fP6feBc=)
in nCrunch.TestExecution.Frameworks.MSTest.MSTestFramework.RunTests(TestOutput output, IList`1 testsToRun, TestExecutionMapSet testMapSet, Boolean considerInconclusiveTestsAsPassing)
in nCrunch.TestExecution.TestRunnerThread.#=q4repr3Wd8XZErk7WzkV51Q==(ComponentTestExecutionMap[] #=q6nzpvewP3qsR3UJ9T_X3_4iRoYowhuAkDKFgmllhRvA=, IList`1 #=qpDwW8juuukm_mvBH8kK3$A==, Boolean #=qXCecC8qhXzbJ67h8KZxBQpGHtIA726WCxuf9LQV2$XOuvYpsNyYtIMOkoaBhDM4y)

Remco
#8 Posted : Thursday, June 7, 2012 10:39:43 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
This looks like a localisation issue while parsing the exception being thrown. There's a fix available for this in a development build of 1.40b if you'd like to give it a try. Download links are available on this thread: http://forum.ncrunch.net...ding-test-execution.aspx
springjazzy
#9 Posted : Thursday, June 7, 2012 12:00:57 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Thanks!

It seems to work, though there is still some problem in outputting failed test results. All non-latin symbols turned into a mess - maybe some encoding problem in textarea displaying test results? If I copy/paste text into notepad i see nice readable russian text. Also hyperlink on error line doesn't work, maybe because of encoding again...

In 1.39b version russian symbols were printed correctly.
Remco
#10 Posted : Thursday, June 7, 2012 9:15:04 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Good to hear! I didn't know about the Russian display issue. Is there any chance you can show me a screenshot of this? I'd really like to have it sorted before the 1.40b release goes out the door properly :)
springjazzy
#11 Posted : Friday, June 8, 2012 4:52:42 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

I can sent you solution-example if you give me your e-mail.

Anyway that problem encounters only in NCrunch test window.NCrunch Processing Queue and popup msg appearing when clicking red cross in code both are showing correct symbols. Only test window show incorrect symbols.

Also that problem appears to be only on failed tests. If test ok then Russian ok everywhere.
Remco
#12 Posted : Friday, June 8, 2012 6:31:10 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks - I'll PM you an email address you send can it through to.


Cheers,

Remco
springjazzy
#13 Posted : Friday, June 8, 2012 7:24:16 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/6/2012(UTC)
Posts: 46

Aahh! I've missclicked Configuration to "Run configuration wizard" and NCrunch suddenly disabled himself, though I've clicked "Cancel" in wizard ((
Remco
#14 Posted : Friday, June 8, 2012 8:31:32 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
NCrunch will usually disable itself if you run the configuration wizard, as many of the settings controlled by the wizard can only be changed while the engine is stopped. You should be able to re-enable NCrunch via the normal menu at the top.

Anyway feel free to send through any details if you manage to recreate the issue again.


Thanks!

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.083 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download