{"action":"created","comment":{"url":"https://api.github.com/repos/google/pprof/pulls/comments/180828150","pull_request_review_id":111319365,"id":180828150,"diff_hunk":"@@ -15,60 +15,398 @@\n package profile\n \n import (\n+\t\"fmt\"\n \t\"regexp\"\n+\t\"strings\"\n \t\"testing\"\n+\n+\t\"github.com/google/pprof/internal/proftest\"\n )\n \n-func TestFilter(t *testing.T) {\n-\t// Perform several forms of filtering on the test profile.\n+var simpleProfileMappings = []*Mapping{","path":"profile/filter_test.go","position":20,"original_position":20,"commit_id":"245705ffce4a9adf553c4467f339741236d66b93","original_commit_id":"245705ffce4a9adf553c4467f339741236d66b93","user":{"login":"lvng","id":31500167,"avatar_url":"https://avatars1.githubusercontent.com/u/31500167?v=4","gravatar_id":"","url":"https://api.github.com/users/lvng","html_url":"https://github.com/lvng","followers_url":"https://api.github.com/users/lvng/followers","following_url":"https://api.github.com/users/lvng/following{/other_user}","gists_url":"https://api.github.com/users/lvng/gists{/gist_id}","starred_url":"https://api.github.com/users/lvng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvng/subscriptions","organizations_url":"https://api.github.com/users/lvng/orgs","repos_url":"https://api.github.com/users/lvng/repos","events_url":"https://api.github.com/users/lvng/events{/privacy}","received_events_url":"https://api.github.com/users/lvng/received_events","type":"User","site_admin":false},"body":"couple reasons:\r\n- these test cases are largely duplicated from the cloud profiler test cases, so i didnt have to design them from scratch, and i dont have to worry missing an edge case that would lead to incompatibility.\r\n- i think smaller test input are easier to understand and reason about.\r\n- i think smaller test inputs are also easier to maintain, because the test cases dont all depend on the same profile.  if we used one profile for everything, then any modification to it would require changing all test cases. with multiple small profiles its easier to create new tests without breaking old ones.","created_at":"2018-04-11T17:03:01Z","updated_at":"2018-04-11T17:03:01Z","html_url":"https://github.com/google/pprof/pull/354#discussion_r180828150","pull_request_url":"https://api.github.com/repos/google/pprof/pulls/354","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/google/pprof/pulls/comments/180828150"},"html":{"href":"https://github.com/google/pprof/pull/354#discussion_r180828150"},"pull_request":{"href":"https://api.github.com/repos/google/pprof/pulls/354"}},"in_reply_to_id":180544440},"pull_request":{"url":"https://api.github.com/repos/google/pprof/pulls/354","id":179727381,"html_url":"https://github.com/google/pprof/pull/354","diff_url":"https://github.com/google/pprof/pull/354.diff","patch_url":"https://github.com/google/pprof/pull/354.patch","issue_url":"https://api.github.com/repos/google/pprof/issues/354","number":354,"state":"open","locked":false,"title":"improve profile filter unit tests","user":{"login":"lvng","id":31500167,"avatar_url":"https://avatars1.githubusercontent.com/u/31500167?v=4","gravatar_id":"","url":"https://api.github.com/users/lvng","html_url":"https://github.com/lvng","followers_url":"https://api.github.com/users/lvng/followers","following_url":"https://api.github.com/users/lvng/following{/other_user}","gists_url":"https://api.github.com/users/lvng/gists{/gist_id}","starred_url":"https://api.github.com/users/lvng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvng/subscriptions","organizations_url":"https://api.github.com/users/lvng/orgs","repos_url":"https://api.github.com/users/lvng/repos","events_url":"https://api.github.com/users/lvng/events{/privacy}","received_events_url":"https://api.github.com/users/lvng/received_events","type":"User","site_admin":false},"body":"The first step to adding new filters is to improve the existing unit tests. It appears that the existing unit tests for filtering only check the return values, not the filtered profile, so i started working on a new test case that covers that more thoroughly. Eventually I'll add the new filters, and add test cases for that there.\r\n\r\nThe test cases I'm adding are based on the tests for continuous pprof frontend, which will help us ensure compatibility between the two filter implementations.\r\n\r\nThis is still a work in progress but I would appreciate some early feedback to make sure I'm on the right track.\r\n\r\n","created_at":"2018-04-05T16:17:49Z","updated_at":"2018-04-11T17:03:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"733ab5016f003309878438a126b8c3fa4470532c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":328914978,"url":"https://api.github.com/repos/google/pprof/labels/cla:%20yes","name":"cla: yes","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/pprof/pulls/354/commits","review_comments_url":"https://api.github.com/repos/google/pprof/pulls/354/comments","review_comment_url":"https://api.github.com/repos/google/pprof/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/pprof/issues/354/comments","statuses_url":"https://api.github.com/repos/google/pprof/statuses/245705ffce4a9adf553c4467f339741236d66b93","head":{"label":"lvng:filters","ref":"filters","sha":"245705ffce4a9adf553c4467f339741236d66b93","user":{"login":"lvng","id":31500167,"avatar_url":"https://avatars1.githubusercontent.com/u/31500167?v=4","gravatar_id":"","url":"https://api.github.com/users/lvng","html_url":"https://github.com/lvng","followers_url":"https://api.github.com/users/lvng/followers","following_url":"https://api.github.com/users/lvng/following{/other_user}","gists_url":"https://api.github.com/users/lvng/gists{/gist_id}","starred_url":"https://api.github.com/users/lvng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvng/subscriptions","organizations_url":"https://api.github.com/users/lvng/orgs","repos_url":"https://api.github.com/users/lvng/repos","events_url":"https://api.github.com/users/lvng/events{/privacy}","received_events_url":"https://api.github.com/users/lvng/received_events","type":"User","site_admin":false},"repo":{"id":103171077,"name":"pprof","full_name":"lvng/pprof","owner":{"login":"lvng","id":31500167,"avatar_url":"https://avatars1.githubusercontent.com/u/31500167?v=4","gravatar_id":"","url":"https://api.github.com/users/lvng","html_url":"https://github.com/lvng","followers_url":"https://api.github.com/users/lvng/followers","following_url":"https://api.github.com/users/lvng/following{/other_user}","gists_url":"https://api.github.com/users/lvng/gists{/gist_id}","starred_url":"https://api.github.com/users/lvng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvng/subscriptions","organizations_url":"https://api.github.com/users/lvng/orgs","repos_url":"https://api.github.com/users/lvng/repos","events_url":"https://api.github.com/users/lvng/events{/privacy}","received_events_url":"https://api.github.com/users/lvng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lvng/pprof","description":"pprof is a tool for visualization and analysis of profiling data","fork":true,"url":"https://api.github.com/repos/lvng/pprof","forks_url":"https://api.github.com/repos/lvng/pprof/forks","keys_url":"https://api.github.com/repos/lvng/pprof/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lvng/pprof/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lvng/pprof/teams","hooks_url":"https://api.github.com/repos/lvng/pprof/hooks","issue_events_url":"https://api.github.com/repos/lvng/pprof/issues/events{/number}","events_url":"https://api.github.com/repos/lvng/pprof/events","assignees_url":"https://api.github.com/repos/lvng/pprof/assignees{/user}","branches_url":"https://api.github.com/repos/lvng/pprof/branches{/branch}","tags_url":"https://api.github.com/repos/lvng/pprof/tags","blobs_url":"https://api.github.com/repos/lvng/pprof/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lvng/pprof/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lvng/pprof/git/refs{/sha}","trees_url":"https://api.github.com/repos/lvng/pprof/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lvng/pprof/statuses/{sha}","languages_url":"https://api.github.com/repos/lvng/pprof/languages","stargazers_url":"https://api.github.com/repos/lvng/pprof/stargazers","contributors_url":"https://api.github.com/repos/lvng/pprof/contributors","subscribers_url":"https://api.github.com/repos/lvng/pprof/subscribers","subscription_url":"https://api.github.com/repos/lvng/pprof/subscription","commits_url":"https://api.github.com/repos/lvng/pprof/commits{/sha}","git_commits_url":"https://api.github.com/repos/lvng/pprof/git/commits{/sha}","comments_url":"https://api.github.com/repos/lvng/pprof/comments{/number}","issue_comment_url":"https://api.github.com/repos/lvng/pprof/issues/comments{/number}","contents_url":"https://api.github.com/repos/lvng/pprof/contents/{+path}","compare_url":"https://api.github.com/repos/lvng/pprof/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lvng/pprof/merges","archive_url":"https://api.github.com/repos/lvng/pprof/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lvng/pprof/downloads","issues_url":"https://api.github.com/repos/lvng/pprof/issues{/number}","pulls_url":"https://api.github.com/repos/lvng/pprof/pulls{/number}","milestones_url":"https://api.github.com/repos/lvng/pprof/milestones{/number}","notifications_url":"https://api.github.com/repos/lvng/pprof/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lvng/pprof/labels{/name}","releases_url":"https://api.github.com/repos/lvng/pprof/releases{/id}","deployments_url":"https://api.github.com/repos/lvng/pprof/deployments","created_at":"2017-09-11T18:10:47Z","updated_at":"2017-09-11T18:10:49Z","pushed_at":"2018-04-10T19:21:03Z","git_url":"git://github.com/lvng/pprof.git","ssh_url":"git@github.com:lvng/pprof.git","clone_url":"https://github.com/lvng/pprof.git","svn_url":"https://github.com/lvng/pprof","homepage":"","size":1831,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"2c640795afbaf1236474825104fd0a0d6ad00b1b","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":50629145,"name":"pprof","full_name":"google/pprof","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/pprof","description":"pprof is a tool for visualization and analysis of profiling data","fork":false,"url":"https://api.github.com/repos/google/pprof","forks_url":"https://api.github.com/repos/google/pprof/forks","keys_url":"https://api.github.com/repos/google/pprof/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/pprof/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/pprof/teams","hooks_url":"https://api.github.com/repos/google/pprof/hooks","issue_events_url":"https://api.github.com/repos/google/pprof/issues/events{/number}","events_url":"https://api.github.com/repos/google/pprof/events","assignees_url":"https://api.github.com/repos/google/pprof/assignees{/user}","branches_url":"https://api.github.com/repos/google/pprof/branches{/branch}","tags_url":"https://api.github.com/repos/google/pprof/tags","blobs_url":"https://api.github.com/repos/google/pprof/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/pprof/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/pprof/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/pprof/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/pprof/statuses/{sha}","languages_url":"https://api.github.com/repos/google/pprof/languages","stargazers_url":"https://api.github.com/repos/google/pprof/stargazers","contributors_url":"https://api.github.com/repos/google/pprof/contributors","subscribers_url":"https://api.github.com/repos/google/pprof/subscribers","subscription_url":"https://api.github.com/repos/google/pprof/subscription","commits_url":"https://api.github.com/repos/google/pprof/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/pprof/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/pprof/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/pprof/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/pprof/contents/{+path}","compare_url":"https://api.github.com/repos/google/pprof/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/pprof/merges","archive_url":"https://api.github.com/repos/google/pprof/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/pprof/downloads","issues_url":"https://api.github.com/repos/google/pprof/issues{/number}","pulls_url":"https://api.github.com/repos/google/pprof/pulls{/number}","milestones_url":"https://api.github.com/repos/google/pprof/milestones{/number}","notifications_url":"https://api.github.com/repos/google/pprof/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/pprof/labels{/name}","releases_url":"https://api.github.com/repos/google/pprof/releases{/id}","deployments_url":"https://api.github.com/repos/google/pprof/deployments","created_at":"2016-01-29T01:52:07Z","updated_at":"2018-04-11T14:37:26Z","pushed_at":"2018-04-10T19:21:05Z","git_url":"git://github.com/google/pprof.git","ssh_url":"git@github.com:google/pprof.git","clone_url":"https://github.com/google/pprof.git","svn_url":"https://github.com/google/pprof","homepage":"","size":1779,"stargazers_count":1406,"watchers_count":1406,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":137,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":137,"open_issues":24,"watchers":1406,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/pprof/pulls/354"},"html":{"href":"https://github.com/google/pprof/pull/354"},"issue":{"href":"https://api.github.com/repos/google/pprof/issues/354"},"comments":{"href":"https://api.github.com/repos/google/pprof/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/google/pprof/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/google/pprof/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/pprof/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/google/pprof/statuses/245705ffce4a9adf553c4467f339741236d66b93"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lvng"}}