{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/41594701","id":41594701,"diff_hunk":"@@ -77,54 +170,94 @@ var Group1Members []*ldap.Entry = []*ldap.Entry{Member1, Member2}\n var Group2Members []*ldap.Entry = []*ldap.Entry{Member2, Member3}\n var Group3Members []*ldap.Entry = []*ldap.Entry{Member3, Member4}\n \n-// TestSync ensures that data is exchanged and rearranged correctly during the sync process.\n-func TestSync(t *testing.T) {\n-\ttestGroupLister := TestGroupLister{\n-\t\tGroupUIDs: []string{Group1UID, Group2UID, Group3UID},\n+// TestGoodSync ensures that data is exchanged and rearranged correctly during the sync process.\n+func TestGoodSync(t *testing.T) {\n+\ttestGroupSyncer, tc := newTestSyncer()\n+\t_, errs := testGroupSyncer.Sync()\n+\tfor _, err := range errs {\n+\t\tt.Errorf(\"unexpected sync error: %v\", err)\n \t}\n-\ttestGroupMemberExtractor := TestGroupMemberExtractor{\n-\t\tMemberMapping: map[string][]*ldap.Entry{\n-\t\t\tGroup1UID: Group1Members,\n-\t\t\tGroup2UID: Group2Members,\n-\t\t\tGroup3UID: Group3Members,\n-\t\t},\n+\n+\tcheckClientForGroups(tc, newDefaultOpenShiftGroups(testGroupSyncer.Host), t)\n+}\n+\n+func TestListFails(t *testing.T) {\n+\ttestGroupSyncer, _ := newTestSyncer()\n+\ttestGroupSyncer.GroupLister.(*TestGroupLister).err = errors.New(\"error during listing\")\n+\n+\tgroups, errs := testGroupSyncer.Sync()\n+\tif len(errs) != 1 {\n+\t\tt.Errorf(\"unexpected sync error: %v\", errs)\n+\n+\t} else if errs[0] != testGroupSyncer.GroupLister.(*TestGroupLister).err {\n+\t\tt.Errorf(\"unexpected sync error: %v\", errs)\n \t}\n-\ttestUserNameMapper := TestUserNameMapper{\n-\t\tNameAttributes: []string{UserNameAttribute},\n+\n+\tif groups != nil {\n+\t\tt.Errorf(\"unexpected groups %v\", groups)\n \t}\n-\ttestGroupNameMapper := TestGroupNameMapper{\n-\t\tNameMapping: map[string]string{\n-\t\t\tGroup1UID: \"os\" + Group1UID,\n-\t\t\tGroup2UID: \"os\" + Group2UID,\n-\t\t\tGroup3UID: \"os\" + Group3UID,\n-\t\t},\n+}\n+\n+func TestMissingLDAPGroupUIDMapping(t *testing.T) {\n+\ttestGroupSyncer, tc := newTestSyncer()\n+\ttestGroupSyncer.GroupLister.(*TestGroupLister).GroupUIDs = append(testGroupSyncer.GroupLister.(*TestGroupLister).GroupUIDs, \"ldapgroupwithnouid\")","path":"pkg/cmd/experimental/syncgroups/groupsyncer_test.go","position":172,"original_position":172,"commit_id":"c01009acfb06b5b5851a8d24658e67397e0d7386","original_commit_id":"c01009acfb06b5b5851a8d24658e67397e0d7386","user":{"login":"stevekuznetsov","id":7328370,"avatar_url":"https://avatars.githubusercontent.com/u/7328370?v=3","gravatar_id":"","url":"https://api.github.com/users/stevekuznetsov","html_url":"https://github.com/stevekuznetsov","followers_url":"https://api.github.com/users/stevekuznetsov/followers","following_url":"https://api.github.com/users/stevekuznetsov/following{/other_user}","gists_url":"https://api.github.com/users/stevekuznetsov/gists{/gist_id}","starred_url":"https://api.github.com/users/stevekuznetsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevekuznetsov/subscriptions","organizations_url":"https://api.github.com/users/stevekuznetsov/orgs","repos_url":"https://api.github.com/users/stevekuznetsov/repos","events_url":"https://api.github.com/users/stevekuznetsov/events{/privacy}","received_events_url":"https://api.github.com/users/stevekuznetsov/received_events","type":"User","site_admin":false},"body":"Can you throw this into a closure around `newTestSyncer()` instead of this nonsense?","created_at":"2015-10-09T03:31:10Z","updated_at":"2015-10-09T03:31:10Z","html_url":"https://github.com/openshift/origin/pull/5017#discussion_r41594701","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/5017","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/41594701"},"html":{"href":"https://github.com/openshift/origin/pull/5017#discussion_r41594701"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/5017"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/5017","id":47198864,"html_url":"https://github.com/openshift/origin/pull/5017","diff_url":"https://github.com/openshift/origin/pull/5017.diff","patch_url":"https://github.com/openshift/origin/pull/5017.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/5017","number":5017,"state":"open","locked":false,"title":"ldap sync improvements","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"This addresses a few comments made by @liggitt.  Most importantly, it provides feedback while the job is running, since this likely to be long running.\r\n\r\nIt also adds more unit tests, eliminates unnecessary cruft from options objects, makes the create/update flow more straightforward, and fixes a testclient problem that @kargakis found (let me know if you want that separately).\r\n\r\n@stevekuznetsov @pweil- ptal.","created_at":"2015-10-08T19:58:58Z","updated_at":"2015-10-09T03:31:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5d1e79e8537a6d2dfeadd0fd99a46bc37c4779f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/5017/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/5017/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/5017/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/c01009acfb06b5b5851a8d24658e67397e0d7386","head":{"label":"deads2k:refactor-sync","ref":"refactor-sync","sha":"c01009acfb06b5b5851a8d24658e67397e0d7386","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"repo":{"id":24424126,"name":"origin","full_name":"deads2k/origin","owner":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deads2k/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/deads2k/origin","forks_url":"https://api.github.com/repos/deads2k/origin/forks","keys_url":"https://api.github.com/repos/deads2k/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deads2k/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deads2k/origin/teams","hooks_url":"https://api.github.com/repos/deads2k/origin/hooks","issue_events_url":"https://api.github.com/repos/deads2k/origin/issues/events{/number}","events_url":"https://api.github.com/repos/deads2k/origin/events","assignees_url":"https://api.github.com/repos/deads2k/origin/assignees{/user}","branches_url":"https://api.github.com/repos/deads2k/origin/branches{/branch}","tags_url":"https://api.github.com/repos/deads2k/origin/tags","blobs_url":"https://api.github.com/repos/deads2k/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deads2k/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deads2k/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/deads2k/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deads2k/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/deads2k/origin/languages","stargazers_url":"https://api.github.com/repos/deads2k/origin/stargazers","contributors_url":"https://api.github.com/repos/deads2k/origin/contributors","subscribers_url":"https://api.github.com/repos/deads2k/origin/subscribers","subscription_url":"https://api.github.com/repos/deads2k/origin/subscription","commits_url":"https://api.github.com/repos/deads2k/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/deads2k/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/deads2k/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/deads2k/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/deads2k/origin/contents/{+path}","compare_url":"https://api.github.com/repos/deads2k/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deads2k/origin/merges","archive_url":"https://api.github.com/repos/deads2k/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deads2k/origin/downloads","issues_url":"https://api.github.com/repos/deads2k/origin/issues{/number}","pulls_url":"https://api.github.com/repos/deads2k/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/deads2k/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/deads2k/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deads2k/origin/labels{/name}","releases_url":"https://api.github.com/repos/deads2k/origin/releases{/id}","created_at":"2014-09-24T17:02:12Z","updated_at":"2015-05-08T15:45:28Z","pushed_at":"2015-10-08T19:57:04Z","git_url":"git://github.com/deads2k/origin.git","ssh_url":"git@github.com:deads2k/origin.git","clone_url":"https://github.com/deads2k/origin.git","svn_url":"https://github.com/deads2k/origin","homepage":"https://openshift.github.io","size":148554,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"f3b0aa95033a3d1064bfa35048526bb6c44e352d","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-10-08T12:54:37Z","pushed_at":"2015-10-09T00:59:14Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":257385,"stargazers_count":725,"watchers_count":725,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":442,"mirror_url":null,"open_issues_count":572,"forks":442,"open_issues":572,"watchers":725,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/5017"},"html":{"href":"https://github.com/openshift/origin/pull/5017"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/5017"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/5017/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/5017/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/5017/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/c01009acfb06b5b5851a8d24658e67397e0d7386"}}}}