{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/core-docs/pulls/comments/58156967","id":58156967,"diff_hunk":"@@ -0,0 +1,137 @@\n+dotnet-test\n+================\n+\n+## NAME\n+\n+`dotnet-test` - runs unit test using the configured test runner\n+\n+## SYNOPSIS\n+\n+dotnet-test [--configuration]  \n+    [--output] [--build-base-path] [--framework] [--runtime]\n+    [--no-build]\n+    [--parentProcessId] [--port]  \n+    [< project >]  \n+\n+## DESCRIPTION\n+\n+`dotnet-test` is used to execute unit tests in a given project. Unit tests are class library \n+projects that have dependencies on the unit test framework (e.g. NUnit or xUnit) and the \n+dotnet test runner for that unit testing framework. These are packaged as NuGet packages and are \n+restored as ordinary dependencies for the project.\n+\n+Test projects also need to specify a test runner property in project.json using the \"testRunner\" node. \n+This value should contain the name of the unit test framework.\n+\n+Below is a sample project.json that shows the needed properties:\n+\n+```json\n+{\n+    \"version\": \"1.0.0-*\",\n+\n+    \"dependencies\": {\n+        \"NETStandard.Library\": \"1.0.0-*\",\n+        \"xunit\": \"2.1.0-*\",\n+        \"dotnet-test-xunit\": \"1.0.0-*\"\n+    },\n+    \"testRunner\": \"xunit\",\n+\n+    \"frameworks\": {\n+        \"netstandard1.5\": {\n+        }\n+    }\n+}\n+```\n+Dotnet test supports two running modes:\n+\n+1. Console: In console mode, dotnet test simply executes fully whatever command gets passed to it and outputs the results. Anytime you\n+invoke dotnet test without passing --port, it will run in console mode, which in turn will cause the runner to run in console mode.\n+2. Design time: Anytime you pass a port to dotnet test, we will run in design time. That means that dotnet test will connect to that port\n+using TCP and will then exchange a established set of messages with whatever else is connected to that port. When this happens, the runner\n+also receives a port (a new one, mind you) that dotnet test will use to communicate with it. The reason why the runner also uses TCP to\n+communicate with dotnet test is because in design mode, it is not sufficient to just output results to the console. We need to send the\n+adapter structure messages containing the results of the test execution.\n+\n+### Communication protocol in design time.\n+\n+1. Because during design time, dotnet test connects to a port when it starts up, the adapter needs to be listening on \n+that port otherwise dotnet test will fail. We did it like this so that the adapter could reserve all the ports it needs \n+by binding and listening to them before dotnet test ran and tried to get ports for the runner.\n+2. Once dotnet test starts, it sends a TestSession.Connected message to the adapter indicating that it is ready to receive messages.\n+3. It is possible to send an optional \n+[version check](https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/ProtocolVersionMessage.cs) \n+message with the adapter version of the protocol in it. Dotnet test will send back the version of the protocol that it supports.\n+\n+All messages have the format described here: \n+[Message.cs](https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/Message.cs). \n+The payload formats for each message is described in links to the classes used to de/serialize the information in the description of the protocol.\n+\n+#### Test Execution\n+![alt tag](../images/DotnetTestExecuteTests.png)\n+\n+1. After the optional version check, the adapter sends a TestExecution.GetTestRunnerProcessStartInfo, with the \n+[tests](https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.Extensions.Testing.Abstractions/Messages/RunTestsMessage.cs) it wants to execute inside of it. Dotnet test sends back a FileName and Arguments inside a [TestStartInfo](https://github.com/dotnet/cli/blob/rel/1.0.0/src/dotnet/commands/dotnet-test/TestStartInfo.cs) payload that the adapter can use to start the runner. In the past, we would send the list of tests to run as part of that argument, but we were actually going over the command line size limit for some test projects.","path":"docs/cli/dotnet-test.md","position":73,"original_position":73,"commit_id":"0c1dcd9e4d4a4246fc486363cc022402b3066d45","original_commit_id":"773360eeb075b955b8e497fe9c4f4c44bdebc509","user":{"login":"blackdwarf","id":3115004,"avatar_url":"https://avatars.githubusercontent.com/u/3115004?v=3","gravatar_id":"","url":"https://api.github.com/users/blackdwarf","html_url":"https://github.com/blackdwarf","followers_url":"https://api.github.com/users/blackdwarf/followers","following_url":"https://api.github.com/users/blackdwarf/following{/other_user}","gists_url":"https://api.github.com/users/blackdwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/blackdwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackdwarf/subscriptions","organizations_url":"https://api.github.com/users/blackdwarf/orgs","repos_url":"https://api.github.com/users/blackdwarf/repos","events_url":"https://api.github.com/users/blackdwarf/events{/privacy}","received_events_url":"https://api.github.com/users/blackdwarf/received_events","type":"User","site_admin":false},"body":"This is now moved into its separate document. ","created_at":"2016-04-01T02:58:15Z","updated_at":"2016-04-01T02:58:15Z","html_url":"https://github.com/dotnet/core-docs/pull/391#discussion_r58156967","pull_request_url":"https://api.github.com/repos/dotnet/core-docs/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/comments/58156967"},"html":{"href":"https://github.com/dotnet/core-docs/pull/391#discussion_r58156967"},"pull_request":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/core-docs/pulls/391","id":64821312,"html_url":"https://github.com/dotnet/core-docs/pull/391","diff_url":"https://github.com/dotnet/core-docs/pull/391.diff","patch_url":"https://github.com/dotnet/core-docs/pull/391.patch","issue_url":"https://api.github.com/repos/dotnet/core-docs/issues/391","number":391,"state":"open","locked":false,"title":"Add CLI documentation","user":{"login":"blackdwarf","id":3115004,"avatar_url":"https://avatars.githubusercontent.com/u/3115004?v=3","gravatar_id":"","url":"https://api.github.com/users/blackdwarf","html_url":"https://github.com/blackdwarf","followers_url":"https://api.github.com/users/blackdwarf/followers","following_url":"https://api.github.com/users/blackdwarf/following{/other_user}","gists_url":"https://api.github.com/users/blackdwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/blackdwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackdwarf/subscriptions","organizations_url":"https://api.github.com/users/blackdwarf/orgs","repos_url":"https://api.github.com/users/blackdwarf/repos","events_url":"https://api.github.com/users/blackdwarf/events{/privacy}","received_events_url":"https://api.github.com/users/blackdwarf/received_events","type":"User","site_admin":false},"body":"Added documentation for the CLI. It contains two main groups of\r\ndocuments:\r\n\r\n1. Conceptual docs - docs that deal with how the CLI works, what the\r\nare the portability types of applications and the overview.\r\n2. Reference docs - command line reference docs for each command as\r\nwell as the install script.\r\n\r\nAnother document is the DNX -> CLI migration document that is part of\r\nthis change.\r\n\r\nFixes #391 \r\nRelates to #322 \r\n\r\n/cc @mairaw @danroth27 @cartermp @richlander ","created_at":"2016-03-31T16:41:59Z","updated_at":"2016-04-01T02:58:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2e5188d52e9684d31f2aac284ef5c5f7dff47e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/core-docs/pulls/391/commits","review_comments_url":"https://api.github.com/repos/dotnet/core-docs/pulls/391/comments","review_comment_url":"https://api.github.com/repos/dotnet/core-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/core-docs/issues/391/comments","statuses_url":"https://api.github.com/repos/dotnet/core-docs/statuses/0c1dcd9e4d4a4246fc486363cc022402b3066d45","head":{"label":"blackdwarf:clidocs","ref":"clidocs","sha":"0c1dcd9e4d4a4246fc486363cc022402b3066d45","user":{"login":"blackdwarf","id":3115004,"avatar_url":"https://avatars.githubusercontent.com/u/3115004?v=3","gravatar_id":"","url":"https://api.github.com/users/blackdwarf","html_url":"https://github.com/blackdwarf","followers_url":"https://api.github.com/users/blackdwarf/followers","following_url":"https://api.github.com/users/blackdwarf/following{/other_user}","gists_url":"https://api.github.com/users/blackdwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/blackdwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackdwarf/subscriptions","organizations_url":"https://api.github.com/users/blackdwarf/orgs","repos_url":"https://api.github.com/users/blackdwarf/repos","events_url":"https://api.github.com/users/blackdwarf/events{/privacy}","received_events_url":"https://api.github.com/users/blackdwarf/received_events","type":"User","site_admin":false},"repo":{"id":35895436,"name":"core-docs","full_name":"blackdwarf/core-docs","owner":{"login":"blackdwarf","id":3115004,"avatar_url":"https://avatars.githubusercontent.com/u/3115004?v=3","gravatar_id":"","url":"https://api.github.com/users/blackdwarf","html_url":"https://github.com/blackdwarf","followers_url":"https://api.github.com/users/blackdwarf/followers","following_url":"https://api.github.com/users/blackdwarf/following{/other_user}","gists_url":"https://api.github.com/users/blackdwarf/gists{/gist_id}","starred_url":"https://api.github.com/users/blackdwarf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackdwarf/subscriptions","organizations_url":"https://api.github.com/users/blackdwarf/orgs","repos_url":"https://api.github.com/users/blackdwarf/repos","events_url":"https://api.github.com/users/blackdwarf/events{/privacy}","received_events_url":"https://api.github.com/users/blackdwarf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blackdwarf/core-docs","description":"Experimenting with docs.","fork":true,"url":"https://api.github.com/repos/blackdwarf/core-docs","forks_url":"https://api.github.com/repos/blackdwarf/core-docs/forks","keys_url":"https://api.github.com/repos/blackdwarf/core-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blackdwarf/core-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blackdwarf/core-docs/teams","hooks_url":"https://api.github.com/repos/blackdwarf/core-docs/hooks","issue_events_url":"https://api.github.com/repos/blackdwarf/core-docs/issues/events{/number}","events_url":"https://api.github.com/repos/blackdwarf/core-docs/events","assignees_url":"https://api.github.com/repos/blackdwarf/core-docs/assignees{/user}","branches_url":"https://api.github.com/repos/blackdwarf/core-docs/branches{/branch}","tags_url":"https://api.github.com/repos/blackdwarf/core-docs/tags","blobs_url":"https://api.github.com/repos/blackdwarf/core-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blackdwarf/core-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blackdwarf/core-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/blackdwarf/core-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blackdwarf/core-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/blackdwarf/core-docs/languages","stargazers_url":"https://api.github.com/repos/blackdwarf/core-docs/stargazers","contributors_url":"https://api.github.com/repos/blackdwarf/core-docs/contributors","subscribers_url":"https://api.github.com/repos/blackdwarf/core-docs/subscribers","subscription_url":"https://api.github.com/repos/blackdwarf/core-docs/subscription","commits_url":"https://api.github.com/repos/blackdwarf/core-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/blackdwarf/core-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/blackdwarf/core-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/blackdwarf/core-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/blackdwarf/core-docs/contents/{+path}","compare_url":"https://api.github.com/repos/blackdwarf/core-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blackdwarf/core-docs/merges","archive_url":"https://api.github.com/repos/blackdwarf/core-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blackdwarf/core-docs/downloads","issues_url":"https://api.github.com/repos/blackdwarf/core-docs/issues{/number}","pulls_url":"https://api.github.com/repos/blackdwarf/core-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/blackdwarf/core-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/blackdwarf/core-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blackdwarf/core-docs/labels{/name}","releases_url":"https://api.github.com/repos/blackdwarf/core-docs/releases{/id}","deployments_url":"https://api.github.com/repos/blackdwarf/core-docs/deployments","created_at":"2015-05-19T16:47:30Z","updated_at":"2016-01-11T18:26:56Z","pushed_at":"2016-03-31T23:53:18Z","git_url":"git://github.com/blackdwarf/core-docs.git","ssh_url":"git@github.com:blackdwarf/core-docs.git","clone_url":"https://github.com/blackdwarf/core-docs.git","svn_url":"https://github.com/blackdwarf/core-docs","homepage":null,"size":10299,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"604341ea15f5bbf1e2771510e901c780a5459e57","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":35890081,"name":"core-docs","full_name":"dotnet/core-docs","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/core-docs","description":".NET Core documentation (work in progress).","fork":false,"url":"https://api.github.com/repos/dotnet/core-docs","forks_url":"https://api.github.com/repos/dotnet/core-docs/forks","keys_url":"https://api.github.com/repos/dotnet/core-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/core-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/core-docs/teams","hooks_url":"https://api.github.com/repos/dotnet/core-docs/hooks","issue_events_url":"https://api.github.com/repos/dotnet/core-docs/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/core-docs/events","assignees_url":"https://api.github.com/repos/dotnet/core-docs/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/core-docs/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/core-docs/tags","blobs_url":"https://api.github.com/repos/dotnet/core-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/core-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/core-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/core-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/core-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/core-docs/languages","stargazers_url":"https://api.github.com/repos/dotnet/core-docs/stargazers","contributors_url":"https://api.github.com/repos/dotnet/core-docs/contributors","subscribers_url":"https://api.github.com/repos/dotnet/core-docs/subscribers","subscription_url":"https://api.github.com/repos/dotnet/core-docs/subscription","commits_url":"https://api.github.com/repos/dotnet/core-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/core-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/core-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/core-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/core-docs/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/core-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/core-docs/merges","archive_url":"https://api.github.com/repos/dotnet/core-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/core-docs/downloads","issues_url":"https://api.github.com/repos/dotnet/core-docs/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/core-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/core-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/core-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/core-docs/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/core-docs/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/core-docs/deployments","created_at":"2015-05-19T15:13:32Z","updated_at":"2016-03-21T14:38:35Z","pushed_at":"2016-04-01T00:29:25Z","git_url":"git://github.com/dotnet/core-docs.git","ssh_url":"git@github.com:dotnet/core-docs.git","clone_url":"https://github.com/dotnet/core-docs.git","svn_url":"https://github.com/dotnet/core-docs","homepage":"http://dotnet.github.io/docs/index.html","size":14161,"stargazers_count":62,"watchers_count":62,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":142,"forks":76,"open_issues":142,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/391"},"html":{"href":"https://github.com/dotnet/core-docs/pull/391"},"issue":{"href":"https://api.github.com/repos/dotnet/core-docs/issues/391"},"comments":{"href":"https://api.github.com/repos/dotnet/core-docs/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/core-docs/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/core-docs/statuses/0c1dcd9e4d4a4246fc486363cc022402b3066d45"}}}}