{"action":"created","comment":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/175956061","pull_request_review_id":105575271,"id":175956061,"diff_hunk":"@@ -256,6 +256,92 @@ std::vector<module_context::SourceMarker> parseGccErrors(\n    return errors;\n }\n \n+std::vector<module_context::SourceMarker> parseTestThatErrors(\n+                                           const FilePath& basePath,\n+                                           const std::string& output)\n+{\n+   using namespace module_context;\n+   std::vector<SourceMarker> errors;\n+\n+   try\n+   {\n+      FilePath basePathResolved = module_context::resolveAliasedPath(basePath.absolutePath());\n+\n+      boost::regex re(\"\\\\[1m([^:\\\\n]+):([0-9]+):[^:\\\\n]+: ([^\\\\n]*)\\\\[22m\");\n+\n+      boost::sregex_iterator iter(output.begin(), output.end(), re);\n+      boost::sregex_iterator end;\n+      for (; iter != end; iter++)\n+      {\n+         boost::smatch match = *iter;\n+         BOOST_ASSERT(match.size() == 4);\n+\n+         std::string file, line, type, message;\n+         \n+         file = match[1];\n+         line = match[2];\n+         type = \"failure\";\n+         message = match[3];\n+         FilePath testFilePath = basePathResolved.complete(file);\n+\n+         std::string column = \"0\";\n+         SourceMarker err(module_context::sourceMarkerTypeFromString(type),\n+                          testFilePath,\n+                          core::safe_convert::stringTo<int>(line, 1),\n+                          core::safe_convert::stringTo<int>(column, 1),\n+                          core::html_utils::HTML(message),\n+                          true);\n+         errors.push_back(err);\n+      }\n+   }\n+   CATCH_UNEXPECTED_EXCEPTION;\n+\n+   return errors;\n+}\n+\n+std::vector<module_context::SourceMarker> parseShinyTestErrors(\n+                                           const FilePath& basePath,\n+                                           const std::string& output)\n+{\n+   using namespace module_context;\n+   std::vector<SourceMarker> errors;\n+\n+   try\n+   {\n+      FilePath basePathResolved = module_context::resolveAliasedPath(basePath.absolutePath());\n+\n+      boost::regex re(\"Differences detected between ([^\\\\n]+)-current[/\\\\\\\\ ][^:]+\");","path":"src/cpp/session/modules/build/SessionBuildErrors.cpp","position":58,"original_position":58,"commit_id":"cb6c6d13bbfad6c0b40b93015819b8646520b939","original_commit_id":"5540b84f9820205798d1ef49bc19fb7b699a23d1","user":{"login":"javierluraschi","id":3478847,"avatar_url":"https://avatars1.githubusercontent.com/u/3478847?v=4","gravatar_id":"","url":"https://api.github.com/users/javierluraschi","html_url":"https://github.com/javierluraschi","followers_url":"https://api.github.com/users/javierluraschi/followers","following_url":"https://api.github.com/users/javierluraschi/following{/other_user}","gists_url":"https://api.github.com/users/javierluraschi/gists{/gist_id}","starred_url":"https://api.github.com/users/javierluraschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javierluraschi/subscriptions","organizations_url":"https://api.github.com/users/javierluraschi/orgs","repos_url":"https://api.github.com/users/javierluraschi/repos","events_url":"https://api.github.com/users/javierluraschi/events{/privacy}","received_events_url":"https://api.github.com/users/javierluraschi/received_events","type":"User","site_admin":false},"body":"We can save the results as an `RDS` and then use that instead of parsing output, updated.","created_at":"2018-03-20T23:44:29Z","updated_at":"2018-03-20T23:44:29Z","html_url":"https://github.com/rstudio/rstudio/pull/2452#discussion_r175956061","pull_request_url":"https://api.github.com/repos/rstudio/rstudio/pulls/2452","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments/175956061"},"html":{"href":"https://github.com/rstudio/rstudio/pull/2452#discussion_r175956061"},"pull_request":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/2452"}},"in_reply_to_id":175880417},"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/2452","id":176052935,"html_url":"https://github.com/rstudio/rstudio/pull/2452","diff_url":"https://github.com/rstudio/rstudio/pull/2452.diff","patch_url":"https://github.com/rstudio/rstudio/pull/2452.patch","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/2452","number":2452,"state":"open","locked":false,"title":"Improvements for testthat and shinytest","user":{"login":"javierluraschi","id":3478847,"avatar_url":"https://avatars1.githubusercontent.com/u/3478847?v=4","gravatar_id":"","url":"https://api.github.com/users/javierluraschi","html_url":"https://github.com/javierluraschi","followers_url":"https://api.github.com/users/javierluraschi/followers","following_url":"https://api.github.com/users/javierluraschi/following{/other_user}","gists_url":"https://api.github.com/users/javierluraschi/gists{/gist_id}","starred_url":"https://api.github.com/users/javierluraschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javierluraschi/subscriptions","organizations_url":"https://api.github.com/users/javierluraschi/orgs","repos_url":"https://api.github.com/users/javierluraschi/repos","events_url":"https://api.github.com/users/javierluraschi/events{/privacy}","received_events_url":"https://api.github.com/users/javierluraschi/received_events","type":"User","site_admin":false},"body":"This PR improves integration with `testthat` and `shinytest`.\r\n\r\n# testthat\r\n\r\nTriggering **Test Package** now parses `testthat` output into the build pane:\r\n\r\n<img width=\"423\" alt=\"screen shot 2018-03-19 at 4 20 35 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627427-90844b44-2b91-11e8-8dd8-8e9cc481849e.png\">\r\n\r\nDouble-clicking an error opens the given file and also gainst a **Run Test** toolbar button to easily rerun tests:\r\n\r\n<img width=\"200\" alt=\"screen shot 2018-03-19 at 4 21 42 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627457-b694f1bc-2b91-11e8-85f2-17e5eb25100a.png\">\r\n\r\n# shinytest\r\n\r\nShiny apps gain a new menu to **Record Test** or **Run Tests*:\r\n\r\n<img width=\"268\" alt=\"screen shot 2018-03-16 at 12 18 27 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627470-cbf88398-2b91-11e8-9f7a-ad0cc40850ea.png\">\r\n\r\n**Note:** The icons are placeholders and will probably get updated once available.\r\n\r\nRecording or running a test will trigger package dependencies against `shinytest`, additionally, it runs `shinytest::dependenciesInstalled()`, if this fails we prompt:\r\n\r\n<img width=\"416\" alt=\"screen shot 2018-03-19 at 4 25 08 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627537-1ea096b2-2b92-11e8-91a1-bd30d7ff5538.png\">\r\n\r\nWhen use accepts prompt, a console triggers `shinytest::installDependencies()`:\r\n\r\n<img width=\"633\" alt=\"screen shot 2018-03-19 at 2 25 53 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627361-40848a46-2b91-11e8-862f-87eb0e41c3cd.png\">\r\n\r\nAlso, shiny docs also gain the record and run test menu entries:\r\n\r\n<img width=\"339\" alt=\"screen shot 2018-03-19 at 4 26 31 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627591-5a120bae-2b92-11e8-92b6-07a16ef03a1a.png\">\r\n\r\nFor tests running outside a package, a **tests** tab was added since the build tab is not available:\r\n\r\n<img width=\"1010\" alt=\"screen shot 2018-03-20 at 1 34 00 pm\" src=\"https://user-images.githubusercontent.com/3478847/37683173-eb98ae96-2c48-11e8-8245-96bfb54760ec.png\">\r\n\r\n<img width=\"1010\" alt=\"screen shot 2018-03-20 at 1 33 55 pm\" src=\"https://user-images.githubusercontent.com/3478847/37683188-fb090a1a-2c48-11e8-96ba-b0f0a39c2c15.png\">\r\n\r\nEach shiny test file gains two commands for **Comparing Results** and to **Run Test** again:\r\n\r\n<img width=\"266\" alt=\"screen shot 2018-03-19 at 4 29 35 pm\" src=\"https://user-images.githubusercontent.com/3478847/37627687-d1991f78-2b92-11e8-8c70-eb121ed3370e.png\">\r\n\r\nFor the record and compare windows, the toolbar has been stripped and a [PR](https://github.com/rstudio/shinytest/pull/180) to `shinytest` sent to make this windows nicely integrated:\r\n\r\n<img width=\"1002\" alt=\"37550747-d99a6474-294f-11e8-8285-f2b04e5d645e\" src=\"https://user-images.githubusercontent.com/3478847/37627699-df67f6e2-2b92-11e8-9572-28a1c16a85d9.png\">\r\n","created_at":"2018-03-19T23:32:09Z","updated_at":"2018-03-20T23:44:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30448ea4b71d706267807882f9ce429751c23d8a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rstudio/rstudio/pulls/2452/commits","review_comments_url":"https://api.github.com/repos/rstudio/rstudio/pulls/2452/comments","review_comment_url":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/2452/comments","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/cb6c6d13bbfad6c0b40b93015819b8646520b939","head":{"label":"rstudio:feature/test-improvements","ref":"feature/test-improvements","sha":"cb6c6d13bbfad6c0b40b93015819b8646520b939","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars1.githubusercontent.com/u/513560?v=4","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars1.githubusercontent.com/u/513560?v=4","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2018-03-20T23:43:48Z","pushed_at":"2018-03-20T23:43:46Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"https://www.rstudio.com/products/rstudio/","size":94828,"stargazers_count":2156,"watchers_count":2156,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":558,"mirror_url":null,"archived":false,"open_issues_count":461,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":558,"open_issues":461,"watchers":2156,"default_branch":"master"}},"base":{"label":"rstudio:master","ref":"master","sha":"d9e60252c337382382c055a709a044c3f3bd68f7","user":{"login":"rstudio","id":513560,"avatar_url":"https://avatars1.githubusercontent.com/u/513560?v=4","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"repo":{"id":1147463,"name":"rstudio","full_name":"rstudio/rstudio","owner":{"login":"rstudio","id":513560,"avatar_url":"https://avatars1.githubusercontent.com/u/513560?v=4","gravatar_id":"","url":"https://api.github.com/users/rstudio","html_url":"https://github.com/rstudio","followers_url":"https://api.github.com/users/rstudio/followers","following_url":"https://api.github.com/users/rstudio/following{/other_user}","gists_url":"https://api.github.com/users/rstudio/gists{/gist_id}","starred_url":"https://api.github.com/users/rstudio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rstudio/subscriptions","organizations_url":"https://api.github.com/users/rstudio/orgs","repos_url":"https://api.github.com/users/rstudio/repos","events_url":"https://api.github.com/users/rstudio/events{/privacy}","received_events_url":"https://api.github.com/users/rstudio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rstudio/rstudio","description":"RStudio is an integrated development environment (IDE) for R","fork":false,"url":"https://api.github.com/repos/rstudio/rstudio","forks_url":"https://api.github.com/repos/rstudio/rstudio/forks","keys_url":"https://api.github.com/repos/rstudio/rstudio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rstudio/rstudio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rstudio/rstudio/teams","hooks_url":"https://api.github.com/repos/rstudio/rstudio/hooks","issue_events_url":"https://api.github.com/repos/rstudio/rstudio/issues/events{/number}","events_url":"https://api.github.com/repos/rstudio/rstudio/events","assignees_url":"https://api.github.com/repos/rstudio/rstudio/assignees{/user}","branches_url":"https://api.github.com/repos/rstudio/rstudio/branches{/branch}","tags_url":"https://api.github.com/repos/rstudio/rstudio/tags","blobs_url":"https://api.github.com/repos/rstudio/rstudio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rstudio/rstudio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rstudio/rstudio/git/refs{/sha}","trees_url":"https://api.github.com/repos/rstudio/rstudio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rstudio/rstudio/statuses/{sha}","languages_url":"https://api.github.com/repos/rstudio/rstudio/languages","stargazers_url":"https://api.github.com/repos/rstudio/rstudio/stargazers","contributors_url":"https://api.github.com/repos/rstudio/rstudio/contributors","subscribers_url":"https://api.github.com/repos/rstudio/rstudio/subscribers","subscription_url":"https://api.github.com/repos/rstudio/rstudio/subscription","commits_url":"https://api.github.com/repos/rstudio/rstudio/commits{/sha}","git_commits_url":"https://api.github.com/repos/rstudio/rstudio/git/commits{/sha}","comments_url":"https://api.github.com/repos/rstudio/rstudio/comments{/number}","issue_comment_url":"https://api.github.com/repos/rstudio/rstudio/issues/comments{/number}","contents_url":"https://api.github.com/repos/rstudio/rstudio/contents/{+path}","compare_url":"https://api.github.com/repos/rstudio/rstudio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rstudio/rstudio/merges","archive_url":"https://api.github.com/repos/rstudio/rstudio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rstudio/rstudio/downloads","issues_url":"https://api.github.com/repos/rstudio/rstudio/issues{/number}","pulls_url":"https://api.github.com/repos/rstudio/rstudio/pulls{/number}","milestones_url":"https://api.github.com/repos/rstudio/rstudio/milestones{/number}","notifications_url":"https://api.github.com/repos/rstudio/rstudio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rstudio/rstudio/labels{/name}","releases_url":"https://api.github.com/repos/rstudio/rstudio/releases{/id}","deployments_url":"https://api.github.com/repos/rstudio/rstudio/deployments","created_at":"2010-12-07T19:10:25Z","updated_at":"2018-03-20T23:43:48Z","pushed_at":"2018-03-20T23:43:46Z","git_url":"git://github.com/rstudio/rstudio.git","ssh_url":"git@github.com:rstudio/rstudio.git","clone_url":"https://github.com/rstudio/rstudio.git","svn_url":"https://github.com/rstudio/rstudio","homepage":"https://www.rstudio.com/products/rstudio/","size":94828,"stargazers_count":2156,"watchers_count":2156,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":558,"mirror_url":null,"archived":false,"open_issues_count":461,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":558,"open_issues":461,"watchers":2156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/2452"},"html":{"href":"https://github.com/rstudio/rstudio/pull/2452"},"issue":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/2452"},"comments":{"href":"https://api.github.com/repos/rstudio/rstudio/issues/2452/comments"},"review_comments":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/2452/comments"},"review_comment":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rstudio/rstudio/pulls/2452/commits"},"statuses":{"href":"https://api.github.com/repos/rstudio/rstudio/statuses/cb6c6d13bbfad6c0b40b93015819b8646520b939"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"javierluraschi"}}