{"action":"closed","issue":{"url":"https://api.github.com/repos/xunit/xunit/issues/1052","repository_url":"https://api.github.com/repos/xunit/xunit","labels_url":"https://api.github.com/repos/xunit/xunit/issues/1052/labels{/name}","comments_url":"https://api.github.com/repos/xunit/xunit/issues/1052/comments","events_url":"https://api.github.com/repos/xunit/xunit/issues/1052/events","html_url":"https://github.com/xunit/xunit/issues/1052","id":195466259,"number":1052,"title":"Trait attributes do  not end up as TestCategory elements in test results","user":{"login":"hkoestin","id":13849875,"avatar_url":"https://avatars.githubusercontent.com/u/13849875?v=3","gravatar_id":"","url":"https://api.github.com/users/hkoestin","html_url":"https://github.com/hkoestin","followers_url":"https://api.github.com/users/hkoestin/followers","following_url":"https://api.github.com/users/hkoestin/following{/other_user}","gists_url":"https://api.github.com/users/hkoestin/gists{/gist_id}","starred_url":"https://api.github.com/users/hkoestin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkoestin/subscriptions","organizations_url":"https://api.github.com/users/hkoestin/orgs","repos_url":"https://api.github.com/users/hkoestin/repos","events_url":"https://api.github.com/users/hkoestin/events{/privacy}","received_events_url":"https://api.github.com/users/hkoestin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-14T08:13:42Z","updated_at":"2016-12-15T16:38:36Z","closed_at":"2016-12-15T16:38:36Z","body":"Hello,\r\n\r\nI try to achieve something like the following: on test methods, I would like to specify traits, which reflect e.g. the test-case number on TFS, which this unit test is \"implementing\". When I then run and execute the tests on TFS, I would like to have the .TRX file reflecting these specified traits as TestCategory elements, to be able to display this column in VS test results or on TFS. However, these attributes are not transformed/mapped to the TRX file.\r\n\r\nWhen I have MSTest unit tests in my tests, the TestCategory attribute becomes mapped into the TRX result file and later on can be displayed like the following:\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21174160/ca294636-c1db-11e6-8b40-da78f99a6e7d.png)\r\n\r\nIn the TRX file, the corresponding section can be found in the <TestDefinitions> section of the XML.\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21174188/f889adae-c1db-11e6-9bcf-60ac113a00d1.png)\r\n\r\nAfter reading the following post on the ALM blog, I actually assumed, that the xUnit Trait attribute becomes mapped to the TestCategory attribute of MSTest and then is also available in the TRX file.\r\nSee: https://blogs.msdn.microsoft.com/visualstudioalm/2013/06/11/part-3-unit-testing-with-traits-and-code-coverage-in-visual-studio-2012-using-the-tfs-build-and-the-new-nuget-adapter-approach/\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21174252/4d02e36e-c1dc-11e6-8d53-75c04b658d14.png)\r\n\r\nAs it seems, this is not done. I checked some of the code of the test adapter of xUnit, but have not found anything, which would map the trait to a test-category item. Is this correct?\r\n\r\nWhat I have tried/done so far:\r\n\r\nThe test case with the traits on it (just tried different ones to see, if it is working for some of them):\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21149393/a307a244-c15b-11e6-8eb9-8c5a236a4c23.png)\r\n\r\nWhen I execute the tests using vstest on TFS, I get a TRX file afterwards, which I publish to the test results. This file however does not include any of the traits.\r\n\r\nIs this as designed or is this simply missing the mapping?\r\nOr am I missing some things?\r\n\r\nStrangely enough, even though I followed your steps of how to run tests and upload results in TFS (see https://xunit.github.io/docs/getting-test-results-in-vsts.html), I do not see the xUnit Test Adapter to be chosen in the TRX file:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21174350/eeab9bfc-c1dc-11e6-95d5-28f75baf1751.png)\r\n\r\nOn the build output of TFS I see xUnit.net taking over the execution:\r\n![image](https://cloud.githubusercontent.com/assets/13849875/21174417/46728954-c1dd-11e6-8bdd-5577bd5af1a8.png)\r\n\r\nCan somebody probably explain to me, what is happening here?\r\n\r\nThanks for any help regarding this!\r\n\r\nBest regards,\r\nHarald\r\n\r\n"}}
{"actor":{"display_login":"bradwilson"}}