GitHub PullRequestEvent at 2014-08-06 02:18:29
Repository: galaxy-api
Actor: cvan
Payload: {"action":"closed","number":185,"pull_request":{"url":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185","id":14621193,"html_url":"https://github.com/mozilla/galaxy-api/pull/185","diff_url":"https://github.com/mozilla/galaxy-api/pull/185.diff","patch_url":"https://github.com/mozilla/galaxy-api/pull/185.patch","issue_url":"https://api.github.com/repos/mozilla/galaxy-api/issues/185","number":185,"state":"closed","title":"Added test runner (Fixes #177)","user":{"login":"soedar","id":571891,"avatar_url":"https://avatars.githubusercontent.com/u/571891?v=2","gravatar_id":"8c5a1bf958ec4bbdfafc8a2fb4614b75","url":"https://api.github.com/users/soedar","html_url":"https://github.com/soedar","followers_url":"https://api.github.com/users/soedar/followers","following_url":"https://api.github.com/users/soedar/following{/other_user}","gists_url":"https://api.github.com/users/soedar/gists{/gist_id}","starred_url":"https://api.github.com/users/soedar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soedar/subscriptions","organizations_url":"https://api.github.com/users/soedar/orgs","repos_url":"https://api.github.com/users/soedar/repos","events_url":"https://api.github.com/users/soedar/events{/privacy}","received_events_url":"https://api.github.com/users/soedar/received_events","type":"User","site_admin":false},"body":"I've implemented a simple test runner that we can use to run our tests. The test runner can spawn 'servers', and will also run the tests in order (which is good, because I'd imagine that later tests depend on earlier tests being correct). The test runner now looks at `settings_test.js` file, and will attempt to launch the server at the port that is listed in the settings file. \r\n\r\nYou can specify the servers that you wish to spawn before running any of the tests, but really, 'servers' are simply child processes spawned by the test runner. Note that servers should be polling, and not terminate for the lifetime of the runner script. If a server arbitrarily terminates, the test runner will fail. ed arbitrarily (else the whole test will fail). This is not an issue for server processes - the current test runner spawns `redis-server` as well as `persona-faker`. The `test/runner.js` file is really quite simple, but do let me know if theres anything that is unclear there.\r\n\r\nAn implication of a polling server is that when we launched the process, it is difficult to know whether the server has launched successfully or not. I've opted to use a simple timeout - if the server did not terminate within `DEFAULT_SERVER_LAUNCH_TIMEOUT` ms (which defaults to 1s), it is considered 'alive'. If the server dies after the launch timeout, an error will be thrown and we will try and terminate the all existing launched processes.\r\n\r\nFor now, I have not exposed the server function in `test_lib` file, which would allow the launching of any processes. I think it's cleaner that we expose server specific functions; but if anyone think otherwise, it's easy to just expose it.\r\n\r\nOne last thing: because test_lib spawns and kill child processes, it is easy to run into orphaned processes when you modify the code in that file. Do take caution and note that any programming mistake within the file itself might lead to orphaned processes. Just `ps` and `kill` when you run into any problems.\r\n\r\nr? @cvan @at-kevinlau @aricha","created_at":"2014-04-10T19:15:59Z","updated_at":"2014-08-06T02:18:28Z","closed_at":"2014-08-06T02:18:28Z","merged_at":null,"merge_commit_sha":"0d26b2d22726d54fe0f018a853faf49f6dc04fba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185/commits","review_comments_url":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185/comments","review_comment_url":"https://api.github.com/repos/mozilla/galaxy-api/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/galaxy-api/issues/185/comments","statuses_url":"https://api.github.com/repos/mozilla/galaxy-api/statuses/b7359f43c7ea95afc9cdf51feea40098000c483b","head":{"label":"soedar:spawn-redis","ref":"spawn-redis","sha":"b7359f43c7ea95afc9cdf51feea40098000c483b","user":{"login":"soedar","id":571891,"avatar_url":"https://avatars.githubusercontent.com/u/571891?v=2","gravatar_id":"8c5a1bf958ec4bbdfafc8a2fb4614b75","url":"https://api.github.com/users/soedar","html_url":"https://github.com/soedar","followers_url":"https://api.github.com/users/soedar/followers","following_url":"https://api.github.com/users/soedar/following{/other_user}","gists_url":"https://api.github.com/users/soedar/gists{/gist_id}","starred_url":"https://api.github.com/users/soedar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soedar/subscriptions","organizations_url":"https://api.github.com/users/soedar/orgs","repos_url":"https://api.github.com/users/soedar/repos","events_url":"https://api.github.com/users/soedar/events{/privacy}","received_events_url":"https://api.github.com/users/soedar/received_events","type":"User","site_admin":false},"repo":{"id":16145736,"name":"galaxy-api","full_name":"soedar/galaxy-api","owner":{"login":"soedar","id":571891,"avatar_url":"https://avatars.githubusercontent.com/u/571891?v=2","gravatar_id":"8c5a1bf958ec4bbdfafc8a2fb4614b75","url":"https://api.github.com/users/soedar","html_url":"https://github.com/soedar","followers_url":"https://api.github.com/users/soedar/followers","following_url":"https://api.github.com/users/soedar/following{/other_user}","gists_url":"https://api.github.com/users/soedar/gists{/gist_id}","starred_url":"https://api.github.com/users/soedar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soedar/subscriptions","organizations_url":"https://api.github.com/users/soedar/orgs","repos_url":"https://api.github.com/users/soedar/repos","events_url":"https://api.github.com/users/soedar/events{/privacy}","received_events_url":"https://api.github.com/users/soedar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soedar/galaxy-api","description":"To infinity and beyond. The backend API.","fork":true,"url":"https://api.github.com/repos/soedar/galaxy-api","forks_url":"https://api.github.com/repos/soedar/galaxy-api/forks","keys_url":"https://api.github.com/repos/soedar/galaxy-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soedar/galaxy-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soedar/galaxy-api/teams","hooks_url":"https://api.github.com/repos/soedar/galaxy-api/hooks","issue_events_url":"https://api.github.com/repos/soedar/galaxy-api/issues/events{/number}","events_url":"https://api.github.com/repos/soedar/galaxy-api/events","assignees_url":"https://api.github.com/repos/soedar/galaxy-api/assignees{/user}","branches_url":"https://api.github.com/repos/soedar/galaxy-api/branches{/branch}","tags_url":"https://api.github.com/repos/soedar/galaxy-api/tags","blobs_url":"https://api.github.com/repos/soedar/galaxy-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soedar/galaxy-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soedar/galaxy-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/soedar/galaxy-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soedar/galaxy-api/statuses/{sha}","languages_url":"https://api.github.com/repos/soedar/galaxy-api/languages","stargazers_url":"https://api.github.com/repos/soedar/galaxy-api/stargazers","contributors_url":"https://api.github.com/repos/soedar/galaxy-api/contributors","subscribers_url":"https://api.github.com/repos/soedar/galaxy-api/subscribers","subscription_url":"https://api.github.com/repos/soedar/galaxy-api/subscription","commits_url":"https://api.github.com/repos/soedar/galaxy-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/soedar/galaxy-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/soedar/galaxy-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/soedar/galaxy-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/soedar/galaxy-api/contents/{+path}","compare_url":"https://api.github.com/repos/soedar/galaxy-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soedar/galaxy-api/merges","archive_url":"https://api.github.com/repos/soedar/galaxy-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soedar/galaxy-api/downloads","issues_url":"https://api.github.com/repos/soedar/galaxy-api/issues{/number}","pulls_url":"https://api.github.com/repos/soedar/galaxy-api/pulls{/number}","milestones_url":"https://api.github.com/repos/soedar/galaxy-api/milestones{/number}","notifications_url":"https://api.github.com/repos/soedar/galaxy-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soedar/galaxy-api/labels{/name}","releases_url":"https://api.github.com/repos/soedar/galaxy-api/releases{/id}","created_at":"2014-01-22T17:01:03Z","updated_at":"2014-07-22T20:21:37Z","pushed_at":"2014-04-24T08:33:06Z","git_url":"git://github.com/soedar/galaxy-api.git","ssh_url":"git@github.com:soedar/galaxy-api.git","clone_url":"https://github.com/soedar/galaxy-api.git","svn_url":"https://github.com/soedar/galaxy-api","homepage":"","size":1056,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"d076ba905a1b4f0cfad3e2ff33dbf50e7d27295d","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":15179138,"name":"galaxy-api","full_name":"mozilla/galaxy-api","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/galaxy-api","description":"To infinity and beyond. The backend API.","fork":false,"url":"https://api.github.com/repos/mozilla/galaxy-api","forks_url":"https://api.github.com/repos/mozilla/galaxy-api/forks","keys_url":"https://api.github.com/repos/mozilla/galaxy-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/galaxy-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/galaxy-api/teams","hooks_url":"https://api.github.com/repos/mozilla/galaxy-api/hooks","issue_events_url":"https://api.github.com/repos/mozilla/galaxy-api/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/galaxy-api/events","assignees_url":"https://api.github.com/repos/mozilla/galaxy-api/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/galaxy-api/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/galaxy-api/tags","blobs_url":"https://api.github.com/repos/mozilla/galaxy-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/galaxy-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/galaxy-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/galaxy-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/galaxy-api/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/galaxy-api/languages","stargazers_url":"https://api.github.com/repos/mozilla/galaxy-api/stargazers","contributors_url":"https://api.github.com/repos/mozilla/galaxy-api/contributors","subscribers_url":"https://api.github.com/repos/mozilla/galaxy-api/subscribers","subscription_url":"https://api.github.com/repos/mozilla/galaxy-api/subscription","commits_url":"https://api.github.com/repos/mozilla/galaxy-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/galaxy-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/galaxy-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/galaxy-api/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/galaxy-api/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/galaxy-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/galaxy-api/merges","archive_url":"https://api.github.com/repos/mozilla/galaxy-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/galaxy-api/downloads","issues_url":"https://api.github.com/repos/mozilla/galaxy-api/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/galaxy-api/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/galaxy-api/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/galaxy-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/galaxy-api/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/galaxy-api/releases{/id}","created_at":"2013-12-14T03:07:35Z","updated_at":"2014-07-31T22:29:26Z","pushed_at":"2014-08-06T02:18:20Z","git_url":"git://github.com/mozilla/galaxy-api.git","ssh_url":"git@github.com:mozilla/galaxy-api.git","clone_url":"https://github.com/mozilla/galaxy-api.git","svn_url":"https://github.com/mozilla/galaxy-api","homepage":"http://docs.galaxy.apiary.io/","size":4704,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":11,"mirror_url":null,"open_issues_count":79,"forks":11,"open_issues":79,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185"},"html":{"href":"https://github.com/mozilla/galaxy-api/pull/185"},"issue":{"href":"https://api.github.com/repos/mozilla/galaxy-api/issues/185"},"comments":{"href":"https://api.github.com/repos/mozilla/galaxy-api/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/galaxy-api/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/galaxy-api/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/galaxy-api/statuses/b7359f43c7ea95afc9cdf51feea40098000c483b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":4,"review_comments":16,"commits":3,"additions":174,"deletions":18,"changed_files":7}}