{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/52898952","id":52898952,"diff_hunk":"@@ -1,125 +1,231 @@\n #!/bin/bash\n-\n-# See HACKING.md for usage\n+#\n+# This script runs Go language unit tests for the Origin repository. Arguments to this script\n+# are parsed as a list of packages to test. If none are given, then \"all\" packages are tested. \n+# Coverage reports and jUnit XML reports can be generated by this script as well, but both cannot\n+# be generated at once.\n+#\n+# This script consumes the following parameters as environment variables:\n+#  - PRINT_PACKAGES:      prints all packages that would be tested and exits, dry run\n+#  - TEST_KUBE:           toggles testing of non-essential Kubernetes unit tests\n+#  - TIMEOUT:             the timeout for any one unit test (default '60s')\n+#  - DETECT_RACES:        toggles the 'go test' race detector (defaults '-race')\n+#  - COVERAGE_OUTPUT_DIR: locates the directory in which coverage output files will be placed\n+#  - COVERAGE_SPEC:       a set of flags for 'go test' that specify the coverage behavior (default '-cover -covermode=atomic')\n+#  - GOTEST_FLAGS:        any other flags to be sent to 'go test'\n+#  - JUNIT_REPORT:        toggles the creation of jUnit XML from the test output and changes this script's output behavior\n+#                         to use the 'junitreport' tool for summarizing the tests.\n \n set -o errexit\n set -o nounset\n set -o pipefail\n \n-STARTTIME=$(date +%s)\n-OS_ROOT=$(dirname \"${BASH_SOURCE}\")/..\n-source \"${OS_ROOT}/hack/common.sh\"\n+function exit_trap() {\n+    local return_code=$?\n \n-# Go to the top of the tree.\n-cd \"${OS_ROOT}\"\n+    end_time=$(date +%s)\n+    \n+    if [[ \"${return_code}\" -eq \"0\" ]]; then\n+        verb=\"succeeded\"\n+    else\n+        verb=\"failed\"\n+    fi\n \n-PRINT_PACKAGES=${PRINT_PACKAGES:-\"\"}\n-TEST_KUBE=${TEST_KUBE:-\"\"}\n-KUBE_GODEP_PATH=\"./Godeps/_workspace/src/k8s.io/kubernetes/pkg\"\n+    echo \"$0 ${verb} after $((${end_time} - ${start_time})) seconds\"\n+    exit \"${return_code}\"\n+}\n+\n+trap exit_trap EXIT\n \n+start_time=$(date +%s)","path":"hack/test-go.sh","position":50,"original_position":50,"commit_id":"bcd848360cfee747bb726c74e0bfe7f3a273df3e","original_commit_id":"bcd848360cfee747bb726c74e0bfe7f3a273df3e","user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"body":"I think I'll stick with `date +%s` for now to keep this parallel with other scripts - we can fix this in the trap PR.","created_at":"2016-02-15T13:37:28Z","updated_at":"2016-02-15T13:37:28Z","html_url":"https://github.com/openshift/origin/pull/6604#discussion_r52898952","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/6604","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/52898952"},"html":{"href":"https://github.com/openshift/origin/pull/6604#discussion_r52898952"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/6604"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/6604","id":55535838,"html_url":"https://github.com/openshift/origin/pull/6604","diff_url":"https://github.com/openshift/origin/pull/6604.diff","patch_url":"https://github.com/openshift/origin/pull/6604.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/6604","number":6604,"state":"open","locked":false,"title":"rewrite hack/test-go.sh to support jUnit","user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"body":"This re-writes `hack/test-go.sh`. All flags for `go test` are now passed in as environment variables. All arguments are parsed as packages to test, https://github.com/openshift/origin/pull/5274. jUnit report XML generation is now supported.\r\n\r\n@liggitt @deads2k PTAL\r\n\r\n@rhcarvalho FYI\r\n\r\n@smarterclayton @pmorie please confirm that we don't need to blacklist Kubernetes runtime tests anymore, reason given was for a long-since-merged PR:\r\n```\r\n# The tests for the upstream runtime package are not solvent currently due to a patch for:\r\n# https://github.com/kubernetes/kubernetes/pull/9971\r\n```","created_at":"2016-01-09T05:36:48Z","updated_at":"2016-02-15T13:37:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4738a569237d88e8c8c0bed66d9e0c20389d6fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/6604/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/6604/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/6604/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/bcd848360cfee747bb726c74e0bfe7f3a273df3e","head":{"label":"stevekuznetsov:skuznets/test-go-junit","ref":"skuznets/test-go-junit","sha":"bcd848360cfee747bb726c74e0bfe7f3a273df3e","user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"repo":{"id":35963136,"name":"origin","full_name":"stevekuznetsov/origin","owner":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevekuznetsov/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/stevekuznetsov/origin","forks_url":"https://api.github.com/repos/stevekuznetsov/origin/forks","keys_url":"https://api.github.com/repos/stevekuznetsov/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevekuznetsov/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevekuznetsov/origin/teams","hooks_url":"https://api.github.com/repos/stevekuznetsov/origin/hooks","issue_events_url":"https://api.github.com/repos/stevekuznetsov/origin/issues/events{/number}","events_url":"https://api.github.com/repos/stevekuznetsov/origin/events","assignees_url":"https://api.github.com/repos/stevekuznetsov/origin/assignees{/user}","branches_url":"https://api.github.com/repos/stevekuznetsov/origin/branches{/branch}","tags_url":"https://api.github.com/repos/stevekuznetsov/origin/tags","blobs_url":"https://api.github.com/repos/stevekuznetsov/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevekuznetsov/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevekuznetsov/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevekuznetsov/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevekuznetsov/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/stevekuznetsov/origin/languages","stargazers_url":"https://api.github.com/repos/stevekuznetsov/origin/stargazers","contributors_url":"https://api.github.com/repos/stevekuznetsov/origin/contributors","subscribers_url":"https://api.github.com/repos/stevekuznetsov/origin/subscribers","subscription_url":"https://api.github.com/repos/stevekuznetsov/origin/subscription","commits_url":"https://api.github.com/repos/stevekuznetsov/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevekuznetsov/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevekuznetsov/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevekuznetsov/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevekuznetsov/origin/contents/{+path}","compare_url":"https://api.github.com/repos/stevekuznetsov/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevekuznetsov/origin/merges","archive_url":"https://api.github.com/repos/stevekuznetsov/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevekuznetsov/origin/downloads","issues_url":"https://api.github.com/repos/stevekuznetsov/origin/issues{/number}","pulls_url":"https://api.github.com/repos/stevekuznetsov/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/stevekuznetsov/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/stevekuznetsov/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevekuznetsov/origin/labels{/name}","releases_url":"https://api.github.com/repos/stevekuznetsov/origin/releases{/id}","deployments_url":"https://api.github.com/repos/stevekuznetsov/origin/deployments","created_at":"2015-05-20T17:28:25Z","updated_at":"2016-01-12T13:39:08Z","pushed_at":"2016-02-15T13:32:30Z","git_url":"git://github.com/stevekuznetsov/origin.git","ssh_url":"git@github.com:stevekuznetsov/origin.git","clone_url":"https://github.com/stevekuznetsov/origin.git","svn_url":"https://github.com/stevekuznetsov/origin","homepage":"http://www.openshift.org","size":205343,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openshift:master","ref":"master","sha":"a895672cd89ef4711f60adedfdd4382ac200a2de","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-02-15T08:29:10Z","pushed_at":"2016-02-15T13:28:02Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":257338,"stargazers_count":1032,"watchers_count":1032,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":631,"mirror_url":null,"open_issues_count":842,"forks":631,"open_issues":842,"watchers":1032,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/6604"},"html":{"href":"https://github.com/openshift/origin/pull/6604"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/6604"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/6604/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/6604/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/6604/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/bcd848360cfee747bb726c74e0bfe7f3a273df3e"}}}}