Closed chrisgeorge0911 closed 5 years ago
This is likely to be a bug in the teamcity extension but to be sure, can you tell us what the name of the test case is in the XML result?
Below is an output from the latest console/teamcity extension which outputs both the NUnit Console's labels, and the TeamCity messages. From this, the problem appears to lie in the teamcity extension - I'll transfer this issue over shortly. 🙂
C:\Users\chris\OneDrive\Documents\git\NUnitTest>nunit3-console "bin/Debug/net45/NUnitTest.dll" --teamcity --labels=Before
NUnit Console Runner 3.10.0 (.NET 2.0)
Copyright (c) 2019 Charlie Poole, Rob Prouse
30 May 2019 23:26:25
Runtime Environment
OS Version: Microsoft Windows NT 10.0.17134.0
CLR Version: 4.0.30319.42000
Test Files
bin/Debug/net45/NUnitTest.dll
##teamcity[flowStarted flowId='PID_4552_0-1004' parent='PID_4552']
##teamcity[testSuiteStarted name='NUnitTest.dll' flowId='PID_4552_0-1004']
=> Tests.Tests.TestMethod1("test1",":")
##teamcity[flowStarted flowId='PID_4552_0-1001' parent='PID_4552_0-1004']
##teamcity[testStarted name='Tests.Tests.TestMethod1("test1"," ")' captureStandardOutput='false' flowId='PID_4552_0-1001']
##teamcity[testFinished name='Tests.Tests.TestMethod1("test1"," ")' duration='11' flowId='PID_4552_0-1001']
@chrisgeorge0911 unfortunately I have to replace the colon symbol because of TeamCity treats it as a delimiter of an assembly name and a test class/method name. As alternative I could replace it by '%3A' for instance. But in your test report you will see the line like Tests.Test1("test1","%3A")
. Or I could add a parameter to specify a replacement string.
@chrisgeorge0911 unfortunately I have to replace the colon symbol because of TeamCity treats it as a delimiter of an assembly name and a test class/method name. As alternative I could replace it by '%3A' for instance. But in your test report you will see the line like
Tests.Test1("test1","%3A")
. Or I could add a parameter to specify a replacement string.
@NikolayPianikov how about replacing ":" with "\<colon>"? My worry with "%3A" is that its more likely to be used as a parameter along with specifying the actual ":" character. "\<colon>" is very unlikely to be used as a parameter, but would still uniquely identify that particular test case.
@chrisgeorge0911 Ok, I will add the environment variable to specify the value for this replacement and by default it will be "
Sounds great 👍 thanks
Fix will be available in NUnit.Extension.TeamCityEventListener 1.0.7
For reference, as this isn't currently anywhere on the net, the environment variable you can use to override the default <colon>
is TEAMCITY_COLON_REPLACEMENT
.
Nunit 3.11 / Nunit console 3.10
Having a simple parameterised testcase such as
Runs fine, but with --teamcity, the resulting teamcity service messages look like:
Notice the lack of colon's in the test1 lines.
This becomes a problem when there are other parameterised tests that actually pass a space, because teamcity underreports the number of issues as they are not unique.