{"action":"created","comment":{"url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments/172256170","pull_request_review_id":101242404,"id":172256170,"diff_hunk":"@@ -0,0 +1,180 @@\n+package plugin_test\n+\n+import (\n+\t. \"github.com/onsi/ginkgo\"\n+\t. \"github.com/onsi/gomega\"\n+\t\"github.com/arquillian/ike-prow-plugins/plugin/test-keeper/plugin\"\n+\t\"gopkg.in/h2non/gock.v1\"\n+\t\"github.com/sirupsen/logrus\"\n+\t\"github.com/arquillian/ike-prow-plugins/plugin/github\"\n+\t\"os\"\n+\t\"io/ioutil\"\n+\t\"fmt\"\n+\t\"github.com/google/go-github/github\"\n+\t\"net/http\"\n+\t\"encoding/json\"\n+\t\"io\"\n+)\n+\n+const eventGUID = \"event-guid\"\n+\n+var _ = Describe(\"Test Keeper Plugin features\", func() {\n+\n+\tvar logger *logrus.Entry\n+\n+\tBeforeSuite(func() {\n+\t\tnullLogger := logrus.New()\n+\t\tnullLogger.Out = ioutil.Discard // TODO rethink if we want to discard logging entirely\n+\t\tlogger = logrus.NewEntry(nullLogger)\n+\t})\n+\n+\tContext(\"Pull Request handling\", func() {\n+\n+\t\tvar handler *plugin.GitHubTestEventsHandler\n+\n+\t\tBeforeEach(func() {\n+\t\t\tdefer gock.Off()\n+\n+\t\t\tclient := github.NewClient(nil) // TODO with hoverfly/go-vcr we might want to use tokens instead to capture real traffic\n+\t\t\thandler = &plugin.GitHubTestEventsHandler{\n+\t\t\t\tClient: client,\n+\t\t\t\tLog:    logger,\n+\t\t\t}\n+\t\t})\n+\n+\t\tIt(\"should approve opened pull request when tests included\", func() {\n+\t\t\t// given\n+\t\t\tgock.New(\"https://api.github.com\").\n+\t\t\t\tGet(\"/repos/bartoszmajsak/wfswarm-booster-pipeline-test/pulls/2/files\").\n+\t\t\t\tReply(200).\n+\t\t\t\tBody(fromJson(\"test_fixtures/github_calls/prs/with_tests/changes.json\"))\n+\n+\t\t\ttoHaveSuccessState := func(statusPayload map[string]interface{}) (bool) {","path":"plugin/test-keeper/plugin/event_handler_test.go","position":52,"original_position":52,"commit_id":"e860a3256a8596bcfe96f9871107b4ecbec1a4ca","original_commit_id":"baf79b479c99a5099a918ce3c1456a415ca19994","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"Would it make the test more readable? You will have to jump between those. It's violating DRY, but keeps test's \"story\" in one place. I think about it as an assertion and like with those I tend not to extract it outside of the test.","created_at":"2018-03-05T16:58:26Z","updated_at":"2018-03-05T16:58:26Z","html_url":"https://github.com/arquillian/ike-prow-plugins/pull/19#discussion_r172256170","pull_request_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments/172256170"},"html":{"href":"https://github.com/arquillian/ike-prow-plugins/pull/19#discussion_r172256170"},"pull_request":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19"}},"in_reply_to_id":172238535},"pull_request":{"url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19","id":172552452,"html_url":"https://github.com/arquillian/ike-prow-plugins/pull/19","diff_url":"https://github.com/arquillian/ike-prow-plugins/pull/19.diff","patch_url":"https://github.com/arquillian/ike-prow-plugins/pull/19.patch","issue_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/19","number":19,"state":"open","locked":false,"title":"feat(#2): feature tests for PR test keeper plugin","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"This PR brings `ginkgo` feature tests for status updates of Test Keeper plugin.","created_at":"2018-03-02T16:55:25Z","updated_at":"2018-03-05T16:58:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28443afd83f9acf823659391b7540a2ebbb68fa7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19/commits","review_comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19/comments","review_comment_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/19/comments","statuses_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/e860a3256a8596bcfe96f9871107b4ecbec1a4ca","head":{"label":"bartoszmajsak:tests","ref":"tests","sha":"e860a3256a8596bcfe96f9871107b4ecbec1a4ca","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"repo":{"id":122983236,"name":"ike-prow-plugins","full_name":"bartoszmajsak/ike-prow-plugins","owner":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartoszmajsak/ike-prow-plugins","description":"Set of plugins for Prow automation platform","fork":true,"url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins","forks_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/forks","keys_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/teams","hooks_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/hooks","issue_events_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/events","assignees_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/tags","blobs_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/languages","stargazers_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/stargazers","contributors_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/contributors","subscribers_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/subscribers","subscription_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/subscription","commits_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/merges","archive_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/downloads","issues_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/labels{/name}","releases_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/bartoszmajsak/ike-prow-plugins/deployments","created_at":"2018-02-26T14:43:36Z","updated_at":"2018-02-26T14:43:38Z","pushed_at":"2018-03-05T16:57:02Z","git_url":"git://github.com/bartoszmajsak/ike-prow-plugins.git","ssh_url":"git@github.com:bartoszmajsak/ike-prow-plugins.git","clone_url":"https://github.com/bartoszmajsak/ike-prow-plugins.git","svn_url":"https://github.com/bartoszmajsak/ike-prow-plugins","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"arquillian:master","ref":"master","sha":"422941d634466091153def37f279327bd661dabf","user":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"repo":{"id":122952098,"name":"ike-prow-plugins","full_name":"arquillian/ike-prow-plugins","owner":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arquillian/ike-prow-plugins","description":"Set of plugins for Prow automation platform","fork":false,"url":"https://api.github.com/repos/arquillian/ike-prow-plugins","forks_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/forks","keys_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/teams","hooks_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/hooks","issue_events_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/events","assignees_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/tags","blobs_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/languages","stargazers_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/stargazers","contributors_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/contributors","subscribers_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/subscribers","subscription_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/subscription","commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/merges","archive_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/downloads","issues_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/labels{/name}","releases_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/arquillian/ike-prow-plugins/deployments","created_at":"2018-02-26T10:17:01Z","updated_at":"2018-02-26T18:37:47Z","pushed_at":"2018-03-05T16:57:04Z","git_url":"git://github.com/arquillian/ike-prow-plugins.git","ssh_url":"git@github.com:arquillian/ike-prow-plugins.git","clone_url":"https://github.com/arquillian/ike-prow-plugins.git","svn_url":"https://github.com/arquillian/ike-prow-plugins","homepage":null,"size":37,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":9,"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":2,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19"},"html":{"href":"https://github.com/arquillian/ike-prow-plugins/pull/19"},"issue":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/19"},"comments":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/arquillian/ike-prow-plugins/statuses/e860a3256a8596bcfe96f9871107b4ecbec1a4ca"}},"author_association":"OWNER"}}
{"actor":{"display_login":"bartoszmajsak"}}