{"action":"created","comment":{"url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/comments/33376313","id":33376313,"diff_hunk":"@@ -18,15 +18,92 @@ BUILD_DOCS=\"yes\"\n RUN_DEMO=\"yes\"\n PRODUCT=\"\"\n NO_FETCH=0\n+PRINT_FAIL=0\n+COLORIZE=0\n \n-# Buildbot remotely invokes scripts with a stripped down environment.  \n+# Buildbot remotely invokes scripts with a stripped down environment.\n umask 002\n \n+sbar=$(printf %78s |tr \" \" \"-\")\n+tbar=$(printf %78s |tr \" \" \"~\")\n+\n+set_color() {\n+    if [ $COLORIZE -eq 1 ]; then\n+        echo -ne \"$@\"\n+    fi\n+}\n+\n+no_color() {\n+    if [ $COLORIZE -eq 1 ]; then\n+        echo -ne $NO_COLOR\n+    fi\n+}\n+\n+print_success() {\n+    set_color $LIGHT_GREEN\n+    echo -e \"$@\"\n+    no_color\n+}\n+\n+print_info() {\n+    set_color $YELLOW\n+    echo -e \"$@\"\n+    no_color\n+}\n+\n+# XXX this script is very inconsistent about what is sent to stdout vs stderr\n print_error() {\n-    >&2 echo $@\n+    set_color $LIGHT_RED\n+    >&2 echo -e \"$@\"\n+    no_color\n }\n \n-options=(getopt --long build_number:,branch:,product:,skip_docs,skip_demo,no-fetch -- \"$@\")\n+start_section() {\n+    print_info \"### $@\"\n+    print_info $tbar\n+}\n+\n+end_section() {\n+    print_info $sbar\n+    echo -ne \"\\n\"\n+}\n+\n+print_build_failure() {\n+    for pkg in \"${PACKAGES[@]}\"; do\n+        build_dir=${LSSTSW_BUILD_DIR}/${pkg}\n+        build_log=${build_dir}/_build.log\n+        test_dir=${build_dir}/tests/.tests\n+\n+        # check to see if build log exists\n+        if [ ! -e $build_log ]; then\n+            # no log means that package was not [attempted] to be be built\n+            # on this run\n+            continue\n+        fi\n+\n+        # check to see if package had any failed tests\n+        shopt -s nullglob\n+        failed_tests=(${test_dir}/*.failed)\n+\n+        if [ ${#failed_tests[@]} -ne 0 ]; then\n+            # only print the build log if there were test failures","path":"lsstswBuild.sh","position":86,"original_position":86,"commit_id":"8770ce0150afb5f95278c10cfce36380219ead8a","original_commit_id":"073ee142af69af8b5e4a9893edc07818ebb19864","user":{"login":"ktlim","id":1054393,"avatar_url":"https://avatars.githubusercontent.com/u/1054393?v=3","gravatar_id":"","url":"https://api.github.com/users/ktlim","html_url":"https://github.com/ktlim","followers_url":"https://api.github.com/users/ktlim/followers","following_url":"https://api.github.com/users/ktlim/following{/other_user}","gists_url":"https://api.github.com/users/ktlim/gists{/gist_id}","starred_url":"https://api.github.com/users/ktlim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktlim/subscriptions","organizations_url":"https://api.github.com/users/ktlim/orgs","repos_url":"https://api.github.com/users/ktlim/repos","events_url":"https://api.github.com/users/ktlim/events{/privacy}","received_events_url":"https://api.github.com/users/ktlim/received_events","type":"User","site_admin":false},"body":"That was my point, not that the comment or the test are inconsistent, but that they're not doing what we want.","created_at":"2015-06-26T17:24:07Z","updated_at":"2015-06-26T17:24:07Z","html_url":"https://github.com/lsst-sqre/buildbot-scripts/pull/6#discussion_r33376313","pull_request_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/comments/33376313"},"html":{"href":"https://github.com/lsst-sqre/buildbot-scripts/pull/6#discussion_r33376313"},"pull_request":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6","id":38662793,"html_url":"https://github.com/lsst-sqre/buildbot-scripts/pull/6","diff_url":"https://github.com/lsst-sqre/buildbot-scripts/pull/6.diff","patch_url":"https://github.com/lsst-sqre/buildbot-scripts/pull/6.patch","issue_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/6","number":6,"state":"open","locked":false,"title":"print failed tests","user":{"login":"jhoblitt","id":948901,"avatar_url":"https://avatars.githubusercontent.com/u/948901?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoblitt","html_url":"https://github.com/jhoblitt","followers_url":"https://api.github.com/users/jhoblitt/followers","following_url":"https://api.github.com/users/jhoblitt/following{/other_user}","gists_url":"https://api.github.com/users/jhoblitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoblitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoblitt/subscriptions","organizations_url":"https://api.github.com/users/jhoblitt/orgs","repos_url":"https://api.github.com/users/jhoblitt/repos","events_url":"https://api.github.com/users/jhoblitt/events{/privacy}","received_events_url":"https://api.github.com/users/jhoblitt/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-26T15:51:20Z","updated_at":"2015-06-26T17:24:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4aacd5b7b09782048a3d2e3a027ed5a7103202fb","assignee":{"login":"timj","id":60622,"avatar_url":"https://avatars.githubusercontent.com/u/60622?v=3","gravatar_id":"","url":"https://api.github.com/users/timj","html_url":"https://github.com/timj","followers_url":"https://api.github.com/users/timj/followers","following_url":"https://api.github.com/users/timj/following{/other_user}","gists_url":"https://api.github.com/users/timj/gists{/gist_id}","starred_url":"https://api.github.com/users/timj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timj/subscriptions","organizations_url":"https://api.github.com/users/timj/orgs","repos_url":"https://api.github.com/users/timj/repos","events_url":"https://api.github.com/users/timj/events{/privacy}","received_events_url":"https://api.github.com/users/timj/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6/commits","review_comments_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6/comments","review_comment_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/6/comments","statuses_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/statuses/8770ce0150afb5f95278c10cfce36380219ead8a","head":{"label":"jhoblitt:feature/print-failed-tests","ref":"feature/print-failed-tests","sha":"8770ce0150afb5f95278c10cfce36380219ead8a","user":{"login":"jhoblitt","id":948901,"avatar_url":"https://avatars.githubusercontent.com/u/948901?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoblitt","html_url":"https://github.com/jhoblitt","followers_url":"https://api.github.com/users/jhoblitt/followers","following_url":"https://api.github.com/users/jhoblitt/following{/other_user}","gists_url":"https://api.github.com/users/jhoblitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoblitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoblitt/subscriptions","organizations_url":"https://api.github.com/users/jhoblitt/orgs","repos_url":"https://api.github.com/users/jhoblitt/repos","events_url":"https://api.github.com/users/jhoblitt/events{/privacy}","received_events_url":"https://api.github.com/users/jhoblitt/received_events","type":"User","site_admin":false},"repo":{"id":32540458,"name":"buildbot-scripts","full_name":"jhoblitt/buildbot-scripts","owner":{"login":"jhoblitt","id":948901,"avatar_url":"https://avatars.githubusercontent.com/u/948901?v=3","gravatar_id":"","url":"https://api.github.com/users/jhoblitt","html_url":"https://github.com/jhoblitt","followers_url":"https://api.github.com/users/jhoblitt/followers","following_url":"https://api.github.com/users/jhoblitt/following{/other_user}","gists_url":"https://api.github.com/users/jhoblitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jhoblitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhoblitt/subscriptions","organizations_url":"https://api.github.com/users/jhoblitt/orgs","repos_url":"https://api.github.com/users/jhoblitt/repos","events_url":"https://api.github.com/users/jhoblitt/events{/privacy}","received_events_url":"https://api.github.com/users/jhoblitt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhoblitt/buildbot-scripts","description":"","fork":true,"url":"https://api.github.com/repos/jhoblitt/buildbot-scripts","forks_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/forks","keys_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/teams","hooks_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/hooks","issue_events_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/events","assignees_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/tags","blobs_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/languages","stargazers_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/stargazers","contributors_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/contributors","subscribers_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/subscribers","subscription_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/subscription","commits_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/merges","archive_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/downloads","issues_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/labels{/name}","releases_url":"https://api.github.com/repos/jhoblitt/buildbot-scripts/releases{/id}","created_at":"2015-03-19T18:55:35Z","updated_at":"2015-04-01T22:20:10Z","pushed_at":"2015-06-26T17:12:35Z","git_url":"git://github.com/jhoblitt/buildbot-scripts.git","ssh_url":"git@github.com:jhoblitt/buildbot-scripts.git","clone_url":"https://github.com/jhoblitt/buildbot-scripts.git","svn_url":"https://github.com/jhoblitt/buildbot-scripts","homepage":null,"size":203,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"lsst-sqre:master","ref":"master","sha":"fdd87f0191b0f23a708e5a645559282bd06c1a45","user":{"login":"lsst-sqre","id":10158560,"avatar_url":"https://avatars.githubusercontent.com/u/10158560?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst-sqre","html_url":"https://github.com/lsst-sqre","followers_url":"https://api.github.com/users/lsst-sqre/followers","following_url":"https://api.github.com/users/lsst-sqre/following{/other_user}","gists_url":"https://api.github.com/users/lsst-sqre/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-sqre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-sqre/subscriptions","organizations_url":"https://api.github.com/users/lsst-sqre/orgs","repos_url":"https://api.github.com/users/lsst-sqre/repos","events_url":"https://api.github.com/users/lsst-sqre/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-sqre/received_events","type":"Organization","site_admin":false},"repo":{"id":32540347,"name":"buildbot-scripts","full_name":"lsst-sqre/buildbot-scripts","owner":{"login":"lsst-sqre","id":10158560,"avatar_url":"https://avatars.githubusercontent.com/u/10158560?v=3","gravatar_id":"","url":"https://api.github.com/users/lsst-sqre","html_url":"https://github.com/lsst-sqre","followers_url":"https://api.github.com/users/lsst-sqre/followers","following_url":"https://api.github.com/users/lsst-sqre/following{/other_user}","gists_url":"https://api.github.com/users/lsst-sqre/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst-sqre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst-sqre/subscriptions","organizations_url":"https://api.github.com/users/lsst-sqre/orgs","repos_url":"https://api.github.com/users/lsst-sqre/repos","events_url":"https://api.github.com/users/lsst-sqre/events{/privacy}","received_events_url":"https://api.github.com/users/lsst-sqre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst-sqre/buildbot-scripts","description":"","fork":false,"url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts","forks_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/forks","keys_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/teams","hooks_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/hooks","issue_events_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/events","assignees_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/tags","blobs_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/languages","stargazers_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/stargazers","contributors_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/contributors","subscribers_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/subscribers","subscription_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/subscription","commits_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/merges","archive_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/downloads","issues_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/labels{/name}","releases_url":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/releases{/id}","created_at":"2015-03-19T18:53:29Z","updated_at":"2015-04-02T00:32:52Z","pushed_at":"2015-06-26T17:12:36Z","git_url":"git://github.com/lsst-sqre/buildbot-scripts.git","ssh_url":"git@github.com:lsst-sqre/buildbot-scripts.git","clone_url":"https://github.com/lsst-sqre/buildbot-scripts.git","svn_url":"https://github.com/lsst-sqre/buildbot-scripts","homepage":null,"size":193,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6"},"html":{"href":"https://github.com/lsst-sqre/buildbot-scripts/pull/6"},"issue":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/6"},"comments":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/lsst-sqre/buildbot-scripts/statuses/8770ce0150afb5f95278c10cfce36380219ead8a"}}}}