{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/comments/58004552","id":58004552,"diff_hunk":"@@ -171,5 +174,43 @@ private JobCancelMessage CreateJobCancelMessage()\n                 }\n             }\n         }\n+\n+        public static TheoryData<string[], bool, Times> RunAsServiceTestData = new TheoryData<string[], bool, Times>()\n+                                                                    {\n+                                                                        // staring with run command, configured as run as service, should start the agent\n+                                                                        { new [] { \"run\" }, true, Times.Once() },\n+                                                                        // starting with no argument, configured as run as service, should not start agent\n+                                                                        { new string[] { }, true, Times.Never() },\n+                                                                        // starting with no argument, configured not to run as service, should start agent interactively\n+                                                                        { new string[] { }, false, Times.Once() }\n+                                                                    };\n+        [Theory]\n+        [MemberData(\"RunAsServiceTestData\")]\n+        [Trait(\"Level\", \"L0\")]\n+        [Trait(\"Category\", \"Agent\")]\n+        public async void TestExecuteCommandForRunAsService(string[] args, bool configureAsService, Times expectedTimes)\n+        {\n+            using (var thc = new TestHostContext(this))","path":"src/Test/L0/Listener/AgentL0.cs","position":53,"original_position":53,"commit_id":"2bdc3722e7a67ec8c5a6454141d2a6cf4f3fbddb","original_commit_id":"4542ed9453806e9fc7ab57e02bdc46b763b0a0e2","user":{"login":"kasubram","id":17177298,"avatar_url":"https://avatars.githubusercontent.com/u/17177298?v=3","gravatar_id":"","url":"https://api.github.com/users/kasubram","html_url":"https://github.com/kasubram","followers_url":"https://api.github.com/users/kasubram/followers","following_url":"https://api.github.com/users/kasubram/following{/other_user}","gists_url":"https://api.github.com/users/kasubram/gists{/gist_id}","starred_url":"https://api.github.com/users/kasubram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasubram/subscriptions","organizations_url":"https://api.github.com/users/kasubram/orgs","repos_url":"https://api.github.com/users/kasubram/repos","events_url":"https://api.github.com/users/kasubram/events{/privacy}","received_events_url":"https://api.github.com/users/kasubram/received_events","type":"User","site_admin":false},"body":"lol!! I would love to keep it ;)\r\n\r\nChanged the name anyway :( ","created_at":"2016-03-31T06:05:08Z","updated_at":"2016-03-31T06:05:08Z","html_url":"https://github.com/Microsoft/vsts-agent/pull/39#discussion_r58004552","pull_request_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/comments/58004552"},"html":{"href":"https://github.com/Microsoft/vsts-agent/pull/39#discussion_r58004552"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39","id":64441080,"html_url":"https://github.com/Microsoft/vsts-agent/pull/39","diff_url":"https://github.com/Microsoft/vsts-agent/pull/39.diff","patch_url":"https://github.com/Microsoft/vsts-agent/pull/39.patch","issue_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/39","number":39,"state":"open","locked":false,"title":"Not running agent interactively if its configured as runasservice","user":{"login":"kasubram","id":17177298,"avatar_url":"https://avatars.githubusercontent.com/u/17177298?v=3","gravatar_id":"","url":"https://api.github.com/users/kasubram","html_url":"https://github.com/kasubram","followers_url":"https://api.github.com/users/kasubram/followers","following_url":"https://api.github.com/users/kasubram/following{/other_user}","gists_url":"https://api.github.com/users/kasubram/gists{/gist_id}","starred_url":"https://api.github.com/users/kasubram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasubram/subscriptions","organizations_url":"https://api.github.com/users/kasubram/orgs","repos_url":"https://api.github.com/users/kasubram/repos","events_url":"https://api.github.com/users/kasubram/events{/privacy}","received_events_url":"https://api.github.com/users/kasubram/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-29T10:04:29Z","updated_at":"2016-03-31T06:05:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5538daf1817fc079e4013e808c08b6b47259290","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/39/comments","statuses_url":"https://api.github.com/repos/Microsoft/vsts-agent/statuses/2bdc3722e7a67ec8c5a6454141d2a6cf4f3fbddb","head":{"label":"Microsoft:users/kasubram/runasasync","ref":"users/kasubram/runasasync","sha":"2bdc3722e7a67ec8c5a6454141d2a6cf4f3fbddb","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":53052789,"name":"vsts-agent","full_name":"Microsoft/vsts-agent","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vsts-agent","description":"Visual Studio Team Services Build and Release Agent","fork":false,"url":"https://api.github.com/repos/Microsoft/vsts-agent","forks_url":"https://api.github.com/repos/Microsoft/vsts-agent/forks","keys_url":"https://api.github.com/repos/Microsoft/vsts-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vsts-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vsts-agent/teams","hooks_url":"https://api.github.com/repos/Microsoft/vsts-agent/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vsts-agent/events","assignees_url":"https://api.github.com/repos/Microsoft/vsts-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vsts-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vsts-agent/tags","blobs_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vsts-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vsts-agent/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vsts-agent/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vsts-agent/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vsts-agent/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vsts-agent/subscription","commits_url":"https://api.github.com/repos/Microsoft/vsts-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vsts-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vsts-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vsts-agent/merges","archive_url":"https://api.github.com/repos/Microsoft/vsts-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vsts-agent/downloads","issues_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vsts-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vsts-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vsts-agent/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vsts-agent/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vsts-agent/deployments","created_at":"2016-03-03T13:36:48Z","updated_at":"2016-03-24T18:22:59Z","pushed_at":"2016-03-31T05:47:48Z","git_url":"git://github.com/Microsoft/vsts-agent.git","ssh_url":"git@github.com:Microsoft/vsts-agent.git","clone_url":"https://github.com/Microsoft/vsts-agent.git","svn_url":"https://github.com/Microsoft/vsts-agent","homepage":null,"size":634,"stargazers_count":18,"watchers_count":18,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":18,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"abd1fc064c8dc374ff367db5fa6cf34c423cee9a","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":53052789,"name":"vsts-agent","full_name":"Microsoft/vsts-agent","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vsts-agent","description":"Visual Studio Team Services Build and Release Agent","fork":false,"url":"https://api.github.com/repos/Microsoft/vsts-agent","forks_url":"https://api.github.com/repos/Microsoft/vsts-agent/forks","keys_url":"https://api.github.com/repos/Microsoft/vsts-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vsts-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vsts-agent/teams","hooks_url":"https://api.github.com/repos/Microsoft/vsts-agent/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vsts-agent/events","assignees_url":"https://api.github.com/repos/Microsoft/vsts-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vsts-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vsts-agent/tags","blobs_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vsts-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vsts-agent/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vsts-agent/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vsts-agent/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vsts-agent/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vsts-agent/subscription","commits_url":"https://api.github.com/repos/Microsoft/vsts-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vsts-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vsts-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vsts-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vsts-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vsts-agent/merges","archive_url":"https://api.github.com/repos/Microsoft/vsts-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vsts-agent/downloads","issues_url":"https://api.github.com/repos/Microsoft/vsts-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vsts-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vsts-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vsts-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vsts-agent/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vsts-agent/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vsts-agent/deployments","created_at":"2016-03-03T13:36:48Z","updated_at":"2016-03-24T18:22:59Z","pushed_at":"2016-03-31T05:47:48Z","git_url":"git://github.com/Microsoft/vsts-agent.git","ssh_url":"git@github.com:Microsoft/vsts-agent.git","clone_url":"https://github.com/Microsoft/vsts-agent.git","svn_url":"https://github.com/Microsoft/vsts-agent","homepage":null,"size":634,"stargazers_count":18,"watchers_count":18,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39"},"html":{"href":"https://github.com/Microsoft/vsts-agent/pull/39"},"issue":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/issues/39"},"comments":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vsts-agent/statuses/2bdc3722e7a67ec8c5a6454141d2a6cf4f3fbddb"}}}}