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

Notification

Icon
Error

Duplicate test rows with conflicting states
jnm236
#1 Posted : Tuesday, January 10, 2017 8:11:03 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2015(UTC)
Posts: 57
Location: United States of America

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
I have NUnit tests with a number of parameterized test cases. NCrunch displays all the test cases in the Tests window underneath the test row, but then it duplicates five of them at the bottom and doesn't update the state. They say "Running (first time)" and "Pending, impacted" while the copy above says "Passed" or "Failed."

If I click on one, both rows show that they are selected. One of the duplicate rows cannot be selected at all.

Clicking "resync, rebuild and rerun" does not fix the problem, but clicking the visibility buttons (passed, failed, question mark and skipped) makes the duplicate rows disappear and everything is back to normal.
This keeps happening with different tests though, so I thought I'd report it.
Remco
#2 Posted : Tuesday, January 10, 2017 9:43:16 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this issue.

Has NCrunch given you any warnings about the test cases having the same name? Are you able to share the code used to generate the tests? (Note that the content of the tests isn't relevant here, just the NUnit declarations used to create their names)
jnm236
#3 Posted : Tuesday, January 10, 2017 10:51:38 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2015(UTC)
Posts: 57
Location: United States of America

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
NCrunch has not given any warnings.

This is the code from the one that was just bothering me:

Code:

        public static IEnumerable<TestCaseData> AllGridControls() => 
            from type in typeof(BaseView).Assembly.GetTypes()
            where type.IsSubclassOf(typeof(Control)) && !type.IsAbstract
            from gridControlField in type.GetFieldsInHierarchy(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
            where typeof(GridControl).IsAssignableFrom(gridControlField.FieldType)
            select new TestCaseData(type, gridControlField)
                .SetNameParameters(type.Name, gridControlField.Name);

        [TestCaseSource(nameof(AllGridControls))]
        public void ConditionalFormattingIsValid(Type viewType, FieldInfo gridControlField)
        {
            // ...
        }


There's quite a bit going on there, but I verified just now that all TestCaseData.TestNames being returned are unique as I expect.
Remco
#4 Posted : Wednesday, January 11, 2017 1:48:53 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 960 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for sharing these extra details. I'm starting to think this might actually be a UI issue.

- Have you seen this happen for any tests in your suite that don't originate from TestCaseSource?

- Which grouping option are you using in the Tests Window?

- Does adjusting the sorting in the Tests Window have any impact on the problem?

- Can you submit a bug report after you've had this happen to you? The log may yield something useful.
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