Using blocks inside of tests

Hi,

I am trying to structure the output of my tests in the build log. Here is simplistic demo in Powershell:

Write-Host "##teamcity[testStarted name='test1']"
Write-Host "##teamcity[blockOpened name='block']"
Write-Host "##teamcity[blockClosed name='block']"
Write-Host "##teamcity[testFailed name='test1']"
Write-Host "##teamcity[testFinished name='test1']"

Unfortunately, it confuses Teamcity, which reports:

OK test1
OK test1


Doing this works as expected:

Write-Host "##teamcity[blockOpened name='block']"
Write-Host "##teamcity[blockClosed name='block']"
Write-Host "##teamcity[testStarted name='test1']"
Write-Host "##teamcity[testFailed name='test1']"
Write-Host "##teamcity[testFinished name='test1']"



It looks like a bug or unnecessary limitation to me.
Is there any way to achieve what I am trying to do?

Cheers,
Olivier

2 comments
Comment actions Permalink

Hi Olivier,

We have the related issue https://youtrack.jetbrains.com/issue/TW-21377#, please watch/vote for it.

0

Please sign in to leave a comment.