microsoft / testfx-docs

Docs for MSTest V2 test framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get Tfs Run id as TestContext.Properties["__Tfs_TestRunId__"] not available

anshuls01 opened this issue · comments

Hello Team,

in the earlier version of MSTEST TestContext.Properties["Tfs_TestRunId"] gives the TestRunId, not able to find the way in MSTEST V2, please help.

TestRunId is required to query the TFS database for Test analytics.

I checked the API documentation, but not able to find right document, I am sure information must be there.
Please help.

@anshuls01 : Is this issue similar to microsoft/testfx#353 ??

We are afraid but the test context parameters related to tfs/tcm are available only in MSTest currently and are not yet available in MSTestV2.

Kind request - This repo is purely for documentation purposes and please do not post issues here. You can post your queries to Testfx

Not exactly similar to Microsoft/testfx#353

in the First one TestContext get initialize at Test class level, and inherently available to Test Method, if write a Testmethod Extension, TestContext is not available during Test Method invocation (Execute), (as we have in the MsTest with TestMethodInvoker interface.)
due to that, we are facing issue to control the behavior of Test case during execution in case of TestMethod Attribute Extension used.

I think I've found the workaround for the first one, I need to test that and will update the above later

in the above, main issue is, To track the test case later point of time if need to query Tfs Database we require some sort of identifier.
in earlier version MTM run id provided, but in the current version, no such Identifier found.

For the main issue, MSTestV2 does not currently have support for tfs test context properties. We will be adding that in our upcoming releases.

Hello Jaya,

thanks for the response, do we have any ETA for this.

Thanks
Anshul

Tagging @pvlakshm, @cltshivash to prioritise this.

Hello Jaya,

any update on the above..., still waiting for the reply.

Thanks
Anshul

Hello @jayaranigarg @pvlakshm @cltshivash

This is blocking my migration task from the old version where both __Tfs_TestRunId__ and __Tfs_TestCaseId__ are in use.
Do you have any update?

Thanks

Closing the issue as this was fixed in 1.4.0-beta .
https://github.com/Microsoft/testfx/releases/tag/v1.4.0-beta