I am in need to control execution of later steps based on values of statistics from former steps. E.g. I want to do some further actions when there is more failed tests than certain threshold. I tried to solve this by 'curling' TC REST API and getting number of failed tests from there (http....statistics/FailedTestCount). This works fine when I am asking this value after the build is completed, but when this command is part of build step, I get error response stating 'No statistics data for key: PassedTestCount'.
I am curious, is there some delay before I can ask this test statistic, or is it getting published after build finishes? I can see number of passed tests when given build step finishes (progress message of build changes to 'Tests passed: N').
Footnote: Is there some other way to get these statistics into build step script?