{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/825","labels_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/825/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/825/comments","events_url":"https://api.github.com/repos/Microsoft/vso-agent-tasks/issues/825/events","html_url":"https://github.com/Microsoft/vso-agent-tasks/issues/825","id":117439294,"number":825,"title":"Unable to publish VSTest.Console.exe trx results with coverage when using VSO","user":{"login":"tillig","id":1156571,"avatar_url":"https://avatars.githubusercontent.com/u/1156571?v=3","gravatar_id":"","url":"https://api.github.com/users/tillig","html_url":"https://github.com/tillig","followers_url":"https://api.github.com/users/tillig/followers","following_url":"https://api.github.com/users/tillig/following{/other_user}","gists_url":"https://api.github.com/users/tillig/gists{/gist_id}","starred_url":"https://api.github.com/users/tillig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tillig/subscriptions","organizations_url":"https://api.github.com/users/tillig/orgs","repos_url":"https://api.github.com/users/tillig/repos","events_url":"https://api.github.com/users/tillig/events{/privacy}","received_events_url":"https://api.github.com/users/tillig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-17T20:10:08Z","updated_at":"2015-11-17T20:10:08Z","closed_at":null,"body":"I'm trying to set up a test run that...\r\n- Has two different test assemblies\r\n- Uses the Visual Studio test process (`VSTest.Console.exe` or similar)\r\n- Uses the XUnit test adapter\r\n- Generates unit test and coverage reporting\r\n- Publishes both unit test and coverage reports to Visual Studio Online\r\n\r\nI have tried this both with the \"Publish Test Results\" task and the \"Visual Studio Test\" task in VSO and both seem to result in the same end:\r\n- Test (`.trx`) and coverage (`.coverage`) reports correctly get generated.\r\n- The test run results can be published to VSO and seen correctly showing pass/fail data\r\n- The coverage report attachments are effectively ignored and not published to VSO.\r\n\r\nUsing **Publish Test Results** I'm setting it to publish all `*.trx` files and I see this in the build console log (slightly anonymized):\r\n\r\n```\r\n2015-11-17T19:30:08.0410663Z Starting task: Publish Test Results artifacts\\log\\*.trx\r\n2015-11-17T19:30:08.0450653Z Executing the powershell script: C:\\LR\\MMS\\Services\\Mms\\TaskAgentProvisioner\\Tools\\agents\\default\\tasks\\PublishTestResults\\1.0.8\\PublishTestResults.ps1\r\n2015-11-17T19:30:09.1166936Z Publishing Test Results...\r\n2015-11-17T19:30:10.1348908Z Test results remaining: 127\r\n2015-11-17T19:30:12.2366542Z Published Test Run : https://{myaccount}.visualstudio.com/DefaultCollection/{myproject}/_TestManagement/Runs#runId=7&_a=runCharts\r\n2015-11-17T19:30:12.2417178Z Finishing task: PublishTestResults\r\n```\r\n\r\nUsing **Visual Studio Test** I set it to enable code coverage and see this in the build console log (again, slightly anonymized):\r\n\r\n```\r\n2015-11-17T18:17:09.6398120Z Executing the powershell script: C:\\LR\\MMS\\Services\\Mms\\TaskAgentProvisioner\\Tools\\agents\\default\\tasks\\VSTest\\1.0.23\\VSTest.ps1\r\n2015-11-17T18:17:10.0504981Z ##[debug]Calling Invoke-VSTest for all test assemblies\r\n2015-11-17T18:17:10.0814968Z Working folder: C:\\a\\1\r\n2015-11-17T18:17:10.0825036Z Executing C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe \"C:\\a\\1\\s\\test\\path\\to\\First.Test.dll\" \"C:\\a\\1\\s\\test\\path\\to\\Second.Test.dll\"  /EnableCodeCoverage /logger:trx /TestAdapterPath:\"C:\\a\\1\\s\"\r\n2015-11-17T18:17:10.4124962Z Microsoft (R) Test Execution Command Line Tool Version 14.0.23107.0\r\n2015-11-17T18:17:10.4134971Z Copyright (c) Microsoft Corporation.  All rights reserved.\r\n2015-11-17T18:17:10.6624984Z Starting test execution, please wait...\r\n2015-11-17T18:17:10.7414979Z Warning: Using Isolation mode to run the tests as diagnostic data adapters were enabled in the runsettings. Use the /inIsolation parameter to suppress this warning.\r\n2015-11-17T18:17:16.8032957Z Information: [xUnit.net 00:00:00.8190682]   Discovering: First.Test\r\n2015-11-17T18:17:18.8392954Z Information: [xUnit.net 00:00:05.1647814]   Discovered:  First.Test\r\n2015-11-17T18:17:19.4053356Z Information: [xUnit.net 00:00:05.7308698]   Discovering: Second.Test\r\n2015-11-17T18:17:19.9483349Z Information: [xUnit.net 00:00:06.2739958]   Discovered:  Second.Test\r\n2015-11-17T18:17:21.2105507Z Information: [xUnit.net 00:00:07.5353653]   Starting:    First.Test\r\n2015-11-17T18:17:22.3115505Z Passed   ... {lots of test results} ...\r\n2015-11-17T18:17:25.6675497Z Information: [xUnit.net 00:00:11.9929482]   Finished:    First.Test\r\n2015-11-17T18:17:26.9758206Z Information: [xUnit.net 00:00:13.3016524]   Starting:    Second.Test\r\n2015-11-17T18:17:27.0208214Z Passed   ... {lots of test results} ...\r\n2015-11-17T18:17:28.2678212Z Information: [xUnit.net 00:00:14.5937729]   Finished:    Second.Test2015-11-17T18:17:28.5998215Z Results File: C:\\a\\1\\TestResults\\buildguest_TASKAGENT2-0020 2015-11-17 18_17_22.trx\r\n2015-11-17T18:17:28.6028221Z Attachments:\r\n2015-11-17T18:17:28.6028221Z   C:\\a\\1\\TestResults\\2b3c2d78-37bb-4f48-a359-42609a01e32e\\buildguest_TASKAGENT2-0020 2015-11-17 18_17_12.coverage\r\n2015-11-17T18:17:28.6038220Z Total tests: 127. Passed: 127. Failed: 0. Skipped: 0.\r\n2015-11-17T18:17:28.6038220Z Test Run Successful.\r\n2015-11-17T18:17:28.6048219Z Test execution time: 14.9136 Seconds\r\n2015-11-17T18:17:28.7168209Z Publishing Test Results...\r\n2015-11-17T18:17:29.5084495Z Test results remaining: 127\r\n2015-11-17T18:17:30.9148148Z Published Test Run : https://{myaccount}.visualstudio.com/DefaultCollection/{myproject}/_TestManagement/Runs#runId=2&_a=runCharts\r\n```\r\n\r\nIn the latter case, I even see it acknowledges that there's a `.coverage` attachment but it doesn't show up in VSO.\r\n\r\nI've verified that the `.trx` and `.coverage` files open correctly and are correctly read in Visual Studio if I download them. They do show up as downloadable items in the VSO Run Explorer. And the VSO Run Explorer shows the unit test pass/fail results, just not the associated coverage. Coverage also doesn't appear in the build summary dashboard - you always see the message, \"No build code coverage data available. Enable code coverage via a test task in your build definition eg. Visual Studio Test.\"\r\n\r\n**Is there a setting I'm missing or is this a defect in the tasks as running in Visual Studio Online?**"}}