{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cordova-lib/pulls/comments/61655336","id":61655336,"diff_hunk":"@@ -17,19 +17,25 @@\n     under the License.\n */\n \n+var fs = require('fs');\n+var os = require('os');\n var path = require('path');\n var rewire = require('rewire');\n+var shell = require('shelljs');\n \n var util = require('../../src/cordova/util');\n var platforms = rewire('../../src/platforms/platforms');\n \n var CORDOVA_ROOT = path.join(__dirname, '../fixtures/projects/platformApi');\n var PLATFORM_WITH_API = path.join(CORDOVA_ROOT, 'platforms/windows');\n var PLATFORM_WOUT_API = path.join(CORDOVA_ROOT, 'platforms/android');\n+var PLATFORM_SYMLINK = path.join(os.tmpdir(), 'cordova_windows_symlink');\n \n-var MockPlatformApi = require(path.join(PLATFORM_WITH_API, 'cordova', 'Api'));\n+var MockPlatformApi = require(fs.realpathSync(path.join(PLATFORM_WITH_API, 'cordova/Api.js')));\n var PlatformApiPoly = require('../../src/platforms/PlatformApiPoly');\n \n+shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);\n+","path":"cordova-lib/spec-cordova/platforms/platforms.spec.js","position":23,"original_position":23,"commit_id":"e2380dc0bb370980311a0001a738654046f36630","original_commit_id":"e2380dc0bb370980311a0001a738654046f36630","user":{"login":"vladimir-kotikov","id":3857604,"avatar_url":"https://avatars.githubusercontent.com/u/3857604?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-kotikov","html_url":"https://github.com/vladimir-kotikov","followers_url":"https://api.github.com/users/vladimir-kotikov/followers","following_url":"https://api.github.com/users/vladimir-kotikov/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-kotikov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-kotikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-kotikov/subscriptions","organizations_url":"https://api.github.com/users/vladimir-kotikov/orgs","repos_url":"https://api.github.com/users/vladimir-kotikov/repos","events_url":"https://api.github.com/users/vladimir-kotikov/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-kotikov/received_events","type":"User","site_admin":false},"body":"I've tested this on both OS X and Windows. Tests are passing in both cases.","created_at":"2016-04-29T22:55:53Z","updated_at":"2016-04-29T22:55:53Z","html_url":"https://github.com/apache/cordova-lib/pull/433#discussion_r61655336","pull_request_url":"https://api.github.com/repos/apache/cordova-lib/pulls/433","_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/comments/61655336"},"html":{"href":"https://github.com/apache/cordova-lib/pull/433#discussion_r61655336"},"pull_request":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/433"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cordova-lib/pulls/433","id":68359504,"html_url":"https://github.com/apache/cordova-lib/pull/433","diff_url":"https://github.com/apache/cordova-lib/pull/433.diff","patch_url":"https://github.com/apache/cordova-lib/pull/433.patch","issue_url":"https://api.github.com/repos/apache/cordova-lib/issues/433","number":433,"state":"open","locked":false,"title":"CB-11174 Resolve symlinked path before getting PlatformApi instance","user":{"login":"vladimir-kotikov","id":3857604,"avatar_url":"https://avatars.githubusercontent.com/u/3857604?v=3","gravatar_id":"","url":"https://api.github.com/users/vladimir-kotikov","html_url":"https://github.com/vladimir-kotikov","followers_url":"https://api.github.com/users/vladimir-kotikov/followers","following_url":"https://api.github.com/users/vladimir-kotikov/following{/other_user}","gists_url":"https://api.github.com/users/vladimir-kotikov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimir-kotikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimir-kotikov/subscriptions","organizations_url":"https://api.github.com/users/vladimir-kotikov/orgs","repos_url":"https://api.github.com/users/vladimir-kotikov/repos","events_url":"https://api.github.com/users/vladimir-kotikov/events{/privacy}","received_events_url":"https://api.github.com/users/vladimir-kotikov/received_events","type":"User","site_admin":false},"body":"This PR the issue when `getPlatformApi` method in cordova-lib returns a different instances for two paths pointing to the same destination, This also fixes 'npm test' failures on OS X.\r\n\r\nSee JIRA [CB-11174](https://issues.apache.org/jira/browse/CB-11174) for background and details.","created_at":"2016-04-29T11:45:24Z","updated_at":"2016-04-29T22:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3bfea1d3f6ddd3411f6f66fcaaf004ca1946540f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cordova-lib/pulls/433/commits","review_comments_url":"https://api.github.com/repos/apache/cordova-lib/pulls/433/comments","review_comment_url":"https://api.github.com/repos/apache/cordova-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cordova-lib/issues/433/comments","statuses_url":"https://api.github.com/repos/apache/cordova-lib/statuses/e2380dc0bb370980311a0001a738654046f36630","head":{"label":"MSOpenTech:CB-11174","ref":"CB-11174","sha":"e2380dc0bb370980311a0001a738654046f36630","user":{"login":"MSOpenTech","id":1638184,"avatar_url":"https://avatars.githubusercontent.com/u/1638184?v=3","gravatar_id":"","url":"https://api.github.com/users/MSOpenTech","html_url":"https://github.com/MSOpenTech","followers_url":"https://api.github.com/users/MSOpenTech/followers","following_url":"https://api.github.com/users/MSOpenTech/following{/other_user}","gists_url":"https://api.github.com/users/MSOpenTech/gists{/gist_id}","starred_url":"https://api.github.com/users/MSOpenTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSOpenTech/subscriptions","organizations_url":"https://api.github.com/users/MSOpenTech/orgs","repos_url":"https://api.github.com/users/MSOpenTech/repos","events_url":"https://api.github.com/users/MSOpenTech/events{/privacy}","received_events_url":"https://api.github.com/users/MSOpenTech/received_events","type":"Organization","site_admin":false},"repo":{"id":19624574,"name":"cordova-lib","full_name":"MSOpenTech/cordova-lib","owner":{"login":"MSOpenTech","id":1638184,"avatar_url":"https://avatars.githubusercontent.com/u/1638184?v=3","gravatar_id":"","url":"https://api.github.com/users/MSOpenTech","html_url":"https://github.com/MSOpenTech","followers_url":"https://api.github.com/users/MSOpenTech/followers","following_url":"https://api.github.com/users/MSOpenTech/following{/other_user}","gists_url":"https://api.github.com/users/MSOpenTech/gists{/gist_id}","starred_url":"https://api.github.com/users/MSOpenTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSOpenTech/subscriptions","organizations_url":"https://api.github.com/users/MSOpenTech/orgs","repos_url":"https://api.github.com/users/MSOpenTech/repos","events_url":"https://api.github.com/users/MSOpenTech/events{/privacy}","received_events_url":"https://api.github.com/users/MSOpenTech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MSOpenTech/cordova-lib","description":"Mirror of Apache Cordova","fork":true,"url":"https://api.github.com/repos/MSOpenTech/cordova-lib","forks_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/forks","keys_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/teams","hooks_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/hooks","issue_events_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/issues/events{/number}","events_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/events","assignees_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/assignees{/user}","branches_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/branches{/branch}","tags_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/tags","blobs_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/languages","stargazers_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/stargazers","contributors_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/contributors","subscribers_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/subscribers","subscription_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/subscription","commits_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/contents/{+path}","compare_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/merges","archive_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/downloads","issues_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/issues{/number}","pulls_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/labels{/name}","releases_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/releases{/id}","deployments_url":"https://api.github.com/repos/MSOpenTech/cordova-lib/deployments","created_at":"2014-05-09T20:30:32Z","updated_at":"2016-04-27T03:43:10Z","pushed_at":"2016-04-29T11:39:24Z","git_url":"git://github.com/MSOpenTech/cordova-lib.git","ssh_url":"git@github.com:MSOpenTech/cordova-lib.git","clone_url":"https://github.com/MSOpenTech/cordova-lib.git","svn_url":"https://github.com/MSOpenTech/cordova-lib","homepage":null,"size":44273,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"5867657d989b136702fe2f14172661ca489573ed","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":19524397,"name":"cordova-lib","full_name":"apache/cordova-lib","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cordova-lib","description":"Mirror of Apache Cordova","fork":false,"url":"https://api.github.com/repos/apache/cordova-lib","forks_url":"https://api.github.com/repos/apache/cordova-lib/forks","keys_url":"https://api.github.com/repos/apache/cordova-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cordova-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cordova-lib/teams","hooks_url":"https://api.github.com/repos/apache/cordova-lib/hooks","issue_events_url":"https://api.github.com/repos/apache/cordova-lib/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cordova-lib/events","assignees_url":"https://api.github.com/repos/apache/cordova-lib/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cordova-lib/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cordova-lib/tags","blobs_url":"https://api.github.com/repos/apache/cordova-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cordova-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cordova-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cordova-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cordova-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cordova-lib/languages","stargazers_url":"https://api.github.com/repos/apache/cordova-lib/stargazers","contributors_url":"https://api.github.com/repos/apache/cordova-lib/contributors","subscribers_url":"https://api.github.com/repos/apache/cordova-lib/subscribers","subscription_url":"https://api.github.com/repos/apache/cordova-lib/subscription","commits_url":"https://api.github.com/repos/apache/cordova-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cordova-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cordova-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cordova-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cordova-lib/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cordova-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cordova-lib/merges","archive_url":"https://api.github.com/repos/apache/cordova-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cordova-lib/downloads","issues_url":"https://api.github.com/repos/apache/cordova-lib/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cordova-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cordova-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cordova-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cordova-lib/labels{/name}","releases_url":"https://api.github.com/repos/apache/cordova-lib/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cordova-lib/deployments","created_at":"2014-05-07T07:00:06Z","updated_at":"2016-04-26T14:49:09Z","pushed_at":"2016-04-29T11:45:25Z","git_url":"git://github.com/apache/cordova-lib.git","ssh_url":"git@github.com:apache/cordova-lib.git","clone_url":"https://github.com/apache/cordova-lib.git","svn_url":"https://github.com/apache/cordova-lib","homepage":null,"size":46850,"stargazers_count":126,"watchers_count":126,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":194,"mirror_url":"git://git.apache.org/cordova-lib.git","open_issues_count":19,"forks":194,"open_issues":19,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/433"},"html":{"href":"https://github.com/apache/cordova-lib/pull/433"},"issue":{"href":"https://api.github.com/repos/apache/cordova-lib/issues/433"},"comments":{"href":"https://api.github.com/repos/apache/cordova-lib/issues/433/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/433/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cordova-lib/pulls/433/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cordova-lib/statuses/e2380dc0bb370980311a0001a738654046f36630"}}}}