Extending the logic for IsMatchingTestCase

6 views
Skip to first unread message

Kapil Sachdeva

unread,
Oct 29, 2014, 10:30:15 AM10/29/14
to pickl...@googlegroups.com
Hi

First of all, this project is impressive and seems to answer most of my needs. Many thanks for taking this initiative.

Here is what we do in our team -

a) We make use of SpecFlow

b) We have written a custom NUnit fixture generator plugin for SpecFlow

c) We have written a custom NUnit AddIn that introduces new TestCase attributes and have hooks into parameterization process

End result is that a Scenario Outline like this :

| param1 | param 2| param 3|
| 45         | 34         |  TipToe |

gets translated into the testcase name :

MyNameSpace.MySenarioName(param1=45-param2=34-param3-TipToe)

Because of all this customization of our testcases we are not able to make use of the functionality to connect the test results with the features using pickles

I started to read the code and here is what I have discovered :

- You have NUnitExampleSignatureBuilder that constructs the testcase name regular expression
- NUnitSingleResults::IsMatchingTestCase then tries to match the testcase name  read from the xml file with the regular expression

The regularexpression expects the name to be same as the one that nunit will generate by default

Essentially, if I can modify either the regular expression or the name read from the nunit xml file then I would get the match.

This brings few challenges :

a) I would have to re-write NUnit support in TestFrameworks and call it MyCustomSingleResults.cs
b) I would have to write my own PickleModule that would register MyCustomSingleResults
c) I would have to write my own command line program (or rather duplicate it) and use my own PickleModule 

I believe it is doable but doing so much modification to change the implementation of one or two methods is requiring lot of changes.

Is there any obvious path that I am missing here that would help me the same objective in a simpler way ?

Please educate.

Regards
Kapil









Dirk Rombauts

unread,
Oct 29, 2014, 10:37:53 AM10/29/14
to pickl...@googlegroups.com
Hi,

Thanks for the praise!

As you found out for yourself, Pickles was not designed for this kind of extensibility. I've been thinking about making things more modular so that test result formats (and output formats too) can be registered in a more dynamic way, but I didn't get around to that yet. My "open source development time" is quite limited at the moment :-(

So I'm afraid that there currently is no nice way of achieving what you want - your options are basically the three scenarios you outline.

Regards,
Dirk

Kapil Sachdeva

unread,
Oct 29, 2014, 10:45:55 AM10/29/14
to pickl...@googlegroups.com
Thanks Dirk.

Appreciated the quick reply.

Regards
Kapil
Reply all
Reply to author
Forward
0 new messages