{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/dmd/pulls/comments/175619772","pull_request_review_id":105176585,"id":175619772,"diff_hunk":"@@ -30,14 +30,36 @@ output_file=${RESULTS_DIR}/${script_name}.out\n echo \" ... ${script_name}\"\n rm -f ${output_file}\n \n-./${script_name} > ${output_file}  2>&1\n-if [ $? -ne 0 ]; then\n-    # duplicate d_do_test output\n-    echo >> ${output_file}\n-    echo ============================== >> ${output_file}\n-    echo Test ${script_name} failed >> ${output_file}\n-\n-    echo Test ${script_name} failed. The logged output:\n-    cat ${output_file}\n-    exit 1\n-fi\n+function finish {\n+    # reset output stream\n+    set +x\n+    exec 1>&40\n+    exec 2>&41\n+\n+    if [ $1 -ne 0 ]; then\n+        echo ==============================\n+        echo Test ${script_name} failed. The logged output:\n+        cat ${output_file}\n+\n+        echo ==============================\n+        echo Test ${script_name} failed. The xtrace output:\n+        cat ${output_file}.log\n+\n+        rm -rf ${output_file}\n+        exit $?\n+    fi\n+}\n+trap 'finish $?' INT TERM EXIT\n+\n+# redirect stdout + stderr to the output file + keep a reference to the std{out,err} streams for later\n+exec 40>&1\n+exec 41>&2","path":"test/sh_do_test.sh","position":38,"original_position":38,"commit_id":"d9a7f8ebc51244f8a33b743920ff219c8a3f29bf","original_commit_id":"d9a7f8ebc51244f8a33b743920ff219c8a3f29bf","user":{"login":"CyberShadow","id":160894,"avatar_url":"https://avatars0.githubusercontent.com/u/160894?v=4","gravatar_id":"","url":"https://api.github.com/users/CyberShadow","html_url":"https://github.com/CyberShadow","followers_url":"https://api.github.com/users/CyberShadow/followers","following_url":"https://api.github.com/users/CyberShadow/following{/other_user}","gists_url":"https://api.github.com/users/CyberShadow/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberShadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberShadow/subscriptions","organizations_url":"https://api.github.com/users/CyberShadow/orgs","repos_url":"https://api.github.com/users/CyberShadow/repos","events_url":"https://api.github.com/users/CyberShadow/events{/privacy}","received_events_url":"https://api.github.com/users/CyberShadow/received_events","type":"User","site_admin":false},"body":"bash has a syntax to assign a free file descriptor and store it in a variable (`exec {name_of_fd_var}>&1`), which should guarantee that there will not be collisions, but the feature is \"relatively\" new and not sure if it's available on all test systems.","created_at":"2018-03-19T23:46:33Z","updated_at":"2018-03-19T23:51:10Z","html_url":"https://github.com/dlang/dmd/pull/8025#discussion_r175619772","pull_request_url":"https://api.github.com/repos/dlang/dmd/pulls/8025","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments/175619772"},"html":{"href":"https://github.com/dlang/dmd/pull/8025#discussion_r175619772"},"pull_request":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8025"}}},"pull_request":{"url":"https://api.github.com/repos/dlang/dmd/pulls/8025","id":174691724,"html_url":"https://github.com/dlang/dmd/pull/8025","diff_url":"https://github.com/dlang/dmd/pull/8025.diff","patch_url":"https://github.com/dlang/dmd/pull/8025.patch","issue_url":"https://api.github.com/repos/dlang/dmd/issues/8025","number":8025,"state":"open","locked":false,"title":"sh_do_test: verbose trace + start to remove inferred output_file","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"Now that a dedicated Bash wrapper exists, a lot of boilerplate code can be removed from the bash scripts.\n\nThis is a start which saves an verbose trace of the bash log in `.log` and all stdout and stddev in `output_file`. A trap will print both output when an error occurs.\n\nThere's a lot more that can be done, see https://github.com/dlang/dmd/pull/7928 for ideas.\n\nCC @marler8997 @CyberShadow","created_at":"2018-03-13T15:12:45Z","updated_at":"2018-03-19T23:51:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da586e33b2a590816ad7e0244a1fcf1848086bc2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":829277930,"url":"https://api.github.com/repos/dlang/dmd/labels/72h%20no%20objection%20-%3E%20merge","name":"72h no objection -> merge","color":"ea54b3","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/dmd/pulls/8025/commits","review_comments_url":"https://api.github.com/repos/dlang/dmd/pulls/8025/comments","review_comment_url":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/dmd/issues/8025/comments","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/d9a7f8ebc51244f8a33b743920ff219c8a3f29bf","head":{"label":"wilzbach:bash-output_file","ref":"bash-output_file","sha":"d9a7f8ebc51244f8a33b743920ff219c8a3f29bf","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"repo":{"id":55034525,"name":"dmd","full_name":"wilzbach/dmd","owner":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilzbach/dmd","description":"dmd D Programming Language compiler","fork":true,"url":"https://api.github.com/repos/wilzbach/dmd","forks_url":"https://api.github.com/repos/wilzbach/dmd/forks","keys_url":"https://api.github.com/repos/wilzbach/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilzbach/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilzbach/dmd/teams","hooks_url":"https://api.github.com/repos/wilzbach/dmd/hooks","issue_events_url":"https://api.github.com/repos/wilzbach/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/wilzbach/dmd/events","assignees_url":"https://api.github.com/repos/wilzbach/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/wilzbach/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/wilzbach/dmd/tags","blobs_url":"https://api.github.com/repos/wilzbach/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilzbach/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilzbach/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilzbach/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilzbach/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/wilzbach/dmd/languages","stargazers_url":"https://api.github.com/repos/wilzbach/dmd/stargazers","contributors_url":"https://api.github.com/repos/wilzbach/dmd/contributors","subscribers_url":"https://api.github.com/repos/wilzbach/dmd/subscribers","subscription_url":"https://api.github.com/repos/wilzbach/dmd/subscription","commits_url":"https://api.github.com/repos/wilzbach/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilzbach/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilzbach/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilzbach/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilzbach/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/wilzbach/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilzbach/dmd/merges","archive_url":"https://api.github.com/repos/wilzbach/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilzbach/dmd/downloads","issues_url":"https://api.github.com/repos/wilzbach/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/wilzbach/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/wilzbach/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/wilzbach/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilzbach/dmd/labels{/name}","releases_url":"https://api.github.com/repos/wilzbach/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/wilzbach/dmd/deployments","created_at":"2016-03-30T05:15:54Z","updated_at":"2018-03-19T19:23:45Z","pushed_at":"2018-03-19T23:33:35Z","git_url":"git://github.com/wilzbach/dmd.git","ssh_url":"git@github.com:wilzbach/dmd.git","clone_url":"https://github.com/wilzbach/dmd.git","svn_url":"https://github.com/wilzbach/dmd","homepage":"dlang.org","size":86246,"stargazers_count":1,"watchers_count":1,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"dlang:master","ref":"master","sha":"eee17da2ffd89093a2de2f7310ca01520cd49a64","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257070,"name":"dmd","full_name":"dlang/dmd","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/dmd","description":"dmd D Programming Language compiler","fork":false,"url":"https://api.github.com/repos/dlang/dmd","forks_url":"https://api.github.com/repos/dlang/dmd/forks","keys_url":"https://api.github.com/repos/dlang/dmd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/dmd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/dmd/teams","hooks_url":"https://api.github.com/repos/dlang/dmd/hooks","issue_events_url":"https://api.github.com/repos/dlang/dmd/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/dmd/events","assignees_url":"https://api.github.com/repos/dlang/dmd/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/dmd/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/dmd/tags","blobs_url":"https://api.github.com/repos/dlang/dmd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/dmd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/dmd/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/dmd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/dmd/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/dmd/languages","stargazers_url":"https://api.github.com/repos/dlang/dmd/stargazers","contributors_url":"https://api.github.com/repos/dlang/dmd/contributors","subscribers_url":"https://api.github.com/repos/dlang/dmd/subscribers","subscription_url":"https://api.github.com/repos/dlang/dmd/subscription","commits_url":"https://api.github.com/repos/dlang/dmd/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/dmd/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/dmd/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/dmd/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/dmd/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/dmd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/dmd/merges","archive_url":"https://api.github.com/repos/dlang/dmd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/dmd/downloads","issues_url":"https://api.github.com/repos/dlang/dmd/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/dmd/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/dmd/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/dmd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/dmd/labels{/name}","releases_url":"https://api.github.com/repos/dlang/dmd/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/dmd/deployments","created_at":"2011-01-15T06:53:53Z","updated_at":"2018-03-19T19:44:51Z","pushed_at":"2018-03-19T23:33:37Z","git_url":"git://github.com/dlang/dmd.git","ssh_url":"git@github.com:dlang/dmd.git","clone_url":"https://github.com/dlang/dmd.git","svn_url":"https://github.com/dlang/dmd","homepage":"dlang.org","size":87230,"stargazers_count":1761,"watchers_count":1761,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":443,"mirror_url":null,"archived":false,"open_issues_count":150,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":443,"open_issues":150,"watchers":1761,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8025"},"html":{"href":"https://github.com/dlang/dmd/pull/8025"},"issue":{"href":"https://api.github.com/repos/dlang/dmd/issues/8025"},"comments":{"href":"https://api.github.com/repos/dlang/dmd/issues/8025/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8025/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/dmd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/dmd/pulls/8025/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/dmd/statuses/d9a7f8ebc51244f8a33b743920ff219c8a3f29bf"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"CyberShadow"}}