{"action":"created","comment":{"url":"https://api.github.com/repos/lovoo/goka/pulls/comments/228086512","pull_request_review_id":168270593,"id":228086512,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODA4NjUxMg==","diff_hunk":"@@ -20,35 +23,84 @@ type Codec interface {\n \tDecode(data []byte) (value interface{}, err error)\n }\n \n+type debugLogger interface {\n+\tPrintf(s string, args ...interface{})\n+}\n+\n+type nilLogger int\n+\n+func (*nilLogger) Printf(s string, args ...interface{}) {}\n+\n+var (\n+\tdebug              = flag.Bool(\"tester-debug\", false, \"show debug prints of the tester.\")\n+\tlogger debugLogger = new(nilLogger)\n+)\n+\n // EmitHandler abstracts a function that allows to overwrite kafkamock's Emit function to\n // simulate producer errors\n type EmitHandler func(topic string, key string, value []byte) *kafka.Promise\n \n+type queuedMessage struct {\n+\ttopic string\n+\tkey   string\n+\tvalue []byte\n+}\n+\n // Tester allows interacting with a test processor\n type Tester struct {\n \tt T\n \n-\tconsumerMock   *consumerMock\n-\tproducerMock   *producerMock\n-\ttopicMgrMock   *topicMgrMock\n-\temitHandler    EmitHandler\n-\tstorage        storage.Storage\n-\tcodec          Codec\n-\toffset         int64\n-\ttableOffset    int64\n-\tincomingEvents chan kafka.Event\n-\tconsumerEvents chan kafka.Event\n-\t// Stores a map of all topics that are handled by the processor.\n-\t// Every time an emit is called, those messages for handled topics are relayed\n-\t// after the consume-function has finished.\n-\t// All other messages are stored in the emitted-slice for further inspection\n-\thandledTopics map[string]bool\n-\tgroupTopic    string\n-\temitted       []*kafka.Message\n-\n-\tgroupTableCreator func() (string, []byte)\n-\tcallQueue         []func()\n-\twg                sync.WaitGroup\n+\tproducerMock *producerMock\n+\ttopicMgrMock *topicMgrMock\n+\temitHandler  EmitHandler\n+\tstorages     map[string][]storage.Storage\n+\n+\tcodecs      map[string]goka.Codec\n+\ttopicQueues map[string]*queue\n+\tmQueues     sync.RWMutex\n+\n+\tqueuedMessages []*queuedMessage\n+}\n+\n+func (km *Tester) queueForTopic(topic string) *queue {\n+\tkm.mQueues.RLock()\n+\tdefer km.mQueues.RUnlock()\n+\tq, exists := km.topicQueues[topic]\n+\tif !exists {\n+\t\tpanic(fmt.Errorf(\"No queue for topic %s\", topic))\n+\t}\n+\treturn q\n+}\n+\n+// CreateMessageTracker creates a message tracker that starts tracking\n+// the messages from the end of the current queues\n+func (km *Tester) NewMessageTrackerFromEnd() *MessageTracker {","path":"tester/tester.go","position":96,"original_position":96,"commit_id":"26671eaaaa04f8541bfd145e36ec690cb79d5ebd","original_commit_id":"26671eaaaa04f8541bfd145e36ec690cb79d5ebd","user":{"login":"db7","id":419366,"node_id":"MDQ6VXNlcjQxOTM2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/419366?v=4","gravatar_id":"","url":"https://api.github.com/users/db7","html_url":"https://github.com/db7","followers_url":"https://api.github.com/users/db7/followers","following_url":"https://api.github.com/users/db7/following{/other_user}","gists_url":"https://api.github.com/users/db7/gists{/gist_id}","starred_url":"https://api.github.com/users/db7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/db7/subscriptions","organizations_url":"https://api.github.com/users/db7/orgs","repos_url":"https://api.github.com/users/db7/repos","events_url":"https://api.github.com/users/db7/events{/privacy}","received_events_url":"https://api.github.com/users/db7/received_events","type":"User","site_admin":false},"body":"suggestion: `NewMessageTracker(topic string)`\r\n","created_at":"2018-10-25T08:52:09Z","updated_at":"2018-10-25T08:52:51Z","html_url":"https://github.com/lovoo/goka/pull/146#discussion_r228086512","pull_request_url":"https://api.github.com/repos/lovoo/goka/pulls/146","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/lovoo/goka/pulls/comments/228086512"},"html":{"href":"https://github.com/lovoo/goka/pull/146#discussion_r228086512"},"pull_request":{"href":"https://api.github.com/repos/lovoo/goka/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/lovoo/goka/pulls/146","id":219375116,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5Mzc1MTE2","html_url":"https://github.com/lovoo/goka/pull/146","diff_url":"https://github.com/lovoo/goka/pull/146.diff","patch_url":"https://github.com/lovoo/goka/pull/146.patch","issue_url":"https://api.github.com/repos/lovoo/goka/issues/146","number":146,"state":"open","locked":false,"title":"improve tester implementation","user":{"login":"frairon","id":6941321,"node_id":"MDQ6VXNlcjY5NDEzMjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6941321?v=4","gravatar_id":"","url":"https://api.github.com/users/frairon","html_url":"https://github.com/frairon","followers_url":"https://api.github.com/users/frairon/followers","following_url":"https://api.github.com/users/frairon/following{/other_user}","gists_url":"https://api.github.com/users/frairon/gists{/gist_id}","starred_url":"https://api.github.com/users/frairon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frairon/subscriptions","organizations_url":"https://api.github.com/users/frairon/orgs","repos_url":"https://api.github.com/users/frairon/repos","events_url":"https://api.github.com/users/frairon/events{/privacy}","received_events_url":"https://api.github.com/users/frairon/received_events","type":"User","site_admin":false},"body":"Reimplementation of the tester to  fix all issues (see issue #145)","created_at":"2018-10-01T13:25:56Z","updated_at":"2018-10-25T08:52:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd2fdbcdad06db58bae2d9ab6d4666b75dd1f384","assignee":null,"assignees":[],"requested_reviewers":[{"login":"SamiHiltunen","id":3035183,"node_id":"MDQ6VXNlcjMwMzUxODM=","avatar_url":"https://avatars2.githubusercontent.com/u/3035183?v=4","gravatar_id":"","url":"https://api.github.com/users/SamiHiltunen","html_url":"https://github.com/SamiHiltunen","followers_url":"https://api.github.com/users/SamiHiltunen/followers","following_url":"https://api.github.com/users/SamiHiltunen/following{/other_user}","gists_url":"https://api.github.com/users/SamiHiltunen/gists{/gist_id}","starred_url":"https://api.github.com/users/SamiHiltunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamiHiltunen/subscriptions","organizations_url":"https://api.github.com/users/SamiHiltunen/orgs","repos_url":"https://api.github.com/users/SamiHiltunen/repos","events_url":"https://api.github.com/users/SamiHiltunen/events{/privacy}","received_events_url":"https://api.github.com/users/SamiHiltunen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lovoo/goka/pulls/146/commits","review_comments_url":"https://api.github.com/repos/lovoo/goka/pulls/146/comments","review_comment_url":"https://api.github.com/repos/lovoo/goka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lovoo/goka/issues/146/comments","statuses_url":"https://api.github.com/repos/lovoo/goka/statuses/26671eaaaa04f8541bfd145e36ec690cb79d5ebd","head":{"label":"lovoo:tester-refactoring","ref":"tester-refactoring","sha":"26671eaaaa04f8541bfd145e36ec690cb79d5ebd","user":{"login":"lovoo","id":9198992,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTg5OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9198992?v=4","gravatar_id":"","url":"https://api.github.com/users/lovoo","html_url":"https://github.com/lovoo","followers_url":"https://api.github.com/users/lovoo/followers","following_url":"https://api.github.com/users/lovoo/following{/other_user}","gists_url":"https://api.github.com/users/lovoo/gists{/gist_id}","starred_url":"https://api.github.com/users/lovoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovoo/subscriptions","organizations_url":"https://api.github.com/users/lovoo/orgs","repos_url":"https://api.github.com/users/lovoo/repos","events_url":"https://api.github.com/users/lovoo/events{/privacy}","received_events_url":"https://api.github.com/users/lovoo/received_events","type":"Organization","site_admin":false},"repo":{"id":86450135,"node_id":"MDEwOlJlcG9zaXRvcnk4NjQ1MDEzNQ==","name":"goka","full_name":"lovoo/goka","private":false,"owner":{"login":"lovoo","id":9198992,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTg5OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9198992?v=4","gravatar_id":"","url":"https://api.github.com/users/lovoo","html_url":"https://github.com/lovoo","followers_url":"https://api.github.com/users/lovoo/followers","following_url":"https://api.github.com/users/lovoo/following{/other_user}","gists_url":"https://api.github.com/users/lovoo/gists{/gist_id}","starred_url":"https://api.github.com/users/lovoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovoo/subscriptions","organizations_url":"https://api.github.com/users/lovoo/orgs","repos_url":"https://api.github.com/users/lovoo/repos","events_url":"https://api.github.com/users/lovoo/events{/privacy}","received_events_url":"https://api.github.com/users/lovoo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lovoo/goka","description":"Goka is a compact yet powerful distributed stream processing library for Apache Kafka written in Go.","fork":false,"url":"https://api.github.com/repos/lovoo/goka","forks_url":"https://api.github.com/repos/lovoo/goka/forks","keys_url":"https://api.github.com/repos/lovoo/goka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lovoo/goka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lovoo/goka/teams","hooks_url":"https://api.github.com/repos/lovoo/goka/hooks","issue_events_url":"https://api.github.com/repos/lovoo/goka/issues/events{/number}","events_url":"https://api.github.com/repos/lovoo/goka/events","assignees_url":"https://api.github.com/repos/lovoo/goka/assignees{/user}","branches_url":"https://api.github.com/repos/lovoo/goka/branches{/branch}","tags_url":"https://api.github.com/repos/lovoo/goka/tags","blobs_url":"https://api.github.com/repos/lovoo/goka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lovoo/goka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lovoo/goka/git/refs{/sha}","trees_url":"https://api.github.com/repos/lovoo/goka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lovoo/goka/statuses/{sha}","languages_url":"https://api.github.com/repos/lovoo/goka/languages","stargazers_url":"https://api.github.com/repos/lovoo/goka/stargazers","contributors_url":"https://api.github.com/repos/lovoo/goka/contributors","subscribers_url":"https://api.github.com/repos/lovoo/goka/subscribers","subscription_url":"https://api.github.com/repos/lovoo/goka/subscription","commits_url":"https://api.github.com/repos/lovoo/goka/commits{/sha}","git_commits_url":"https://api.github.com/repos/lovoo/goka/git/commits{/sha}","comments_url":"https://api.github.com/repos/lovoo/goka/comments{/number}","issue_comment_url":"https://api.github.com/repos/lovoo/goka/issues/comments{/number}","contents_url":"https://api.github.com/repos/lovoo/goka/contents/{+path}","compare_url":"https://api.github.com/repos/lovoo/goka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lovoo/goka/merges","archive_url":"https://api.github.com/repos/lovoo/goka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lovoo/goka/downloads","issues_url":"https://api.github.com/repos/lovoo/goka/issues{/number}","pulls_url":"https://api.github.com/repos/lovoo/goka/pulls{/number}","milestones_url":"https://api.github.com/repos/lovoo/goka/milestones{/number}","notifications_url":"https://api.github.com/repos/lovoo/goka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lovoo/goka/labels{/name}","releases_url":"https://api.github.com/repos/lovoo/goka/releases{/id}","deployments_url":"https://api.github.com/repos/lovoo/goka/deployments","created_at":"2017-03-28T11:06:58Z","updated_at":"2018-10-22T04:21:28Z","pushed_at":"2018-10-25T08:45:24Z","git_url":"git://github.com/lovoo/goka.git","ssh_url":"git@github.com:lovoo/goka.git","clone_url":"https://github.com/lovoo/goka.git","svn_url":"https://github.com/lovoo/goka","homepage":"","size":889,"stargazers_count":938,"watchers_count":938,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":45,"open_issues":9,"watchers":938,"default_branch":"master"}},"base":{"label":"lovoo:master","ref":"master","sha":"81cba561a5a2249a8a436f25ae695eb46211d899","user":{"login":"lovoo","id":9198992,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTg5OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9198992?v=4","gravatar_id":"","url":"https://api.github.com/users/lovoo","html_url":"https://github.com/lovoo","followers_url":"https://api.github.com/users/lovoo/followers","following_url":"https://api.github.com/users/lovoo/following{/other_user}","gists_url":"https://api.github.com/users/lovoo/gists{/gist_id}","starred_url":"https://api.github.com/users/lovoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovoo/subscriptions","organizations_url":"https://api.github.com/users/lovoo/orgs","repos_url":"https://api.github.com/users/lovoo/repos","events_url":"https://api.github.com/users/lovoo/events{/privacy}","received_events_url":"https://api.github.com/users/lovoo/received_events","type":"Organization","site_admin":false},"repo":{"id":86450135,"node_id":"MDEwOlJlcG9zaXRvcnk4NjQ1MDEzNQ==","name":"goka","full_name":"lovoo/goka","private":false,"owner":{"login":"lovoo","id":9198992,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxOTg5OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9198992?v=4","gravatar_id":"","url":"https://api.github.com/users/lovoo","html_url":"https://github.com/lovoo","followers_url":"https://api.github.com/users/lovoo/followers","following_url":"https://api.github.com/users/lovoo/following{/other_user}","gists_url":"https://api.github.com/users/lovoo/gists{/gist_id}","starred_url":"https://api.github.com/users/lovoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovoo/subscriptions","organizations_url":"https://api.github.com/users/lovoo/orgs","repos_url":"https://api.github.com/users/lovoo/repos","events_url":"https://api.github.com/users/lovoo/events{/privacy}","received_events_url":"https://api.github.com/users/lovoo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/lovoo/goka","description":"Goka is a compact yet powerful distributed stream processing library for Apache Kafka written in Go.","fork":false,"url":"https://api.github.com/repos/lovoo/goka","forks_url":"https://api.github.com/repos/lovoo/goka/forks","keys_url":"https://api.github.com/repos/lovoo/goka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lovoo/goka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lovoo/goka/teams","hooks_url":"https://api.github.com/repos/lovoo/goka/hooks","issue_events_url":"https://api.github.com/repos/lovoo/goka/issues/events{/number}","events_url":"https://api.github.com/repos/lovoo/goka/events","assignees_url":"https://api.github.com/repos/lovoo/goka/assignees{/user}","branches_url":"https://api.github.com/repos/lovoo/goka/branches{/branch}","tags_url":"https://api.github.com/repos/lovoo/goka/tags","blobs_url":"https://api.github.com/repos/lovoo/goka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lovoo/goka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lovoo/goka/git/refs{/sha}","trees_url":"https://api.github.com/repos/lovoo/goka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lovoo/goka/statuses/{sha}","languages_url":"https://api.github.com/repos/lovoo/goka/languages","stargazers_url":"https://api.github.com/repos/lovoo/goka/stargazers","contributors_url":"https://api.github.com/repos/lovoo/goka/contributors","subscribers_url":"https://api.github.com/repos/lovoo/goka/subscribers","subscription_url":"https://api.github.com/repos/lovoo/goka/subscription","commits_url":"https://api.github.com/repos/lovoo/goka/commits{/sha}","git_commits_url":"https://api.github.com/repos/lovoo/goka/git/commits{/sha}","comments_url":"https://api.github.com/repos/lovoo/goka/comments{/number}","issue_comment_url":"https://api.github.com/repos/lovoo/goka/issues/comments{/number}","contents_url":"https://api.github.com/repos/lovoo/goka/contents/{+path}","compare_url":"https://api.github.com/repos/lovoo/goka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lovoo/goka/merges","archive_url":"https://api.github.com/repos/lovoo/goka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lovoo/goka/downloads","issues_url":"https://api.github.com/repos/lovoo/goka/issues{/number}","pulls_url":"https://api.github.com/repos/lovoo/goka/pulls{/number}","milestones_url":"https://api.github.com/repos/lovoo/goka/milestones{/number}","notifications_url":"https://api.github.com/repos/lovoo/goka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lovoo/goka/labels{/name}","releases_url":"https://api.github.com/repos/lovoo/goka/releases{/id}","deployments_url":"https://api.github.com/repos/lovoo/goka/deployments","created_at":"2017-03-28T11:06:58Z","updated_at":"2018-10-22T04:21:28Z","pushed_at":"2018-10-25T08:45:24Z","git_url":"git://github.com/lovoo/goka.git","ssh_url":"git@github.com:lovoo/goka.git","clone_url":"https://github.com/lovoo/goka.git","svn_url":"https://github.com/lovoo/goka","homepage":"","size":889,"stargazers_count":938,"watchers_count":938,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":45,"open_issues":9,"watchers":938,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lovoo/goka/pulls/146"},"html":{"href":"https://github.com/lovoo/goka/pull/146"},"issue":{"href":"https://api.github.com/repos/lovoo/goka/issues/146"},"comments":{"href":"https://api.github.com/repos/lovoo/goka/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/lovoo/goka/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/lovoo/goka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lovoo/goka/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/lovoo/goka/statuses/26671eaaaa04f8541bfd145e36ec690cb79d5ebd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"db7"}}