{"action":"created","comment":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/comments/64639455","id":64639455,"diff_hunk":"@@ -192,6 +190,28 @@ func TestExecuteDeployTransaction(t *testing.T) {\n \tcloseListenerAndSleep(lis)\n }\n \n+// Test deploy of a transaction\n+func TestExecuteDeployTransaction(t *testing.T) {\n+\texecuteDeployTransaction(t, \"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01\")\n+}\n+\n+// Test deploy of a transaction with a GOPATH with multiple elements\n+func TestGopathExecuteDeployTransaction(t *testing.T) {\n+\t// add a trailing slash to GOPATH\n+\t// and a couple of elements - it doesn't matter what they are\n+\tos.Setenv(\"GOPATH\", os.Getenv(\"GOPATH\") + string(os.PathSeparator) + string(os.PathListSeparator) + \"/tmp/foo\" + string(os.PathListSeparator) + \"/tmp/bar\")\n+\tfmt.Printf(\"set GOPATH to: \\\"%s\\\"\\n\", os.Getenv(\"GOPATH\"))\n+\texecuteDeployTransaction(t, \"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01\")\n+}\n+\n+// Test deploy of a transaction with a chaincode over HTTP.\n+func TestHTTPExecuteDeployTransaction(t *testing.T) {\n+\t// The chaincode used here cannot be from the hyperledger repo\n+\t// itself or it won't be downloaded because it will be found\n+\t// in GOPATH, which would defeat the test\n+\texecuteDeployTransaction(t, \"http://github.com/lehors/fabric/examples/chaincode/go/chaincode_example01\")","path":"core/chaincode/exectransaction_test.go","position":41,"original_position":41,"commit_id":"ca864ab35d3416b502aece3596dbbd3185aad863","original_commit_id":"ca864ab35d3416b502aece3596dbbd3185aad863","user":{"login":"lehors","id":6464618,"avatar_url":"https://avatars.githubusercontent.com/u/6464618?v=3","gravatar_id":"","url":"https://api.github.com/users/lehors","html_url":"https://github.com/lehors","followers_url":"https://api.github.com/users/lehors/followers","following_url":"https://api.github.com/users/lehors/following{/other_user}","gists_url":"https://api.github.com/users/lehors/gists{/gist_id}","starred_url":"https://api.github.com/users/lehors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehors/subscriptions","organizations_url":"https://api.github.com/users/lehors/orgs","repos_url":"https://api.github.com/users/lehors/repos","events_url":"https://api.github.com/users/lehors/events{/privacy}","received_events_url":"https://api.github.com/users/lehors/received_events","type":"User","site_admin":false},"body":"I thought about that too but decided to use the latest one because it's the closest to the ideal situation where we could simply use the one from the main repo.\r\nPresumably, if we changed something in the fabric that required the examples to change we would want to use the latest version of the example rather than an old one.","created_at":"2016-05-25T19:40:45Z","updated_at":"2016-05-25T19:40:45Z","html_url":"https://github.com/hyperledger/fabric/pull/1556#discussion_r64639455","pull_request_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1556","_links":{"self":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/comments/64639455"},"html":{"href":"https://github.com/hyperledger/fabric/pull/1556#discussion_r64639455"},"pull_request":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1556"}}},"pull_request":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/1556","id":71118510,"html_url":"https://github.com/hyperledger/fabric/pull/1556","diff_url":"https://github.com/hyperledger/fabric/pull/1556.diff","patch_url":"https://github.com/hyperledger/fabric/pull/1556.patch","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/1556","number":1556,"state":"open","locked":false,"title":"Fix Issue 866 and more","user":{"login":"lehors","id":6464618,"avatar_url":"https://avatars.githubusercontent.com/u/6464618?v=3","gravatar_id":"","url":"https://api.github.com/users/lehors","html_url":"https://github.com/lehors","followers_url":"https://api.github.com/users/lehors/followers","following_url":"https://api.github.com/users/lehors/following{/other_user}","gists_url":"https://api.github.com/users/lehors/gists{/gist_id}","starred_url":"https://api.github.com/users/lehors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehors/subscriptions","organizations_url":"https://api.github.com/users/lehors/orgs","repos_url":"https://api.github.com/users/lehors/repos","events_url":"https://api.github.com/users/lehors/events{/privacy}","received_events_url":"https://api.github.com/users/lehors/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\n<!--- Describe your changes in detail. -->\r\nThis PR cleans up the way GOPATH is handled when deploying a chaincode so that when GOPATH contains multiple elements, double slashes, trailing spaces, etc, deployment can still succeed.\r\nIn case where GOPATH contains several elements only the first one is searched for the chaincode. So the chaincode must be found in the first element of GOPATH for deployment to succeed. The documentation has been updated to warn about this limitation.\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\nFixes #866 as well as several edge cases that can be met when GOPATH contains unusual values.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- If this PR does not contain a new test case, explain why. -->\r\nTwo new unit tests were added:\r\none that sets GOPATH to contain multiple elements and a trailing slash\r\none to test deployment of a chaincode retrieved over HTTP\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I have added a [Signed-off-by](https://github.com/hyperledger/fabric/blob/master/CONTRIBUTING.md#legal-stuff)\r\n- [x] Either no new documentation is required by this change, OR I added new documentation\r\n- [x] Either no new tests are required by this change, OR I added new tests\r\n- [x] I have run [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), and [golint](https://github.com/golang/lint). I have cleaned up all valid errors and warnings in code I have added or modified. These tools may generate false positives. Don't be worried about ignoring some errors or warnings. The goal is clean, consistent, and readable code.\r\n\r\nSigned-off-by: Arnaud J Le Hors <lehors@us.ibm.com>\r\n","created_at":"2016-05-23T20:50:28Z","updated_at":"2016-05-25T19:40:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9dc2c11994e21b98ad15389f88b0ec093bf121fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1556/commits","review_comments_url":"https://api.github.com/repos/hyperledger/fabric/pulls/1556/comments","review_comment_url":"https://api.github.com/repos/hyperledger/fabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/1556/comments","statuses_url":"https://api.github.com/repos/hyperledger/fabric/statuses/ca864ab35d3416b502aece3596dbbd3185aad863","head":{"label":"lehors:issue-866","ref":"issue-866","sha":"ca864ab35d3416b502aece3596dbbd3185aad863","user":{"login":"lehors","id":6464618,"avatar_url":"https://avatars.githubusercontent.com/u/6464618?v=3","gravatar_id":"","url":"https://api.github.com/users/lehors","html_url":"https://github.com/lehors","followers_url":"https://api.github.com/users/lehors/followers","following_url":"https://api.github.com/users/lehors/following{/other_user}","gists_url":"https://api.github.com/users/lehors/gists{/gist_id}","starred_url":"https://api.github.com/users/lehors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehors/subscriptions","organizations_url":"https://api.github.com/users/lehors/orgs","repos_url":"https://api.github.com/users/lehors/repos","events_url":"https://api.github.com/users/lehors/events{/privacy}","received_events_url":"https://api.github.com/users/lehors/received_events","type":"User","site_admin":false},"repo":{"id":55450739,"name":"fabric","full_name":"lehors/fabric","owner":{"login":"lehors","id":6464618,"avatar_url":"https://avatars.githubusercontent.com/u/6464618?v=3","gravatar_id":"","url":"https://api.github.com/users/lehors","html_url":"https://github.com/lehors","followers_url":"https://api.github.com/users/lehors/followers","following_url":"https://api.github.com/users/lehors/following{/other_user}","gists_url":"https://api.github.com/users/lehors/gists{/gist_id}","starred_url":"https://api.github.com/users/lehors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehors/subscriptions","organizations_url":"https://api.github.com/users/lehors/orgs","repos_url":"https://api.github.com/users/lehors/repos","events_url":"https://api.github.com/users/lehors/events{/privacy}","received_events_url":"https://api.github.com/users/lehors/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lehors/fabric","description":"Blockchain fabric incubator code","fork":true,"url":"https://api.github.com/repos/lehors/fabric","forks_url":"https://api.github.com/repos/lehors/fabric/forks","keys_url":"https://api.github.com/repos/lehors/fabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lehors/fabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lehors/fabric/teams","hooks_url":"https://api.github.com/repos/lehors/fabric/hooks","issue_events_url":"https://api.github.com/repos/lehors/fabric/issues/events{/number}","events_url":"https://api.github.com/repos/lehors/fabric/events","assignees_url":"https://api.github.com/repos/lehors/fabric/assignees{/user}","branches_url":"https://api.github.com/repos/lehors/fabric/branches{/branch}","tags_url":"https://api.github.com/repos/lehors/fabric/tags","blobs_url":"https://api.github.com/repos/lehors/fabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lehors/fabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lehors/fabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/lehors/fabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lehors/fabric/statuses/{sha}","languages_url":"https://api.github.com/repos/lehors/fabric/languages","stargazers_url":"https://api.github.com/repos/lehors/fabric/stargazers","contributors_url":"https://api.github.com/repos/lehors/fabric/contributors","subscribers_url":"https://api.github.com/repos/lehors/fabric/subscribers","subscription_url":"https://api.github.com/repos/lehors/fabric/subscription","commits_url":"https://api.github.com/repos/lehors/fabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/lehors/fabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/lehors/fabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/lehors/fabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/lehors/fabric/contents/{+path}","compare_url":"https://api.github.com/repos/lehors/fabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lehors/fabric/merges","archive_url":"https://api.github.com/repos/lehors/fabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lehors/fabric/downloads","issues_url":"https://api.github.com/repos/lehors/fabric/issues{/number}","pulls_url":"https://api.github.com/repos/lehors/fabric/pulls{/number}","milestones_url":"https://api.github.com/repos/lehors/fabric/milestones{/number}","notifications_url":"https://api.github.com/repos/lehors/fabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lehors/fabric/labels{/name}","releases_url":"https://api.github.com/repos/lehors/fabric/releases{/id}","deployments_url":"https://api.github.com/repos/lehors/fabric/deployments","created_at":"2016-04-04T22:44:15Z","updated_at":"2016-04-07T03:39:21Z","pushed_at":"2016-05-25T16:26:06Z","git_url":"git://github.com/lehors/fabric.git","ssh_url":"git@github.com:lehors/fabric.git","clone_url":"https://github.com/lehors/fabric.git","svn_url":"https://github.com/lehors/fabric","homepage":"","size":42000,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hyperledger:master","ref":"master","sha":"b4acc4b87881e3a78b7e1f20de3474adc88a0700","user":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars.githubusercontent.com/u/7657900?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":42975662,"name":"fabric","full_name":"hyperledger/fabric","owner":{"login":"hyperledger","id":7657900,"avatar_url":"https://avatars.githubusercontent.com/u/7657900?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperledger/fabric","description":"Fabric is a blockchain project in Incubation proposed to the community and documented at https://goo.gl/RYQZ5N.  Information on what Incubation entails can be found in the Hyperledger Project Lifecycle document (https://goo.gl/4edNRc)","fork":false,"url":"https://api.github.com/repos/hyperledger/fabric","forks_url":"https://api.github.com/repos/hyperledger/fabric/forks","keys_url":"https://api.github.com/repos/hyperledger/fabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/fabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/fabric/teams","hooks_url":"https://api.github.com/repos/hyperledger/fabric/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/fabric/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/fabric/events","assignees_url":"https://api.github.com/repos/hyperledger/fabric/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/fabric/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/fabric/tags","blobs_url":"https://api.github.com/repos/hyperledger/fabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/fabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/fabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/fabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/fabric/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/fabric/languages","stargazers_url":"https://api.github.com/repos/hyperledger/fabric/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/fabric/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/fabric/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/fabric/subscription","commits_url":"https://api.github.com/repos/hyperledger/fabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/fabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/fabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/fabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/fabric/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/fabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/fabric/merges","archive_url":"https://api.github.com/repos/hyperledger/fabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/fabric/downloads","issues_url":"https://api.github.com/repos/hyperledger/fabric/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/fabric/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/fabric/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/fabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/fabric/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/fabric/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/fabric/deployments","created_at":"2015-09-23T03:17:14Z","updated_at":"2016-05-25T14:27:10Z","pushed_at":"2016-05-25T17:26:10Z","git_url":"git://github.com/hyperledger/fabric.git","ssh_url":"git@github.com:hyperledger/fabric.git","clone_url":"https://github.com/hyperledger/fabric.git","svn_url":"https://github.com/hyperledger/fabric","homepage":"","size":71572,"stargazers_count":699,"watchers_count":699,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":562,"mirror_url":null,"open_issues_count":293,"forks":562,"open_issues":293,"watchers":699,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1556"},"html":{"href":"https://github.com/hyperledger/fabric/pull/1556"},"issue":{"href":"https://api.github.com/repos/hyperledger/fabric/issues/1556"},"comments":{"href":"https://api.github.com/repos/hyperledger/fabric/issues/1556/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1556/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/fabric/pulls/1556/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/fabric/statuses/ca864ab35d3416b502aece3596dbbd3185aad863"}}}}
{"actor":{"display_login":"lehors"}}