So I think you are saying that TeamCity expects to see a sequence like
SuiteStart-TestStart-TestFinish-TestStart-Test-Finish...SuiteFinish
##teamcity[testSuiteStarted name='suiteName']##teamcity[testSuiteStarted name='nestedSuiteName']##teamcity[testStarted name='package_or_namespace.ClassName.TestName']##teamcity[testFailed name='package_or_namespace.ClassName.TestName'message='The number should be 20000'details='junit.framework.AssertionFailedError: expected:<20000> but was:<10000>|n|r at junit.framework.Assert.fail(Assert.java:47)|n|r at junit.framework.Assert.failNotEquals(Assert.java:280)|n|r...']##teamcity[testFinished name='package_or_namespace.ClassName.TestName']##teamcity[testSuiteFinished name='nestedSuiteName']##teamcity[testSuiteFinished name='suiteName']
It will use flowid to put messages into different buckets, but it
expects that the sequence will remain intact within each bucket.
Right?
We could create a flowid that matched the worker thread running the
tests and that would satisfy TC for the moment. However, it seems that
this would be broken as soon as we implement parallel execution of
tests _within_ a given fixture.
OTOH, if we create the problem, then the TC guys would probably be
motivated to find a way to resolve it.
Here's an idea. Could we use the unique id of the test fixture for all
the tests?
##teamcity[testSuiteStarted name='nunit.framework.tests.dll' flowId='4396']##teamcity[testSuiteStarted name='NUnit' flowId='4397']##teamcity[testSuiteStarted name='Common' flowId='4401']##teamcity[testSuiteStarted name='Tests' flowId='4402']##teamcity[testSuiteStarted name='CommandLineTests' flowId='3808']##teamcity[testStarted name='AssemblyAloneIsValid' captureStandardOutput='true' flowId='3842']##teamcity[testFinished name='AssemblyAloneIsValid' duration='0.163' flowId='3842']##teamcity[testStarted name='AssemblyName' captureStandardOutput='true' flowId='3841']##teamcity[testFinished name='AssemblyName' duration='0.001' flowId='3841']##teamcity[testSuiteStarted name='CanRecognizeBooleanOptions' flowId='3817']##teamcity[testStarted name='CanRecognizeBooleanOptions("TeamCity","teamcity")' captureStandardOutput='true' flowId='3810']
##teamcity[testFinished name='CanRecognizeBooleanOptions("TeamCity","teamcity")' duration='0.015' flowId='3810']
##teamcity[testStarted name='NUnit.Framework.Assertions.AssertInconclusiveTests.ThrowsInconclusiveException' captureStandardOutput='true' flowId='1220']
That's looking pretty decent, although what I am seeing is individual tests grouped by namespace, not by classname. For example, the very first grouping is for NUnit.Framework.Assertions - a namespace - while under it the individual items are similar to EqualsFixture.DirectoryInfoEqual. There's no grouping for the test class "EqualsFixture" - is that what you want to show?
Are you aware that you also have classname and methodname available to you? Since users can change the names of tests to any arbitrary string, the FullName of the test may have no relation all to the Name.
I'm wondering if CaptureStandardOutput has any meaning at all, since NUnit already captures it in order to include the output in the test result. We may miss some output if it's created by a non-nunit thread. You may want to experiment with this.
We did the latter in NUnit 2.x.
I've opened two issues, one for the test id uniqueness https://github.com/nunit/nunit/issues/582 and one for the parallel execution and service messages https://github.com/nunit/nunit/issues/583
That's looking pretty decent, although what I am seeing is individual tests grouped by namespace, not by classname. For example, the very first grouping is for NUnit.Framework.Assertions - a namespace - while under it the individual items are similar to EqualsFixture.DirectoryInfoEqual. There's no grouping for the test class "EqualsFixture" - is that what you want to show?
Are you looking at my screenshots or changes you made? I'm seeing the grouping for EqualsFixture under TC8 and TC9. I've attached a screenshot again.
Are you aware that you also have classname and methodname available to you? Since users can change the names of tests to any arbitrary string, the FullName of the test may have no relation all to the Name.I think this is the expected behavior, if they are overriding the name wouldn't they want it to appear in TC that way? If we used classname/methodname I think I would need to modify the nunit2 driver to include those.
I'm wondering if CaptureStandardOutput has any meaning at all, since NUnit already captures it in order to include the output in the test result. We may miss some output if it's created by a non-nunit thread. You may want to experiment with this.I'm looking into CaptureStandardOutput now and will open another issue for it.
We did the latter in NUnit 2.x.Is there somewhere I can see this implementation? That would give me an idea of how involved the changes would be.
...
...
Test Run SummaryOverall result: FailedTests run: 670, Passed: 664, Errors: 5, Failures: 1, Inconclusive: 0Not run: 1, Invalid: 0, Ignored: 1, Skipped: 0Start time: 2015-04-28 20:58:13ZEnd time: 2015-04-28 20:59:57ZDuration: 103.606 seconds
-------------------------------------------------Count | TC Service message-------------------------------------------------671 | ##teamcity[testStarted670 | ##teamcity[testFinished1 | ##teamcity[testIgnored6 | ##teamcity[testFailed-------------------------------------------------
##teamcity[testStarted name='My.Project.Tests.Unit.My_Test_Name' captureStandardOutput='true' flowId='0-1473']##teamcity[testIgnored name='My.Project.Tests.Unit.My_Test_Name' message='Investigate' flowId='0-1473']##teamcity[testStarted name='My.Project.Tests.Unit.Another_Test_Name' captureStandardOutput='true' flowId='0-1474']
...
...
--