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

Notification

Icon
Error

Run Tests explicit in "VisualStudio" compatible way
mgrundner
#1 Posted : Sunday, July 30, 2023 4:15:33 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/25/2016(UTC)
Posts: 17
Location: Austria

Thanks: 4 times
Was thanked: 3 time(s) in 2 post(s)
I am running a rather large testsuite in combination with Verify.

Currently i run into a lot of troubles (and also in the past) when i use it in combo with Verify.


I've read this https://stackoverflow.co...erify-nunit-be-approved and it seams to work fine,
but: if i use

Code:
Verifier.UseProjectRelativeDirectory("__SNAPSHOTS__");

//Or 

Verifier.DerivePathInfo(
    (sourceFile, projectDirectory, type, method) =>
    {
        return new(
            directory: Path.Combine(projectDirectory, "__SNAPSHOTS__"),
            typeName: type.Name,
            methodName: method.Name
        );
    }
);


It falls appart.

I know this is not in the primary domain of NCrunch, and i try to get a discussion going on with Simon Cropp.
But it's just an idea, would it be possible to add a solution configuration that just let run NCrunch in a mode where it just runs relative to the project root in explicit mode? I think this will solve a lot of tooling related troubles with NCrunch.

Maybe i miss something obvious, or its a bug in Verify. But sometimes it drives me crazy that NCrunch behaves so differently sometime (fyi: I needed to set my ncrunch root to c:\n because of the path 265 limitation)

The main reason for me to change the root dir of Verify is that i am multitargeting a blazor lib that needs to verify it's content in net.6, 7, 8 and up, but it needs to render all its html compatible, so i just want to store 1 golden master if that makes sense.

Hoping for any ideas and kind regards

Manuel
Remco
#2 Posted : Sunday, July 30, 2023 11:55:58 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for posting, and I apologise for the clear frustation that you've experienced here.

I think that what you're asking for is whether NCrunch could be adjusted to run tests in the same manner as VS (or other test runners) by simply using the binaries that are output from the foreground solution that is open inside VS. Unfortunately, there is no way we can really implement this. The entire architecture of NCrunch was built on being able to separate projects from their parent solution so that they could be manipulated, built and executed in isolation. While I understand that avoiding such isolation would make life easier in specific scenarios like yours, much of what we've built in NCrunch would fail to work entirely and would need to be built around a completely different set of constraints. In short: We can't do it.

Usually it's possible to work around NCrunch's workspacing by using the methods available on the NCrunchEnvironment class. Unfortunately I can't provide guidance on how to configure Verify in your situation, but I believe Simon has already done some work to make the tool aware of NCrunch and able to respond to its environment.
1 user thanked Remco for this useful post.
mgrundner on 7/31/2023(UTC)
mgrundner
#3 Posted : Monday, July 31, 2023 5:45:10 PM(UTC)
Rank: Member

Groups: Registered
Joined: 2/25/2016(UTC)
Posts: 17
Location: Austria

Thanks: 4 times
Was thanked: 3 time(s) in 2 post(s)
Hi Remco!

Yeah I was afraid this is the case, however just wanted to make sure I did not miss any obvious setting or so.

However: I think in combination with NCrunchEnvironment.GetOriginalProjectPath i might get a workaround.

I'll try to figure out a solution with Simon and let you know our progress.

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