JetBrains / teamcity-messages

Python Unit Test Reporting to TeamCity
https://pypi.python.org/pypi/teamcity-messages
Apache License 2.0
138 stars 81 forks source link

The flowId attribute in service messages makes tests unable to be nested under a suite #265

Open Nikerino opened 2 years ago

Nikerino commented 2 years ago

I'm currently using teamcity-messages with Python's unittest module.

When running my tests, I created a custom result class to output testSuiteStarted and testSuiteFinished messages before and after the tests run. Whenever these run on TeamCity, the test suite is shown in the build log, but the individual tests are not nested under the test suite. Additionally, when attempting to view all test suites that ran, the tests are not recognized to be a part of the suite.

I believe this is being caused by the flowId attribute. Whenever I output custom service messages without the flowId attribute, the individual tests become nested under the test suite without issue. It doesn't seem like there is a way to customize this attribute without making a custom result class and customizing every single service message for the tests, because the flowId attribute gets set automatically to the name of the individual test running.

The flowId attribute could be set to None by default, since it is interfering with the default behavior of test reporting.