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

Notification

Icon
Error

Problems with tests pinning.
Marqus
#1 Posted : Wednesday, May 29, 2019 9:18:10 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 2/22/2012(UTC)
Posts: 38
Location: Poland

Thanks: 2 times
Was thanked: 6 time(s) in 6 post(s)
Hi,

In our team we are often using test pinning with 'Run pinned tests automatically, others manually'. I've got two problems:
1. In 'NCrunch Tests' window we can pin tests only on class level, there's no appropriate operation in context menu on namespace and assembly level. This would greatly speed up test pinning.
2. Where is information about pinned tests saved? Often after 'svn update' operation my pinned tests are lost, and some other tests are pinned, so I have to spend some time to pin them back. I've looked in .ncrunchproject and .ncrunchsolution but didn't found any trace of 'pinned tests'.
Remco
#2 Posted : Wednesday, May 29, 2019 11:47:08 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting.

The pinning of namespaces opens an interesting question about expected behaviour. If you were to pin a namespace, would you expect it to pin only the tests visible in the tests window under your chosen namespace, or would you expect it to pin ALL the tests in the namespace regardless of whether the tests window was showing them?

If a new fixture is then created under the namespace, would it be automatically pinned?

The intuitive answer would probably be that it would pin all the tests in the namespace, and the new fixture would also be pinned. The implementation of such a thing because it would mean adding the namespace itself as concept inside NCrunch's model, with a persistent status to indicate that it's been pinned. If you were to remove the tests under that namespace, the pinned namespace would no longer show. If a test was then added under the namespace several weeks later, it would suddenly be pinned unexpectedly.

It's much simpler to handle these problems at fixture and test level, because we already have persistent objects we can apply the status to, and they have a clear and well determine life cycle. The pinned status for tests and fixtures is stored in the NCrunch .cache file, so it should be saved automatically on a clean exit. Probably if you forcefully shut down it might be possible that the status could be lost with the rest of the session state (in which case you'd get the .cache from the last session).
Marqus
#3 Posted : Wednesday, May 29, 2019 12:37:27 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 2/22/2012(UTC)
Posts: 38
Location: Poland

Thanks: 2 times
Was thanked: 6 time(s) in 6 post(s)
Hi, Remco.

I see your point. But I think, that we shouldn't pin namespace, but only all test fixtures that are currently inside this namespace (or assembly). If I add new fixture into such namespace I will see that it's not running (coverage markers will tell me this) and I will know, that I have to pin it manually. This way, you won't have to add any new concept.
Thank you pointing me to .cache file - now I find out, that our build system sometimes automatically removes them, and this destroys pinning status.
Remco
#4 Posted : Wednesday, May 29, 2019 9:54:09 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Marqus;13542 wrote:
I see your point. But I think, that we shouldn't pin namespace, but only all test fixtures that are currently inside this namespace (or assembly). If I add new fixture into such namespace I will see that it's not running (coverage markers will tell me this) and I will know, that I have to pin it manually. This way, you won't have to add any new concept.


Good thinking :) Thanks for your ideas here. We'll look into this one.
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.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download