azure-pipelines-tasks: Visual Studio Test Task doesn't set env variable of current attempt when rerunning failed tests

When running unit tests, VSTest task sets some list of environment variables like TE.RerunFailedTests or DTA.RerunFailedTestCasesMaxLimit or TE.RerunMaxAttempts. These environment variables are also available for test, that’s useful.

When task reruns failed tests, in console output we see:

2020-02-12T16:01:37.6663270Z **************** Rerunning failed tests for Test run 1000048 *********************
2020-02-12T16:01:37.6663989Z Max attempts: 3; Current attempt: 1; Failed test cases threshold: 30; Failed test cases max limit: 0

All this information is available via environment variables, but not for Current attempt: 1.

It would be nice if Task/DTAHost will set environment variable. Then test would see this variable and apply additional business logic, or something else.

Screenshot of task configuration: image

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Still awaiting it to be implemented.