nunit / teamcity-event-listener

NUnit Engine extension that helps integration with teamcity
MIT License
11 stars 10 forks source link

Alternatives for colon replacement, which presently alters all testnames and history #72

Open abelbraaksma opened 4 years ago

abelbraaksma commented 4 years ago

I'm aware of the resolved issue #68, but I'm not sure this should have gone live without a fair warning ahead, as in TeamCity, where this is typically used, this can have quite a visible impact and it effects the counting of tests (it shouldn't, but afaik TC + NUnit is not capable of distinguishing equal-named tests).

We have now three possible versions:

I realize that there is no easy way out of this unless TeamCity fixes this, but since this was already reported to TC in 2012, and nothing has changed, I doubt it has much priority.

To keep the exact name, however, that link provides a workaround that goes a long way in preventing duplicates:

then TC has no problem with it anymore.

Last nitbit: perhaps these and other environment variables could get a public place where their meaning is explained? Searching for TEAMCITY_COLON_REPLACEMENT yields literally nothing on any search engine.

NikolayPianikov commented 4 years ago

@abelbraaksma Thank you for your ideas. Solution 2 looks nice from my point of view. I will add variables and their descriptions to readme file.

abelbraaksma commented 4 years ago

I just notice that that character doesn't render on Chrome on Android. Though I doubt many people run TC from Android.

(2) is easy to do, I guess, though for the long term I'd opt for solution (1). Not sure if it's hard or easy to implement though.

Thanks for looking into this :).

Vorval0 commented 4 years ago

We are using TeamCity in the following scenario: failedTestName have failed in TC → get failed test names by TC API → pass --where test==failedTestName into rerun of the build configuration. Replacing : to anything breaks our scenario as NUnit can't find the failedTestName after modification.

I am aware of the Retry Attribute but it is not fit for our needs.

abelbraaksma commented 4 years ago

@Vorval0, this replacement is already active in the current TC listener. If you don't have problems now, you won't get problems later.

This proposal is about making the default more predictable,it currently is the string <colon>. With or without this change, you always have the TEAMCITY_COLON_REPLACEMENT that you can use. Set it to : and you'd be good.

abelbraaksma commented 4 years ago

Btw, the bug is with TC, which uses the colon as separator. Only when you have colons in the test name, TC screws up and reports it wrongly (see linked big report). Without the listener fixing this, you would get wrong data from the TC api anyway. It has nothing to do with NUnit, a name is a name, this doesn't affect that.

If your current setup works, you probably don't have colons in your test names. If you don't have colons, the TC listener won't change anything.