{"action":"created","comment":{"url":"https://api.github.com/repos/hapijs/lab/pulls/comments/53989844","id":53989844,"diff_hunk":"@@ -0,0 +1,41 @@\n+'use strict';\n+\n+const ChildProcess = require('child_process');\n+const Path = require('path');\n+\n+const labPath = Path.join(__dirname, '..', 'bin', '_lab');\n+\n+module.exports = (args, callback) => {\n+\n+    return new Promise((resolve, reject) => {\n+\n+        const cli = ChildProcess.spawn('node', [labPath, ...args]);\n+        let output = '';","path":"test/run_cli.js","position":13,"original_position":13,"commit_id":"60373a281d996d405c700b037b05e46719f372e7","original_commit_id":"60373a281d996d405c700b037b05e46719f372e7","user":{"login":"Marsup","id":796194,"avatar_url":"https://avatars.githubusercontent.com/u/796194?v=3","gravatar_id":"","url":"https://api.github.com/users/Marsup","html_url":"https://github.com/Marsup","followers_url":"https://api.github.com/users/Marsup/followers","following_url":"https://api.github.com/users/Marsup/following{/other_user}","gists_url":"https://api.github.com/users/Marsup/gists{/gist_id}","starred_url":"https://api.github.com/users/Marsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marsup/subscriptions","organizations_url":"https://api.github.com/users/Marsup/orgs","repos_url":"https://api.github.com/users/Marsup/repos","events_url":"https://api.github.com/users/Marsup/events{/privacy}","received_events_url":"https://api.github.com/users/Marsup/received_events","type":"User","site_admin":false},"body":"FWIW it's faster to push in arrays and join at the end, not sure it'll dramatically change test suite time though ;)","created_at":"2016-02-24T19:11:39Z","updated_at":"2016-02-24T19:11:39Z","html_url":"https://github.com/hapijs/lab/pull/527#discussion_r53989844","pull_request_url":"https://api.github.com/repos/hapijs/lab/pulls/527","_links":{"self":{"href":"https://api.github.com/repos/hapijs/lab/pulls/comments/53989844"},"html":{"href":"https://github.com/hapijs/lab/pull/527#discussion_r53989844"},"pull_request":{"href":"https://api.github.com/repos/hapijs/lab/pulls/527"}}},"pull_request":{"url":"https://api.github.com/repos/hapijs/lab/pulls/527","id":60525072,"html_url":"https://github.com/hapijs/lab/pull/527","diff_url":"https://github.com/hapijs/lab/pull/527.diff","patch_url":"https://github.com/hapijs/lab/pull/527.patch","issue_url":"https://api.github.com/repos/hapijs/lab/issues/527","number":527,"state":"open","locked":false,"title":"Global \"only\" (#524)","user":{"login":"rluba","id":4600573,"avatar_url":"https://avatars.githubusercontent.com/u/4600573?v=3","gravatar_id":"","url":"https://api.github.com/users/rluba","html_url":"https://github.com/rluba","followers_url":"https://api.github.com/users/rluba/followers","following_url":"https://api.github.com/users/rluba/following{/other_user}","gists_url":"https://api.github.com/users/rluba/gists{/gist_id}","starred_url":"https://api.github.com/users/rluba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rluba/subscriptions","organizations_url":"https://api.github.com/users/rluba/orgs","repos_url":"https://api.github.com/users/rluba/repos","events_url":"https://api.github.com/users/rluba/events{/privacy}","received_events_url":"https://api.github.com/users/rluba/received_events","type":"User","site_admin":false},"body":"I’ve implemented the global `only` flag as discussed in #524. Some of the test input files were copied & adapted from @Marsup’s original PR #116.\r\n\r\nThere are several topics that I’d like to hear everyone’s opinion on:\r\n\r\n1. Currently, the runner simply ignores everything but the first `only` it encounters. I’d like to report an error instead but I don’t know how. There’s no mechanism for the runner to report general errors (only test errors). Every callback error is simply ignored (see [here](https://github.com/hapijs/lab/blob/fbd459675a857bf3ff9328969fda4fbc2fd7427a/lib/runner.js#L66) or [here](https://github.com/hapijs/lab/blob/fbd459675a857bf3ff9328969fda4fbc2fd7427a/lib/runner.js#L89)) and not forwarded to the reporters, so they can’t handle it. That’s why two [new](https://github.com/hapijs/lab/compare/master...rluba:feature/global_only#diff-583d616f4b01bf1fa153e71c0cef7de7R409) [tests](https://github.com/hapijs/lab/compare/master...rluba:feature/global_only#diff-583d616f4b01bf1fa153e71c0cef7de7R419) still fail.\r\n2. The `ids` / `glob` feature currently uses [its own mechanism](https://github.com/hapijs/lab/blob/fbd459675a857bf3ff9328969fda4fbc2fd7427a/lib/runner.js#L299-L303) for ignoring tests. I’d like to merge this with the `skip` behavior so that tests ignored by the `ids` / `glob` parameters are also simply marked as \"skipped\" instead of not being part of the reports at all.\r\n3. The console reporter now [prints the number of skipped tests](https://github.com/hapijs/lab/compare/master...rluba:feature/global_only#diff-425698733ef32d1551f3dbc61a9375dcR230). Shall we add this to other reporters as well?\r\n4. I removed some 500 lines of boilerplate code from the cli tests by extracting a single function. I’ve also improved some of the assertions to be more precise. Any objections?\r\n5. The before and after blocks are now consistently skipped for skipped tests. Previously, they were still executed for tests that were skipped individually (eg. using `test.skip(…)`).","created_at":"2016-02-24T15:23:03Z","updated_at":"2016-02-24T19:11:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc964ec23f50f16f13ec4786f0210e21186e0326","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hapijs/lab/pulls/527/commits","review_comments_url":"https://api.github.com/repos/hapijs/lab/pulls/527/comments","review_comment_url":"https://api.github.com/repos/hapijs/lab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hapijs/lab/issues/527/comments","statuses_url":"https://api.github.com/repos/hapijs/lab/statuses/60373a281d996d405c700b037b05e46719f372e7","head":{"label":"rluba:feature/global_only","ref":"feature/global_only","sha":"60373a281d996d405c700b037b05e46719f372e7","user":{"login":"rluba","id":4600573,"avatar_url":"https://avatars.githubusercontent.com/u/4600573?v=3","gravatar_id":"","url":"https://api.github.com/users/rluba","html_url":"https://github.com/rluba","followers_url":"https://api.github.com/users/rluba/followers","following_url":"https://api.github.com/users/rluba/following{/other_user}","gists_url":"https://api.github.com/users/rluba/gists{/gist_id}","starred_url":"https://api.github.com/users/rluba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rluba/subscriptions","organizations_url":"https://api.github.com/users/rluba/orgs","repos_url":"https://api.github.com/users/rluba/repos","events_url":"https://api.github.com/users/rluba/events{/privacy}","received_events_url":"https://api.github.com/users/rluba/received_events","type":"User","site_admin":false},"repo":{"id":51952724,"name":"lab","full_name":"rluba/lab","owner":{"login":"rluba","id":4600573,"avatar_url":"https://avatars.githubusercontent.com/u/4600573?v=3","gravatar_id":"","url":"https://api.github.com/users/rluba","html_url":"https://github.com/rluba","followers_url":"https://api.github.com/users/rluba/followers","following_url":"https://api.github.com/users/rluba/following{/other_user}","gists_url":"https://api.github.com/users/rluba/gists{/gist_id}","starred_url":"https://api.github.com/users/rluba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rluba/subscriptions","organizations_url":"https://api.github.com/users/rluba/orgs","repos_url":"https://api.github.com/users/rluba/repos","events_url":"https://api.github.com/users/rluba/events{/privacy}","received_events_url":"https://api.github.com/users/rluba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rluba/lab","description":"Test utility","fork":true,"url":"https://api.github.com/repos/rluba/lab","forks_url":"https://api.github.com/repos/rluba/lab/forks","keys_url":"https://api.github.com/repos/rluba/lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rluba/lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rluba/lab/teams","hooks_url":"https://api.github.com/repos/rluba/lab/hooks","issue_events_url":"https://api.github.com/repos/rluba/lab/issues/events{/number}","events_url":"https://api.github.com/repos/rluba/lab/events","assignees_url":"https://api.github.com/repos/rluba/lab/assignees{/user}","branches_url":"https://api.github.com/repos/rluba/lab/branches{/branch}","tags_url":"https://api.github.com/repos/rluba/lab/tags","blobs_url":"https://api.github.com/repos/rluba/lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rluba/lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rluba/lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/rluba/lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rluba/lab/statuses/{sha}","languages_url":"https://api.github.com/repos/rluba/lab/languages","stargazers_url":"https://api.github.com/repos/rluba/lab/stargazers","contributors_url":"https://api.github.com/repos/rluba/lab/contributors","subscribers_url":"https://api.github.com/repos/rluba/lab/subscribers","subscription_url":"https://api.github.com/repos/rluba/lab/subscription","commits_url":"https://api.github.com/repos/rluba/lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/rluba/lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/rluba/lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/rluba/lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/rluba/lab/contents/{+path}","compare_url":"https://api.github.com/repos/rluba/lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rluba/lab/merges","archive_url":"https://api.github.com/repos/rluba/lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rluba/lab/downloads","issues_url":"https://api.github.com/repos/rluba/lab/issues{/number}","pulls_url":"https://api.github.com/repos/rluba/lab/pulls{/number}","milestones_url":"https://api.github.com/repos/rluba/lab/milestones{/number}","notifications_url":"https://api.github.com/repos/rluba/lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rluba/lab/labels{/name}","releases_url":"https://api.github.com/repos/rluba/lab/releases{/id}","deployments_url":"https://api.github.com/repos/rluba/lab/deployments","created_at":"2016-02-17T20:23:49Z","updated_at":"2016-02-17T20:23:50Z","pushed_at":"2016-02-24T13:01:16Z","git_url":"git://github.com/rluba/lab.git","ssh_url":"git@github.com:rluba/lab.git","clone_url":"https://github.com/rluba/lab.git","svn_url":"https://github.com/rluba/lab","homepage":null,"size":969,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"hapijs:master","ref":"master","sha":"fbd459675a857bf3ff9328969fda4fbc2fd7427a","user":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"repo":{"id":8634788,"name":"lab","full_name":"hapijs/lab","owner":{"login":"hapijs","id":3774533,"avatar_url":"https://avatars.githubusercontent.com/u/3774533?v=3","gravatar_id":"","url":"https://api.github.com/users/hapijs","html_url":"https://github.com/hapijs","followers_url":"https://api.github.com/users/hapijs/followers","following_url":"https://api.github.com/users/hapijs/following{/other_user}","gists_url":"https://api.github.com/users/hapijs/gists{/gist_id}","starred_url":"https://api.github.com/users/hapijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hapijs/subscriptions","organizations_url":"https://api.github.com/users/hapijs/orgs","repos_url":"https://api.github.com/users/hapijs/repos","events_url":"https://api.github.com/users/hapijs/events{/privacy}","received_events_url":"https://api.github.com/users/hapijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hapijs/lab","description":"Test utility","fork":false,"url":"https://api.github.com/repos/hapijs/lab","forks_url":"https://api.github.com/repos/hapijs/lab/forks","keys_url":"https://api.github.com/repos/hapijs/lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hapijs/lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hapijs/lab/teams","hooks_url":"https://api.github.com/repos/hapijs/lab/hooks","issue_events_url":"https://api.github.com/repos/hapijs/lab/issues/events{/number}","events_url":"https://api.github.com/repos/hapijs/lab/events","assignees_url":"https://api.github.com/repos/hapijs/lab/assignees{/user}","branches_url":"https://api.github.com/repos/hapijs/lab/branches{/branch}","tags_url":"https://api.github.com/repos/hapijs/lab/tags","blobs_url":"https://api.github.com/repos/hapijs/lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hapijs/lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hapijs/lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/hapijs/lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hapijs/lab/statuses/{sha}","languages_url":"https://api.github.com/repos/hapijs/lab/languages","stargazers_url":"https://api.github.com/repos/hapijs/lab/stargazers","contributors_url":"https://api.github.com/repos/hapijs/lab/contributors","subscribers_url":"https://api.github.com/repos/hapijs/lab/subscribers","subscription_url":"https://api.github.com/repos/hapijs/lab/subscription","commits_url":"https://api.github.com/repos/hapijs/lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/hapijs/lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/hapijs/lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/hapijs/lab/issues/comments{/number}","contents_url":"https://api.github.com/repos/hapijs/lab/contents/{+path}","compare_url":"https://api.github.com/repos/hapijs/lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hapijs/lab/merges","archive_url":"https://api.github.com/repos/hapijs/lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hapijs/lab/downloads","issues_url":"https://api.github.com/repos/hapijs/lab/issues{/number}","pulls_url":"https://api.github.com/repos/hapijs/lab/pulls{/number}","milestones_url":"https://api.github.com/repos/hapijs/lab/milestones{/number}","notifications_url":"https://api.github.com/repos/hapijs/lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hapijs/lab/labels{/name}","releases_url":"https://api.github.com/repos/hapijs/lab/releases{/id}","deployments_url":"https://api.github.com/repos/hapijs/lab/deployments","created_at":"2013-03-07T19:26:13Z","updated_at":"2016-02-24T18:03:59Z","pushed_at":"2016-02-24T18:09:56Z","git_url":"git://github.com/hapijs/lab.git","ssh_url":"git@github.com:hapijs/lab.git","clone_url":"https://github.com/hapijs/lab.git","svn_url":"https://github.com/hapijs/lab","homepage":null,"size":1062,"stargazers_count":339,"watchers_count":339,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":36,"forks":99,"open_issues":36,"watchers":339,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hapijs/lab/pulls/527"},"html":{"href":"https://github.com/hapijs/lab/pull/527"},"issue":{"href":"https://api.github.com/repos/hapijs/lab/issues/527"},"comments":{"href":"https://api.github.com/repos/hapijs/lab/issues/527/comments"},"review_comments":{"href":"https://api.github.com/repos/hapijs/lab/pulls/527/comments"},"review_comment":{"href":"https://api.github.com/repos/hapijs/lab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hapijs/lab/pulls/527/commits"},"statuses":{"href":"https://api.github.com/repos/hapijs/lab/statuses/60373a281d996d405c700b037b05e46719f372e7"}}}}