{"action":"created","comment":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/185194450","pull_request_review_id":116533226,"id":185194450,"diff_hunk":"@@ -12,48 +12,44 @@\n  * GNU Lesser General Public License for more details.\n  *)\n \n-open OUnit\n-open Test_common\n+module T = Test_common\n \n (* Helpers for testing Xapi_vbd_helpers.valid_operations *)\n \n let setup_test ~__context ~vdi_fun =\n-  let _sm_ref = make_sm ~__context () in\n-  let sr_ref = make_sr ~__context () in\n-  let (_: API.ref_PBD) = make_pbd ~__context ~sR:sr_ref () in\n-  let vm_ref = make_vm ~__context () in\n+  let _sm_ref = T.make_sm ~__context () in\n+  let sr_ref = T.make_sr ~__context () in\n+  let (_: API.ref_PBD) = T.make_pbd ~__context ~sR:sr_ref () in\n+  let vm_ref = T.make_vm ~__context () in\n   let vdi_ref = vdi_fun sr_ref in\n-  let vbd_ref = make_vbd ~vDI:vdi_ref ~vM:vm_ref ~__context () in\n+  let vbd_ref = T.make_vbd ~vDI:vdi_ref ~vM:vm_ref ~__context () in\n   let vbd_record = Db.VBD.get_record_internal ~__context ~self:vbd_ref in\n   vbd_ref, vbd_record\n \n-let my_cmp a b = match a,b with\n-  | Some(code1, _), Some(code2, _) -> code1 = code2\n-  | None, None -> true\n-  | _\t-> false\n-\n-let string_of_api_exn_opt = function\n-  | None -> \"None\"\n-  | Some (code, args) ->\n-    Printf.sprintf \"Some (%s, [%s])\" code (String.concat \"; \" args)\n-\n-let run_assert_equal_with_vdi ~__context ?(cmp = my_cmp) ?(expensive_sharing_checks=true) ~vdi_fun op exc =\n+let run_assert_equal_with_vdi ~__context msg ?(expensive_sharing_checks=true) ~vdi_fun op expected_error_if_any =\n   let vbd_ref, vbd_record = setup_test ~__context ~vdi_fun in\n-  assert_equal\n-    ~cmp\n-    ~printer:string_of_api_exn_opt\n-    exc (Hashtbl.find (Xapi_vbd_helpers.valid_operations ~__context ~expensive_sharing_checks vbd_record vbd_ref) op)\n+  let get_error_code_of op =\n+    let valid_ops = (Xapi_vbd_helpers.valid_operations ~__context ~expensive_sharing_checks vbd_record vbd_ref) in\n+    match Hashtbl.find valid_ops op with\n+    | Some (code, _::_ ) -> Some code\n+    | Some _ | None -> None","path":"ocaml/tests/test_xapi_vbd_helpers.ml","position":46,"original_position":46,"commit_id":"804e678597a8258067a5a509d1e30e54497858d0","original_commit_id":"804e678597a8258067a5a509d1e30e54497858d0","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"body":"That said, do you think I should remove the case that takes the first element of  a `pair option`? As it is, this is designed to accept `Some api_error_code,params`, not `Some individual_error`.","created_at":"2018-05-01T09:47:04Z","updated_at":"2018-05-01T09:47:05Z","html_url":"https://github.com/xapi-project/xen-api/pull/3583#discussion_r185194450","pull_request_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments/185194450"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3583#discussion_r185194450"},"pull_request":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583"}},"in_reply_to_id":184972022},"pull_request":{"url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583","id":184919356,"html_url":"https://github.com/xapi-project/xen-api/pull/3583","diff_url":"https://github.com/xapi-project/xen-api/pull/3583.diff","patch_url":"https://github.com/xapi-project/xen-api/pull/3583.patch","issue_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3583","number":3583,"state":"open","locked":false,"title":" CP-27911: Alcotest unit test ports","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"body":"Porting the remaining OUnit tests that don't use test_highlevel, as this will require a separate port.","created_at":"2018-04-30T10:07:16Z","updated_at":"2018-05-01T09:47:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95cd529c5aac738ae556daf06b39d79a07a00aee","assignee":{"login":"gaborigloi","id":10549240,"avatar_url":"https://avatars3.githubusercontent.com/u/10549240?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborigloi","html_url":"https://github.com/gaborigloi","followers_url":"https://api.github.com/users/gaborigloi/followers","following_url":"https://api.github.com/users/gaborigloi/following{/other_user}","gists_url":"https://api.github.com/users/gaborigloi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborigloi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborigloi/subscriptions","organizations_url":"https://api.github.com/users/gaborigloi/orgs","repos_url":"https://api.github.com/users/gaborigloi/repos","events_url":"https://api.github.com/users/gaborigloi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborigloi/received_events","type":"User","site_admin":false},"assignees":[{"login":"gaborigloi","id":10549240,"avatar_url":"https://avatars3.githubusercontent.com/u/10549240?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborigloi","html_url":"https://github.com/gaborigloi","followers_url":"https://api.github.com/users/gaborigloi/followers","following_url":"https://api.github.com/users/gaborigloi/following{/other_user}","gists_url":"https://api.github.com/users/gaborigloi/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborigloi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborigloi/subscriptions","organizations_url":"https://api.github.com/users/gaborigloi/orgs","repos_url":"https://api.github.com/users/gaborigloi/repos","events_url":"https://api.github.com/users/gaborigloi/events{/privacy}","received_events_url":"https://api.github.com/users/gaborigloi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583/commits","review_comments_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583/comments","review_comment_url":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/issues/3583/comments","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/804e678597a8258067a5a509d1e30e54497858d0","head":{"label":"minishrink:alcotest_port","ref":"alcotest_port","sha":"804e678597a8258067a5a509d1e30e54497858d0","user":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"repo":{"id":99582590,"name":"xen-api","full_name":"minishrink/xen-api","owner":{"login":"minishrink","id":16429238,"avatar_url":"https://avatars1.githubusercontent.com/u/16429238?v=4","gravatar_id":"","url":"https://api.github.com/users/minishrink","html_url":"https://github.com/minishrink","followers_url":"https://api.github.com/users/minishrink/followers","following_url":"https://api.github.com/users/minishrink/following{/other_user}","gists_url":"https://api.github.com/users/minishrink/gists{/gist_id}","starred_url":"https://api.github.com/users/minishrink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minishrink/subscriptions","organizations_url":"https://api.github.com/users/minishrink/orgs","repos_url":"https://api.github.com/users/minishrink/repos","events_url":"https://api.github.com/users/minishrink/events{/privacy}","received_events_url":"https://api.github.com/users/minishrink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/minishrink/xen-api","description":"The Xapi Project's XenAPI Server","fork":true,"url":"https://api.github.com/repos/minishrink/xen-api","forks_url":"https://api.github.com/repos/minishrink/xen-api/forks","keys_url":"https://api.github.com/repos/minishrink/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minishrink/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minishrink/xen-api/teams","hooks_url":"https://api.github.com/repos/minishrink/xen-api/hooks","issue_events_url":"https://api.github.com/repos/minishrink/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/minishrink/xen-api/events","assignees_url":"https://api.github.com/repos/minishrink/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/minishrink/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/minishrink/xen-api/tags","blobs_url":"https://api.github.com/repos/minishrink/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minishrink/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minishrink/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/minishrink/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minishrink/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/minishrink/xen-api/languages","stargazers_url":"https://api.github.com/repos/minishrink/xen-api/stargazers","contributors_url":"https://api.github.com/repos/minishrink/xen-api/contributors","subscribers_url":"https://api.github.com/repos/minishrink/xen-api/subscribers","subscription_url":"https://api.github.com/repos/minishrink/xen-api/subscription","commits_url":"https://api.github.com/repos/minishrink/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/minishrink/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/minishrink/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/minishrink/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/minishrink/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/minishrink/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minishrink/xen-api/merges","archive_url":"https://api.github.com/repos/minishrink/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minishrink/xen-api/downloads","issues_url":"https://api.github.com/repos/minishrink/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/minishrink/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/minishrink/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/minishrink/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minishrink/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/minishrink/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/minishrink/xen-api/deployments","created_at":"2017-08-07T13:45:59Z","updated_at":"2018-03-22T10:23:17Z","pushed_at":"2018-05-01T08:56:01Z","git_url":"git://github.com/minishrink/xen-api.git","ssh_url":"git@github.com:minishrink/xen-api.git","clone_url":"https://github.com/minishrink/xen-api.git","svn_url":"https://github.com/minishrink/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":30594,"stargazers_count":0,"watchers_count":0,"language":"OCaml","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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xapi-project:master","ref":"master","sha":"8d4ec47d0588ae5eb81dacfa598e1e17858bd01c","user":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"repo":{"id":960233,"name":"xen-api","full_name":"xapi-project/xen-api","owner":{"login":"xapi-project","id":317268,"avatar_url":"https://avatars3.githubusercontent.com/u/317268?v=4","gravatar_id":"","url":"https://api.github.com/users/xapi-project","html_url":"https://github.com/xapi-project","followers_url":"https://api.github.com/users/xapi-project/followers","following_url":"https://api.github.com/users/xapi-project/following{/other_user}","gists_url":"https://api.github.com/users/xapi-project/gists{/gist_id}","starred_url":"https://api.github.com/users/xapi-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapi-project/subscriptions","organizations_url":"https://api.github.com/users/xapi-project/orgs","repos_url":"https://api.github.com/users/xapi-project/repos","events_url":"https://api.github.com/users/xapi-project/events{/privacy}","received_events_url":"https://api.github.com/users/xapi-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapi-project/xen-api","description":"The Xapi Project's XenAPI Server","fork":false,"url":"https://api.github.com/repos/xapi-project/xen-api","forks_url":"https://api.github.com/repos/xapi-project/xen-api/forks","keys_url":"https://api.github.com/repos/xapi-project/xen-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapi-project/xen-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapi-project/xen-api/teams","hooks_url":"https://api.github.com/repos/xapi-project/xen-api/hooks","issue_events_url":"https://api.github.com/repos/xapi-project/xen-api/issues/events{/number}","events_url":"https://api.github.com/repos/xapi-project/xen-api/events","assignees_url":"https://api.github.com/repos/xapi-project/xen-api/assignees{/user}","branches_url":"https://api.github.com/repos/xapi-project/xen-api/branches{/branch}","tags_url":"https://api.github.com/repos/xapi-project/xen-api/tags","blobs_url":"https://api.github.com/repos/xapi-project/xen-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapi-project/xen-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapi-project/xen-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapi-project/xen-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapi-project/xen-api/statuses/{sha}","languages_url":"https://api.github.com/repos/xapi-project/xen-api/languages","stargazers_url":"https://api.github.com/repos/xapi-project/xen-api/stargazers","contributors_url":"https://api.github.com/repos/xapi-project/xen-api/contributors","subscribers_url":"https://api.github.com/repos/xapi-project/xen-api/subscribers","subscription_url":"https://api.github.com/repos/xapi-project/xen-api/subscription","commits_url":"https://api.github.com/repos/xapi-project/xen-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapi-project/xen-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapi-project/xen-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapi-project/xen-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapi-project/xen-api/contents/{+path}","compare_url":"https://api.github.com/repos/xapi-project/xen-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapi-project/xen-api/merges","archive_url":"https://api.github.com/repos/xapi-project/xen-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapi-project/xen-api/downloads","issues_url":"https://api.github.com/repos/xapi-project/xen-api/issues{/number}","pulls_url":"https://api.github.com/repos/xapi-project/xen-api/pulls{/number}","milestones_url":"https://api.github.com/repos/xapi-project/xen-api/milestones{/number}","notifications_url":"https://api.github.com/repos/xapi-project/xen-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapi-project/xen-api/labels{/name}","releases_url":"https://api.github.com/repos/xapi-project/xen-api/releases{/id}","deployments_url":"https://api.github.com/repos/xapi-project/xen-api/deployments","created_at":"2010-10-04T10:52:57Z","updated_at":"2018-04-30T08:33:07Z","pushed_at":"2018-05-01T09:15:04Z","git_url":"git://github.com/xapi-project/xen-api.git","ssh_url":"git@github.com:xapi-project/xen-api.git","clone_url":"https://github.com/xapi-project/xen-api.git","svn_url":"https://github.com/xapi-project/xen-api","homepage":"http://xenproject.org/developers/teams/xapi.html","size":32730,"stargazers_count":256,"watchers_count":256,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":205,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":205,"open_issues":18,"watchers":256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583"},"html":{"href":"https://github.com/xapi-project/xen-api/pull/3583"},"issue":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3583"},"comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/issues/3583/comments"},"review_comments":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583/comments"},"review_comment":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapi-project/xen-api/pulls/3583/commits"},"statuses":{"href":"https://api.github.com/repos/xapi-project/xen-api/statuses/804e678597a8258067a5a509d1e30e54497858d0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"minishrink"}}