{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/7457","repository_url":"https://api.github.com/repos/Microsoft/vsts-tasks","labels_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/7457/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/7457/comments","events_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/7457/events","html_url":"https://github.com/Microsoft/vsts-tasks/issues/7457","id":332028595,"node_id":"MDU6SXNzdWUzMzIwMjg1OTU=","number":7457,"title":"Updating VSTest task to v2 causes elasticsearch tests to fail","user":{"login":"roizentner","id":24566282,"node_id":"MDQ6VXNlcjI0NTY2Mjgy","avatar_url":"https://avatars0.githubusercontent.com/u/24566282?v=4","gravatar_id":"","url":"https://api.github.com/users/roizentner","html_url":"https://github.com/roizentner","followers_url":"https://api.github.com/users/roizentner/followers","following_url":"https://api.github.com/users/roizentner/following{/other_user}","gists_url":"https://api.github.com/users/roizentner/gists{/gist_id}","starred_url":"https://api.github.com/users/roizentner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roizentner/subscriptions","organizations_url":"https://api.github.com/users/roizentner/orgs","repos_url":"https://api.github.com/users/roizentner/repos","events_url":"https://api.github.com/users/roizentner/events{/privacy}","received_events_url":"https://api.github.com/users/roizentner/received_events","type":"User","site_admin":false},"labels":[{"id":391088422,"node_id":"MDU6TGFiZWwzOTEwODg0MjI=","url":"https://api.github.com/repos/Microsoft/vsts-tasks/labels/Area:%20Test","name":"Area: Test","color":"b60205","default":false}],"state":"open","locked":false,"assignee":{"login":"ShreyasRmsft","id":25194518,"node_id":"MDQ6VXNlcjI1MTk0NTE4","avatar_url":"https://avatars1.githubusercontent.com/u/25194518?v=4","gravatar_id":"","url":"https://api.github.com/users/ShreyasRmsft","html_url":"https://github.com/ShreyasRmsft","followers_url":"https://api.github.com/users/ShreyasRmsft/followers","following_url":"https://api.github.com/users/ShreyasRmsft/following{/other_user}","gists_url":"https://api.github.com/users/ShreyasRmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/ShreyasRmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShreyasRmsft/subscriptions","organizations_url":"https://api.github.com/users/ShreyasRmsft/orgs","repos_url":"https://api.github.com/users/ShreyasRmsft/repos","events_url":"https://api.github.com/users/ShreyasRmsft/events{/privacy}","received_events_url":"https://api.github.com/users/ShreyasRmsft/received_events","type":"User","site_admin":false},"assignees":[{"login":"ShreyasRmsft","id":25194518,"node_id":"MDQ6VXNlcjI1MTk0NTE4","avatar_url":"https://avatars1.githubusercontent.com/u/25194518?v=4","gravatar_id":"","url":"https://api.github.com/users/ShreyasRmsft","html_url":"https://github.com/ShreyasRmsft","followers_url":"https://api.github.com/users/ShreyasRmsft/followers","following_url":"https://api.github.com/users/ShreyasRmsft/following{/other_user}","gists_url":"https://api.github.com/users/ShreyasRmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/ShreyasRmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShreyasRmsft/subscriptions","organizations_url":"https://api.github.com/users/ShreyasRmsft/orgs","repos_url":"https://api.github.com/users/ShreyasRmsft/repos","events_url":"https://api.github.com/users/ShreyasRmsft/events{/privacy}","received_events_url":"https://api.github.com/users/ShreyasRmsft/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-06-13T14:46:05Z","updated_at":"2018-06-15T13:12:42Z","closed_at":null,"author_association":"NONE","body":"## Environment\r\n- Server - VSTS\r\n- Agent - Private\r\n- Agent OS: Windows\r\n- Agent version: 2.134.2\r\n\r\n## Issue Description\r\nHi,\r\nI've been going through my old build definitions, updating the VSTest task from v1 to v2.\r\nEverything was going great until I updated a task that runs Elasticsearch tests.\r\nThe failing tests include the use of https://github.com/poulfoged/Elasticsearch-Inside\r\nAll the tests which involve Elasticsearch Aggregations fail, whereas other Elasticsearch tests succeed.\r\n\r\nI can't seem to understand why updating the VSTest task version causes this behavior.\r\n\r\nHere's the code snippet which causes the failure:\r\n```c#\r\nIExpressionBuilder expressionBuilder = mExpressionFactory.CreateBuilder(scope);\r\n           ISearchResponse<ElasticItem> response = await ReadClient\r\n                .SearchAsync<ElasticItem>(s => s\r\n                    .Source(false)\r\n                    .Size(0)\r\n                    .Query(q => q\r\n                        .Bool(b => b\r\n                            .Filter(bf => bf\r\n                                .DateRange(dr => dr\r\n                                    .Field(f => f.StartTime)\r\n                                    .GreaterThanOrEquals(range.Item1)\r\n                                    .LessThanOrEquals(range.Item2)))))\r\n                    .Aggregations(a => a\r\n                        .DateHistogram(INTERVALS, t => t\r\n                            .Field(i => i.StartTime)\r\n                            .Interval((DateInterval)interval)\r\n                            .ExtendedBounds(range.Item1, range.Item2)\r\n                            .Aggregations(ia => ia\r\n                                .Sum(SUM1, ms => ms.Field(expressionBuilder.Sum1Expression))\r\n                                .Sum(SUM2, ms => ms.Field(expressionBuilder.Sum2Expression)))))\r\n                ).ConfigureAwait(false);\r\n```\r\n\r\n### Error logs\r\nTest method ElasticSearch.Tests.GetRange_RootYearInterval_ValidResult threw exception: \r\nElasticsearch.Net.UnexpectedElasticsearchClientException: Collection is read-only. ---> System.NotSupportedException: Collection is read-only."},"comment":{"url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/comments/397615680","html_url":"https://github.com/Microsoft/vsts-tasks/issues/7457#issuecomment-397615680","issue_url":"https://api.github.com/repos/Microsoft/vsts-tasks/issues/7457","id":397615680,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzYxNTY4MA==","user":{"login":"roizentner","id":24566282,"node_id":"MDQ6VXNlcjI0NTY2Mjgy","avatar_url":"https://avatars0.githubusercontent.com/u/24566282?v=4","gravatar_id":"","url":"https://api.github.com/users/roizentner","html_url":"https://github.com/roizentner","followers_url":"https://api.github.com/users/roizentner/followers","following_url":"https://api.github.com/users/roizentner/following{/other_user}","gists_url":"https://api.github.com/users/roizentner/gists{/gist_id}","starred_url":"https://api.github.com/users/roizentner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roizentner/subscriptions","organizations_url":"https://api.github.com/users/roizentner/orgs","repos_url":"https://api.github.com/users/roizentner/repos","events_url":"https://api.github.com/users/roizentner/events{/privacy}","received_events_url":"https://api.github.com/users/roizentner/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T13:12:42Z","updated_at":"2018-06-15T13:12:42Z","author_association":"NONE","body":"Hi @ShreyasRmsft, and thanks for responding so quickly.\r\nYour request for build logs (with system.debug=true) made me curious so I started checking them myself.\r\n\r\nFirst of all, I was a bit inaccurate in my initial post regarding the update of the VStest task to v2. I actually replaced my explicit v1 task with a task group that had v2. **That's when the tests started failing**.\r\n\r\nAfter endless runs with little tweaks, I've narrowed it down to the root cause:\r\nThe v2 task I am using has a slightly different value in the \"_Test assemblies_\" parameter.\r\nThe difference is I added the following exclusion pattern: `!**\\Microsoft*.dll`\r\nThis caused the task to exclude **Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll** from the list of assemblies.\r\nSince my tests are not in this assembly, I thought it would save time to exclude all assemblies but the one where my test is.\r\nThen I tried a different approach:\r\nInstead of having the following patterns:\r\n```\r\n**\\*test*.dll\r\n!**\\Microsoft*.dll\r\n```\r\nI tried using a more specific include pattern: `**\\*ElasticSearch*test*.dll` and it worked (the tests passed).\r\n\r\nI'd love getting an explanation for this behavior."}}
{"actor":{"display_login":"roizentner"}}