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

Notification

Icon
Error

NCrunch support for tests in .razor files
menasheh
#1 Posted : Friday, August 16, 2019 5:40:44 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/16/2019(UTC)
Posts: 2
Location: United States of America

NCrunch runs tests defined in the @code block of a .razor file. However, it seems like there's a missing link between the results of the tests and the actual .razor source code.

Two manifestations of this:
1. Right click option "Go to selected test" doesn't work.
2. Inline code coverage is not supported.

Is this a bug or a missing feature or some combination thereof?
Remco
#2 Posted : Saturday, August 17, 2019 12:01:41 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,759

Thanks: 745 times
Was thanked: 956 time(s) in 911 post(s)
In theory, NCrunch should support any source file that has debugging information present in the output PDB file.

In practice, we've never tested this with razor files. I honestly didn't know it was possible to build such a structure.

Could I convince you to provide us with a small sample project that demonstrates how you've done this? We should then be able to look into the behaviour of the engine and establish whether this can be fixed with a small patch or whether it will require a large amount of work. You can submit small code samples through the contact form.
menasheh
#3 Posted : Wednesday, August 21, 2019 3:39:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/16/2019(UTC)
Posts: 2
Location: United States of America

Remco;13773 wrote:
In theory, NCrunch should support any source file that has debugging information present in the output PDB file.

In practice, we've never tested this with razor files. I honestly didn't know it was possible to build such a structure.

Could I convince you to provide us with a small sample project that demonstrates how you've done this? We should then be able to look into the behaviour of the engine and establish whether this can be fixed with a small patch or whether it will require a large amount of work. You can submit small code samples through the contact form.


I've submitted a sample project through the contact form. Looking forward to further feedback. Thanks!
Remco
#4 Posted : Thursday, August 22, 2019 12:52:06 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,759

Thanks: 745 times
Was thanked: 956 time(s) in 911 post(s)
Thanks for sending through the code sample.

I've managed to identify the source of the problem here. The build system is reporting the .razer file as being a Content file rather than a Compile one. This breaks conventions inside the build system as it means the file doesn't pass through a number of build steps. Probably they've done it this way to prevent it being picked up by the CSC/VBC compiler in the expectation that its IL will be injected into the assembly by another task further downstream.

I can think of no way to work around this problem with the currently released version of NCrunch. Any way we identify the file as a compile target would also result in your build being broken.

With .NET Core 3.0 still being in a preview state, it's difficult for us to reliably make changes in this area without destabilising things. I've noted this down to be looked at in detail after the release of .NET Core 3.0. There may be some way for us to identify these files as being compile targets internally without passing them into the compiler. This would allow us to highlight their code as we do with other source files. Sorry .. you'll need to deal with broken NCrunch code coverage and navigation in the files until we can find a reliable way to fix this.
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.035 seconds.