How to Get MSTest OwnerAttribute into Jenkins Report? -


i'd owner attribute of our mstest based unittests test reports @ jenkins (by mstest publisher). it's easy see @ jenkins test results report, responsible (failing) unittest.

my test cases like:

[testmethod, owner("aaa")] public void isitrealtest() {     var result = isitreal();     assert.istrue(result); } 

i checked source of jenkins ms test plugin, transforms mstest trx format jenkins readable junit format, don't want change plugin.

another way write test-owner stdout like:

[testmethod, owner("aaa")] public void isitrealtest() {     console.writeline("owner: "+ getownerattributeofcurrentmethod());     var result = isitreal();     assert.istrue(result); } 

but that's not feasible, since have thousands of test cases. tried using testcontext property, automatically set mstest. have base class tests, can following:

    public testcontext testcontext     {                 {             return testcontextinstance;         }         set         {             testcontextinstance = value;         }     }      [testinitialize]     public void init()     {         console.writeline("owner: "+testcontextinstance.properties["xowner"]");     }      //adding custom named property testcontext test cases     [testmethod, owner("aaa"), testproperty("xowner", "bbb")]     public void isitrealtest()     {...} 

the problem is, there xowner property available @ testcontextinstance, not ownerattribute , don't want replace ownerattribute custom named one.

another option be, resolve ownerattribute reflection , other information testcontextinstance, that's ugly workaround.

is there better solution, or should stick custom named property solution ?


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -