{"action":"created","comment":{"url":"https://api.github.com/repos/u-root/u-root/pulls/comments/158744941","pull_request_review_id":85595097,"id":158744941,"diff_hunk":"@@ -103,42 +85,52 @@ func getFreePort(t *testing.T) int {\n \n // TestWget implements a table-driven test.\n func TestWget(t *testing.T) {\n-\ttmpDir, execPath := testutil.CompileInTempDir(t)\n-\tdefer os.RemoveAll(tmpDir)\n-\n \t// Start a webserver on a free port.\n-\tport := getFreePort(t)\n \tunusedPort := getFreePort(t)\n-\th := handler{}\n+\n+\tserver, err := net.Listen(\"tcp\", \":0\")\n+\tif err != nil {\n+\t\tt.Fatalf(\"Cannot get free port for server: %v\", err)\n+\t}\n+\tport := server.Addr().(*net.TCPAddr).Port\n \tgo func() {\n-\t\tt.Fatal(http.ListenAndServe(fmt.Sprintf(\":%d\", port), h))\n+\t\tt.Fatal(http.Serve(server, handler{}))\n \t}()\n \n-\ttime.Sleep(500 * time.Millisecond) // TODO: better synchronization\n \tfor i, tt := range tests {\n-\t\t// Arguments inherited from the environment.\n-\t\texecArgs := strings.Split(os.Getenv(\"EXECPATH\"), \" \")[1:]\n+\t\tt.Run(fmt.Sprintf(\"Test [%02d]\", i), func(t *testing.T) {\n+\t\t\texecPath := os.Getenv(\"EXECPATH\")\n+\t\t\turi := fmt.Sprintf(tt.url, port, unusedPort)\n+\n+\t\t\tvar err error\n+\t\t\tvar out string\n \n-\t\targs := append(append(execArgs, tt.flags...), fmt.Sprintf(tt.url, port, unusedPort))\n-\t\tout, err := exec.Command(execPath, args...).Output()\n+\t\t\tif len(execPath) > 0 {\n+\t\t\t\t// Arguments inherited from the environment.\n+\t\t\t\texecArgs := strings.Fields(execPath)\n+\t\t\t\targs := append(execArgs[1:], uri)\n+\t\t\t\tcmd := exec.Command(execArgs[0], args...)","path":"cmds/wget/wget_test.go","position":131,"original_position":131,"commit_id":"e06f913643117ea7c2aa59274bce19a283039fc1","original_commit_id":"e06f913643117ea7c2aa59274bce19a283039fc1","user":{"login":"rjoleary","id":2763535,"avatar_url":"https://avatars3.githubusercontent.com/u/2763535?v=4","gravatar_id":"","url":"https://api.github.com/users/rjoleary","html_url":"https://github.com/rjoleary","followers_url":"https://api.github.com/users/rjoleary/followers","following_url":"https://api.github.com/users/rjoleary/following{/other_user}","gists_url":"https://api.github.com/users/rjoleary/gists{/gist_id}","starred_url":"https://api.github.com/users/rjoleary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjoleary/subscriptions","organizations_url":"https://api.github.com/users/rjoleary/orgs","repos_url":"https://api.github.com/users/rjoleary/repos","events_url":"https://api.github.com/users/rjoleary/events{/privacy}","received_events_url":"https://api.github.com/users/rjoleary/received_events","type":"User","site_admin":false},"body":"The logic here is similar to `CompileInTempDir`. Are you not using it because you want code coverage?","created_at":"2017-12-26T22:39:59Z","updated_at":"2017-12-26T22:40:28Z","html_url":"https://github.com/u-root/u-root/pull/534#discussion_r158744941","pull_request_url":"https://api.github.com/repos/u-root/u-root/pulls/534","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/u-root/u-root/pulls/comments/158744941"},"html":{"href":"https://github.com/u-root/u-root/pull/534#discussion_r158744941"},"pull_request":{"href":"https://api.github.com/repos/u-root/u-root/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/u-root/u-root/pulls/534","id":160162729,"html_url":"https://github.com/u-root/u-root/pull/534","diff_url":"https://github.com/u-root/u-root/pull/534.diff","patch_url":"https://github.com/u-root/u-root/pull/534.patch","issue_url":"https://api.github.com/repos/u-root/u-root/issues/534","number":534,"state":"open","locked":false,"title":"WIP fix test coverage","user":{"login":"hugelgupf","id":1994130,"avatar_url":"https://avatars2.githubusercontent.com/u/1994130?v=4","gravatar_id":"","url":"https://api.github.com/users/hugelgupf","html_url":"https://github.com/hugelgupf","followers_url":"https://api.github.com/users/hugelgupf/followers","following_url":"https://api.github.com/users/hugelgupf/following{/other_user}","gists_url":"https://api.github.com/users/hugelgupf/gists{/gist_id}","starred_url":"https://api.github.com/users/hugelgupf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugelgupf/subscriptions","organizations_url":"https://api.github.com/users/hugelgupf/orgs","repos_url":"https://api.github.com/users/hugelgupf/repos","events_url":"https://api.github.com/users/hugelgupf/events{/privacy}","received_events_url":"https://api.github.com/users/hugelgupf/received_events","type":"User","site_admin":false},"body":"To fix #116. More coming?","created_at":"2017-12-26T20:00:23Z","updated_at":"2017-12-26T22:40:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2f1042e08d368c733a95a544029332d503c2675","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/u-root/u-root/pulls/534/commits","review_comments_url":"https://api.github.com/repos/u-root/u-root/pulls/534/comments","review_comment_url":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}","comments_url":"https://api.github.com/repos/u-root/u-root/issues/534/comments","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/e06f913643117ea7c2aa59274bce19a283039fc1","head":{"label":"hugelgupf:cover","ref":"cover","sha":"e06f913643117ea7c2aa59274bce19a283039fc1","user":{"login":"hugelgupf","id":1994130,"avatar_url":"https://avatars2.githubusercontent.com/u/1994130?v=4","gravatar_id":"","url":"https://api.github.com/users/hugelgupf","html_url":"https://github.com/hugelgupf","followers_url":"https://api.github.com/users/hugelgupf/followers","following_url":"https://api.github.com/users/hugelgupf/following{/other_user}","gists_url":"https://api.github.com/users/hugelgupf/gists{/gist_id}","starred_url":"https://api.github.com/users/hugelgupf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugelgupf/subscriptions","organizations_url":"https://api.github.com/users/hugelgupf/orgs","repos_url":"https://api.github.com/users/hugelgupf/repos","events_url":"https://api.github.com/users/hugelgupf/events{/privacy}","received_events_url":"https://api.github.com/users/hugelgupf/received_events","type":"User","site_admin":false},"repo":{"id":71191890,"name":"u-root","full_name":"hugelgupf/u-root","owner":{"login":"hugelgupf","id":1994130,"avatar_url":"https://avatars2.githubusercontent.com/u/1994130?v=4","gravatar_id":"","url":"https://api.github.com/users/hugelgupf","html_url":"https://github.com/hugelgupf","followers_url":"https://api.github.com/users/hugelgupf/followers","following_url":"https://api.github.com/users/hugelgupf/following{/other_user}","gists_url":"https://api.github.com/users/hugelgupf/gists{/gist_id}","starred_url":"https://api.github.com/users/hugelgupf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hugelgupf/subscriptions","organizations_url":"https://api.github.com/users/hugelgupf/orgs","repos_url":"https://api.github.com/users/hugelgupf/repos","events_url":"https://api.github.com/users/hugelgupf/events{/privacy}","received_events_url":"https://api.github.com/users/hugelgupf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hugelgupf/u-root","description":"A universal root. You mount it, and it's mostly Go source with the exception of 5 binaries. ","fork":true,"url":"https://api.github.com/repos/hugelgupf/u-root","forks_url":"https://api.github.com/repos/hugelgupf/u-root/forks","keys_url":"https://api.github.com/repos/hugelgupf/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hugelgupf/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hugelgupf/u-root/teams","hooks_url":"https://api.github.com/repos/hugelgupf/u-root/hooks","issue_events_url":"https://api.github.com/repos/hugelgupf/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/hugelgupf/u-root/events","assignees_url":"https://api.github.com/repos/hugelgupf/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/hugelgupf/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/hugelgupf/u-root/tags","blobs_url":"https://api.github.com/repos/hugelgupf/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hugelgupf/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hugelgupf/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/hugelgupf/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hugelgupf/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/hugelgupf/u-root/languages","stargazers_url":"https://api.github.com/repos/hugelgupf/u-root/stargazers","contributors_url":"https://api.github.com/repos/hugelgupf/u-root/contributors","subscribers_url":"https://api.github.com/repos/hugelgupf/u-root/subscribers","subscription_url":"https://api.github.com/repos/hugelgupf/u-root/subscription","commits_url":"https://api.github.com/repos/hugelgupf/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/hugelgupf/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/hugelgupf/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/hugelgupf/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/hugelgupf/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/hugelgupf/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hugelgupf/u-root/merges","archive_url":"https://api.github.com/repos/hugelgupf/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hugelgupf/u-root/downloads","issues_url":"https://api.github.com/repos/hugelgupf/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/hugelgupf/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/hugelgupf/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/hugelgupf/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hugelgupf/u-root/labels{/name}","releases_url":"https://api.github.com/repos/hugelgupf/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/hugelgupf/u-root/deployments","created_at":"2016-10-18T00:10:38Z","updated_at":"2016-10-18T00:10:40Z","pushed_at":"2017-12-26T19:59:46Z","git_url":"git://github.com/hugelgupf/u-root.git","ssh_url":"git@github.com:hugelgupf/u-root.git","clone_url":"https://github.com/hugelgupf/u-root.git","svn_url":"https://github.com/hugelgupf/u-root","homepage":"http://u-root.tk","size":31800,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"u-root:master","ref":"master","sha":"933e1bd2ccb562b48d4ba7e5e0d7f8ce9e854f32","user":{"login":"u-root","id":13317538,"avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"repo":{"id":46462030,"name":"u-root","full_name":"u-root/u-root","owner":{"login":"u-root","id":13317538,"avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/u-root/u-root","description":"A universal root: u-root creates a root file system (initramfs) containing a busybox-like set of tools in Go.","fork":false,"url":"https://api.github.com/repos/u-root/u-root","forks_url":"https://api.github.com/repos/u-root/u-root/forks","keys_url":"https://api.github.com/repos/u-root/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u-root/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u-root/u-root/teams","hooks_url":"https://api.github.com/repos/u-root/u-root/hooks","issue_events_url":"https://api.github.com/repos/u-root/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/u-root/u-root/events","assignees_url":"https://api.github.com/repos/u-root/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/u-root/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/u-root/u-root/tags","blobs_url":"https://api.github.com/repos/u-root/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u-root/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u-root/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/u-root/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/u-root/u-root/languages","stargazers_url":"https://api.github.com/repos/u-root/u-root/stargazers","contributors_url":"https://api.github.com/repos/u-root/u-root/contributors","subscribers_url":"https://api.github.com/repos/u-root/u-root/subscribers","subscription_url":"https://api.github.com/repos/u-root/u-root/subscription","commits_url":"https://api.github.com/repos/u-root/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/u-root/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/u-root/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/u-root/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/u-root/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/u-root/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u-root/u-root/merges","archive_url":"https://api.github.com/repos/u-root/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u-root/u-root/downloads","issues_url":"https://api.github.com/repos/u-root/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/u-root/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/u-root/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/u-root/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u-root/u-root/labels{/name}","releases_url":"https://api.github.com/repos/u-root/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/u-root/u-root/deployments","created_at":"2015-11-19T02:28:59Z","updated_at":"2017-12-26T19:38:10Z","pushed_at":"2017-12-26T20:53:41Z","git_url":"git://github.com/u-root/u-root.git","ssh_url":"git@github.com:u-root/u-root.git","clone_url":"https://github.com/u-root/u-root.git","svn_url":"https://github.com/u-root/u-root","homepage":"http://u-root.tk","size":32828,"stargazers_count":434,"watchers_count":434,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"bsd-3-clause","name":"BSD 3-clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":62,"open_issues":46,"watchers":434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/u-root/u-root/pulls/534"},"html":{"href":"https://github.com/u-root/u-root/pull/534"},"issue":{"href":"https://api.github.com/repos/u-root/u-root/issues/534"},"comments":{"href":"https://api.github.com/repos/u-root/u-root/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/u-root/u-root/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/u-root/u-root/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/u-root/u-root/statuses/e06f913643117ea7c2aa59274bce19a283039fc1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"rjoleary"}}