{"action":"opened","number":493,"pull_request":{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493","id":177404346,"html_url":"https://github.com/nunit/nunit3-vs-adapter/pull/493","diff_url":"https://github.com/nunit/nunit3-vs-adapter/pull/493.diff","patch_url":"https://github.com/nunit/nunit3-vs-adapter/pull/493.patch","issue_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/493","number":493,"state":"open","locked":false,"title":"Adding Category Filter for Category Triat","user":{"login":"abhishkk","id":32157767,"avatar_url":"https://avatars2.githubusercontent.com/u/32157767?v=4","gravatar_id":"","url":"https://api.github.com/users/abhishkk","html_url":"https://github.com/abhishkk","followers_url":"https://api.github.com/users/abhishkk/followers","following_url":"https://api.github.com/users/abhishkk/following{/other_user}","gists_url":"https://api.github.com/users/abhishkk/gists{/gist_id}","starred_url":"https://api.github.com/users/abhishkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhishkk/subscriptions","organizations_url":"https://api.github.com/users/abhishkk/orgs","repos_url":"https://api.github.com/users/abhishkk/repos","events_url":"https://api.github.com/users/abhishkk/events{/privacy}","received_events_url":"https://api.github.com/users/abhishkk/received_events","type":"User","site_admin":false},"body":"## Description\r\nWe can pass filters using `/TestCaseFilters` argument while running tests from command line (vstest.console.exe).\r\n\r\nNUnit understands `TestCategory `as a filter but not `Category`.\r\nExample: `/TestCaseFilter:TestCategory=SampleValue` works but `/TestCaseFilter:Category=SampleValue` doesn't work.\r\n\r\nInternally NUnit maps `TestCategory` filter to `Category` trait.\r\nSo while writing test, user needs to write Category trait but while running tests user needs to pass TestCategory as filter.\r\nExample:\r\n```\r\n        While writing: \r\n\r\n        [TestCase]\r\n        [Category(\"SampleValue\")]\r\n        public void TestMethod1()\r\n        {\r\n            Assert.AreEqual(30, 30);\r\n        }\r\n       \r\n        While testing:\r\n        vstest.console.exe NUnitTestProject.dll /TestCaseFilter:TestCategory=SampleValue\r\n```\r\n\r\n## Issue\r\nWhile running NUnit tests from [vstest task](https://github.com/Microsoft/vsts-tasks/tree/master/Tasks/VsTest), we can run tests in:\r\n1. Single agent i.e. non-distributed flow\r\n2. Multiple agents i.e. distributed flow\r\n3. Test run with TIA (test impact analysis) as true\r\n\r\nFor 2nd and 3rd scenario, there comes a requirement in which tests needs to be filtered out at discovery time. As discovery time filtering was not supported for adapters till now (its [supported](https://github.com/Microsoft/vstest/pull/1074) now), TestPlatform filters tests at discovery on its own for these scenarios. \r\n\r\nWhile doing filtering at discovery time, TestPlatform has exact mapping of Filters to traits. i.e. For Category trait, Category filters is understood.\r\n\r\nThus behavior change in TestPlatform side filtering(understand Category filter for Category trait) and adapter side filtering(understand TestCategory filter for Category trait) forces uses\r\n1. TestCategory as filter for running test in single agent (as discovery time filtering is not done by TestPlatform here. Filtering is done by NUnit adapter at execution time)\r\n2. Category as filter for running tests in multiple agents or when TIA is enabled. (as discovery time filtering is done by TestPlatform here)\r\n\r\n## Solution\r\nAdding Category filter in NUnit adapter as well. Now both Category and TestCategory filters will be understood by NUnit and will be internally mapped to Category trait.\r\n\r\nSo now users can pass either Category or TestCategory and both will work.\r\n\r\n## Note\r\nI am planning to add discovery time filtering as well in near future. I will get back soon with that PR as well.\r\n\r\n\r\n","created_at":"2018-03-26T10:32:38Z","updated_at":"2018-03-26T10:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493/commits","review_comments_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493/comments","review_comment_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/493/comments","statuses_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/statuses/dce012ed7a4eedca80a8014f52231c7323749ed1","head":{"label":"abhishkk:addingCategoryFilterForCategoryTriat","ref":"addingCategoryFilterForCategoryTriat","sha":"dce012ed7a4eedca80a8014f52231c7323749ed1","user":{"login":"abhishkk","id":32157767,"avatar_url":"https://avatars2.githubusercontent.com/u/32157767?v=4","gravatar_id":"","url":"https://api.github.com/users/abhishkk","html_url":"https://github.com/abhishkk","followers_url":"https://api.github.com/users/abhishkk/followers","following_url":"https://api.github.com/users/abhishkk/following{/other_user}","gists_url":"https://api.github.com/users/abhishkk/gists{/gist_id}","starred_url":"https://api.github.com/users/abhishkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhishkk/subscriptions","organizations_url":"https://api.github.com/users/abhishkk/orgs","repos_url":"https://api.github.com/users/abhishkk/repos","events_url":"https://api.github.com/users/abhishkk/events{/privacy}","received_events_url":"https://api.github.com/users/abhishkk/received_events","type":"User","site_admin":false},"repo":{"id":108081965,"name":"nunit3-vs-adapter","full_name":"abhishkk/nunit3-vs-adapter","owner":{"login":"abhishkk","id":32157767,"avatar_url":"https://avatars2.githubusercontent.com/u/32157767?v=4","gravatar_id":"","url":"https://api.github.com/users/abhishkk","html_url":"https://github.com/abhishkk","followers_url":"https://api.github.com/users/abhishkk/followers","following_url":"https://api.github.com/users/abhishkk/following{/other_user}","gists_url":"https://api.github.com/users/abhishkk/gists{/gist_id}","starred_url":"https://api.github.com/users/abhishkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhishkk/subscriptions","organizations_url":"https://api.github.com/users/abhishkk/orgs","repos_url":"https://api.github.com/users/abhishkk/repos","events_url":"https://api.github.com/users/abhishkk/events{/privacy}","received_events_url":"https://api.github.com/users/abhishkk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhishkk/nunit3-vs-adapter","description":"NUnit 3.0 Visual Studio test adapter for use under VS 2012 or later","fork":true,"url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter","forks_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/forks","keys_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/teams","hooks_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/hooks","issue_events_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/events","assignees_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/tags","blobs_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/languages","stargazers_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/stargazers","contributors_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/contributors","subscribers_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/subscribers","subscription_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/subscription","commits_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/merges","archive_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/downloads","issues_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/labels{/name}","releases_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/releases{/id}","deployments_url":"https://api.github.com/repos/abhishkk/nunit3-vs-adapter/deployments","created_at":"2017-10-24T05:41:41Z","updated_at":"2018-03-26T06:11:22Z","pushed_at":"2018-03-26T10:01:07Z","git_url":"git://github.com/abhishkk/nunit3-vs-adapter.git","ssh_url":"git@github.com:abhishkk/nunit3-vs-adapter.git","clone_url":"https://github.com/abhishkk/nunit3-vs-adapter.git","svn_url":"https://github.com/abhishkk/nunit3-vs-adapter","homepage":"http://www.nunit.org","size":2977,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nunit:master","ref":"master","sha":"61393b73aaf0821042cc5e79845cdf3c50745894","user":{"login":"nunit","id":2678858,"avatar_url":"https://avatars0.githubusercontent.com/u/2678858?v=4","gravatar_id":"","url":"https://api.github.com/users/nunit","html_url":"https://github.com/nunit","followers_url":"https://api.github.com/users/nunit/followers","following_url":"https://api.github.com/users/nunit/following{/other_user}","gists_url":"https://api.github.com/users/nunit/gists{/gist_id}","starred_url":"https://api.github.com/users/nunit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nunit/subscriptions","organizations_url":"https://api.github.com/users/nunit/orgs","repos_url":"https://api.github.com/users/nunit/repos","events_url":"https://api.github.com/users/nunit/events{/privacy}","received_events_url":"https://api.github.com/users/nunit/received_events","type":"Organization","site_admin":false},"repo":{"id":32686245,"name":"nunit3-vs-adapter","full_name":"nunit/nunit3-vs-adapter","owner":{"login":"nunit","id":2678858,"avatar_url":"https://avatars0.githubusercontent.com/u/2678858?v=4","gravatar_id":"","url":"https://api.github.com/users/nunit","html_url":"https://github.com/nunit","followers_url":"https://api.github.com/users/nunit/followers","following_url":"https://api.github.com/users/nunit/following{/other_user}","gists_url":"https://api.github.com/users/nunit/gists{/gist_id}","starred_url":"https://api.github.com/users/nunit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nunit/subscriptions","organizations_url":"https://api.github.com/users/nunit/orgs","repos_url":"https://api.github.com/users/nunit/repos","events_url":"https://api.github.com/users/nunit/events{/privacy}","received_events_url":"https://api.github.com/users/nunit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nunit/nunit3-vs-adapter","description":"NUnit 3.0 Visual Studio test adapter for use under VS 2012 or later","fork":false,"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter","forks_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/forks","keys_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/teams","hooks_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/hooks","issue_events_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/events{/number}","events_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/events","assignees_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/assignees{/user}","branches_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/branches{/branch}","tags_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/tags","blobs_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/git/refs{/sha}","trees_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/statuses/{sha}","languages_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/languages","stargazers_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/stargazers","contributors_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/contributors","subscribers_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/subscribers","subscription_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/subscription","commits_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/commits{/sha}","git_commits_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/git/commits{/sha}","comments_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/comments{/number}","issue_comment_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/comments{/number}","contents_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/contents/{+path}","compare_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/merges","archive_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/downloads","issues_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues{/number}","pulls_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls{/number}","milestones_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/milestones{/number}","notifications_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/labels{/name}","releases_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/releases{/id}","deployments_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/deployments","created_at":"2015-03-22T17:22:38Z","updated_at":"2018-03-23T20:19:50Z","pushed_at":"2018-03-23T20:19:53Z","git_url":"git://github.com/nunit/nunit3-vs-adapter.git","ssh_url":"git@github.com:nunit/nunit3-vs-adapter.git","clone_url":"https://github.com/nunit/nunit3-vs-adapter.git","svn_url":"https://github.com/nunit/nunit3-vs-adapter","homepage":"http://www.nunit.org","size":2998,"stargazers_count":89,"watchers_count":89,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":47,"open_issues":60,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493"},"html":{"href":"https://github.com/nunit/nunit3-vs-adapter/pull/493"},"issue":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/493"},"comments":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/493/comments"},"review_comments":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493/comments"},"review_comment":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/pulls/493/commits"},"statuses":{"href":"https://api.github.com/repos/nunit/nunit3-vs-adapter/statuses/dce012ed7a4eedca80a8014f52231c7323749ed1"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":61,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"abhishkk"}}