{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/loci/pulls/comments/70133263","id":70133263,"diff_hunk":"@@ -0,0 +1,88 @@\n+\"use strict\";\n+\n+const {WorkerTask, TASK_NEW, TASK_WORKING, TASK_DONE} = require(\"lib/task-queue/WorkerTask\");\n+const {Storage} = require(\"lib/task-queue/Storage\");\n+\n+const taskOptions = {\n+  pageUrl: \"https://foo.bar\",\n+  type: \"fts\",\n+};\n+\n+exports[\"test Task status setting\"] = function(assert, done) {\n+  let task = new WorkerTask(taskOptions.pageUrl, taskOptions.type);\n+  assert.equal(task.status, TASK_NEW, \"Task created with new status\");\n+  task.status = TASK_WORKING;\n+  assert.equal(task.status, TASK_WORKING, \"Task status changed\");\n+  task.status = TASK_DONE;\n+  assert.equal(task.status, TASK_DONE, \"Task status changed\");\n+  done();\n+};\n+\n+exports[\"test Task invalid status setting throws\"] = function(assert, done) {\n+  let task = new WorkerTask(taskOptions.pageUrl, taskOptions.type);\n+  assert.throws(()=> task.status = \"not a valid status\", /Invalid task status/, \"Invalid task status throws.\");\n+  done();\n+};\n+\n+exports[\"test Task job started\"] = function(assert, done) {\n+  let task = new WorkerTask(taskOptions.pageUrl, taskOptions.type);\n+  assert.equal(task.jobStartedAt, null, \"New task job started time is null.\");\n+  assert.equal(task.status, TASK_NEW, \"Task created with new status\");\n+  task.jobStarted();\n+  assert.ok(()=> task.jobStartedAt <= Date.now() && task.jobStartedAt > task.createdAt,\n+            \"Task job started time assigned.\");\n+  assert.equal(task.status, TASK_WORKING, \"Task status is now working.\");\n+  done();\n+};\n+\n+exports[\"test Task serialization and deserialization\"] = function(assert, done) {","path":"test/test-WorkerTask.js","position":38,"original_position":38,"commit_id":"1eecec18cdb34bec0e1a70527c79932b596d35ac","original_commit_id":"1eecec18cdb34bec0e1a70527c79932b596d35ac","user":{"login":"oyiptong","id":9365,"avatar_url":"https://avatars.githubusercontent.com/u/9365?v=3","gravatar_id":"","url":"https://api.github.com/users/oyiptong","html_url":"https://github.com/oyiptong","followers_url":"https://api.github.com/users/oyiptong/followers","following_url":"https://api.github.com/users/oyiptong/following{/other_user}","gists_url":"https://api.github.com/users/oyiptong/gists{/gist_id}","starred_url":"https://api.github.com/users/oyiptong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyiptong/subscriptions","organizations_url":"https://api.github.com/users/oyiptong/orgs","repos_url":"https://api.github.com/users/oyiptong/repos","events_url":"https://api.github.com/users/oyiptong/events{/privacy}","received_events_url":"https://api.github.com/users/oyiptong/received_events","type":"User","site_admin":false},"body":"no need for `done`","created_at":"2016-07-08T20:07:35Z","updated_at":"2016-07-08T20:07:35Z","html_url":"https://github.com/mozilla/loci/pull/15#discussion_r70133263","pull_request_url":"https://api.github.com/repos/mozilla/loci/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/mozilla/loci/pulls/comments/70133263"},"html":{"href":"https://github.com/mozilla/loci/pull/15#discussion_r70133263"},"pull_request":{"href":"https://api.github.com/repos/mozilla/loci/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/loci/pulls/15","id":76668004,"html_url":"https://github.com/mozilla/loci/pull/15","diff_url":"https://github.com/mozilla/loci/pull/15.diff","patch_url":"https://github.com/mozilla/loci/pull/15.patch","issue_url":"https://api.github.com/repos/mozilla/loci/issues/15","number":15,"state":"open","locked":false,"title":"feat(workers): #7 Task object database","user":{"login":"rittme","id":201125,"avatar_url":"https://avatars.githubusercontent.com/u/201125?v=3","gravatar_id":"","url":"https://api.github.com/users/rittme","html_url":"https://github.com/rittme","followers_url":"https://api.github.com/users/rittme/followers","following_url":"https://api.github.com/users/rittme/following{/other_user}","gists_url":"https://api.github.com/users/rittme/gists{/gist_id}","starred_url":"https://api.github.com/users/rittme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rittme/subscriptions","organizations_url":"https://api.github.com/users/rittme/orgs","repos_url":"https://api.github.com/users/rittme/repos","events_url":"https://api.github.com/users/rittme/events{/privacy}","received_events_url":"https://api.github.com/users/rittme/received_events","type":"User","site_admin":false},"body":"Fixes #7 ","created_at":"2016-07-07T21:25:54Z","updated_at":"2016-07-08T20:07:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4612828c809cc824a8e7dae3e9c2b1c7fb88e3e4","assignee":{"login":"oyiptong","id":9365,"avatar_url":"https://avatars.githubusercontent.com/u/9365?v=3","gravatar_id":"","url":"https://api.github.com/users/oyiptong","html_url":"https://github.com/oyiptong","followers_url":"https://api.github.com/users/oyiptong/followers","following_url":"https://api.github.com/users/oyiptong/following{/other_user}","gists_url":"https://api.github.com/users/oyiptong/gists{/gist_id}","starred_url":"https://api.github.com/users/oyiptong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyiptong/subscriptions","organizations_url":"https://api.github.com/users/oyiptong/orgs","repos_url":"https://api.github.com/users/oyiptong/repos","events_url":"https://api.github.com/users/oyiptong/events{/privacy}","received_events_url":"https://api.github.com/users/oyiptong/received_events","type":"User","site_admin":false},"assignees":[{"login":"oyiptong","id":9365,"avatar_url":"https://avatars.githubusercontent.com/u/9365?v=3","gravatar_id":"","url":"https://api.github.com/users/oyiptong","html_url":"https://github.com/oyiptong","followers_url":"https://api.github.com/users/oyiptong/followers","following_url":"https://api.github.com/users/oyiptong/following{/other_user}","gists_url":"https://api.github.com/users/oyiptong/gists{/gist_id}","starred_url":"https://api.github.com/users/oyiptong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyiptong/subscriptions","organizations_url":"https://api.github.com/users/oyiptong/orgs","repos_url":"https://api.github.com/users/oyiptong/repos","events_url":"https://api.github.com/users/oyiptong/events{/privacy}","received_events_url":"https://api.github.com/users/oyiptong/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/loci/pulls/15/commits","review_comments_url":"https://api.github.com/repos/mozilla/loci/pulls/15/comments","review_comment_url":"https://api.github.com/repos/mozilla/loci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/loci/issues/15/comments","statuses_url":"https://api.github.com/repos/mozilla/loci/statuses/1eecec18cdb34bec0e1a70527c79932b596d35ac","head":{"label":"rittme:task","ref":"task","sha":"1eecec18cdb34bec0e1a70527c79932b596d35ac","user":{"login":"rittme","id":201125,"avatar_url":"https://avatars.githubusercontent.com/u/201125?v=3","gravatar_id":"","url":"https://api.github.com/users/rittme","html_url":"https://github.com/rittme","followers_url":"https://api.github.com/users/rittme/followers","following_url":"https://api.github.com/users/rittme/following{/other_user}","gists_url":"https://api.github.com/users/rittme/gists{/gist_id}","starred_url":"https://api.github.com/users/rittme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rittme/subscriptions","organizations_url":"https://api.github.com/users/rittme/orgs","repos_url":"https://api.github.com/users/rittme/repos","events_url":"https://api.github.com/users/rittme/events{/privacy}","received_events_url":"https://api.github.com/users/rittme/received_events","type":"User","site_admin":false},"repo":{"id":60561235,"name":"loci","full_name":"rittme/loci","owner":{"login":"rittme","id":201125,"avatar_url":"https://avatars.githubusercontent.com/u/201125?v=3","gravatar_id":"","url":"https://api.github.com/users/rittme","html_url":"https://github.com/rittme","followers_url":"https://api.github.com/users/rittme/followers","following_url":"https://api.github.com/users/rittme/following{/other_user}","gists_url":"https://api.github.com/users/rittme/gists{/gist_id}","starred_url":"https://api.github.com/users/rittme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rittme/subscriptions","organizations_url":"https://api.github.com/users/rittme/orgs","repos_url":"https://api.github.com/users/rittme/repos","events_url":"https://api.github.com/users/rittme/events{/privacy}","received_events_url":"https://api.github.com/users/rittme/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rittme/loci","description":"","fork":true,"url":"https://api.github.com/repos/rittme/loci","forks_url":"https://api.github.com/repos/rittme/loci/forks","keys_url":"https://api.github.com/repos/rittme/loci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rittme/loci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rittme/loci/teams","hooks_url":"https://api.github.com/repos/rittme/loci/hooks","issue_events_url":"https://api.github.com/repos/rittme/loci/issues/events{/number}","events_url":"https://api.github.com/repos/rittme/loci/events","assignees_url":"https://api.github.com/repos/rittme/loci/assignees{/user}","branches_url":"https://api.github.com/repos/rittme/loci/branches{/branch}","tags_url":"https://api.github.com/repos/rittme/loci/tags","blobs_url":"https://api.github.com/repos/rittme/loci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rittme/loci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rittme/loci/git/refs{/sha}","trees_url":"https://api.github.com/repos/rittme/loci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rittme/loci/statuses/{sha}","languages_url":"https://api.github.com/repos/rittme/loci/languages","stargazers_url":"https://api.github.com/repos/rittme/loci/stargazers","contributors_url":"https://api.github.com/repos/rittme/loci/contributors","subscribers_url":"https://api.github.com/repos/rittme/loci/subscribers","subscription_url":"https://api.github.com/repos/rittme/loci/subscription","commits_url":"https://api.github.com/repos/rittme/loci/commits{/sha}","git_commits_url":"https://api.github.com/repos/rittme/loci/git/commits{/sha}","comments_url":"https://api.github.com/repos/rittme/loci/comments{/number}","issue_comment_url":"https://api.github.com/repos/rittme/loci/issues/comments{/number}","contents_url":"https://api.github.com/repos/rittme/loci/contents/{+path}","compare_url":"https://api.github.com/repos/rittme/loci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rittme/loci/merges","archive_url":"https://api.github.com/repos/rittme/loci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rittme/loci/downloads","issues_url":"https://api.github.com/repos/rittme/loci/issues{/number}","pulls_url":"https://api.github.com/repos/rittme/loci/pulls{/number}","milestones_url":"https://api.github.com/repos/rittme/loci/milestones{/number}","notifications_url":"https://api.github.com/repos/rittme/loci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rittme/loci/labels{/name}","releases_url":"https://api.github.com/repos/rittme/loci/releases{/id}","deployments_url":"https://api.github.com/repos/rittme/loci/deployments","created_at":"2016-06-06T21:13:11Z","updated_at":"2016-06-06T21:13:12Z","pushed_at":"2016-07-07T21:52:49Z","git_url":"git://github.com/rittme/loci.git","ssh_url":"git@github.com:rittme/loci.git","clone_url":"https://github.com/rittme/loci.git","svn_url":"https://github.com/rittme/loci","homepage":null,"size":93,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mozilla:master","ref":"master","sha":"3ea04756ab38118550191db663586a10e8e215d0","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","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":60561108,"name":"loci","full_name":"mozilla/loci","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","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/loci","description":"An experimental addon that enriches the data about places in Firefox","fork":false,"url":"https://api.github.com/repos/mozilla/loci","forks_url":"https://api.github.com/repos/mozilla/loci/forks","keys_url":"https://api.github.com/repos/mozilla/loci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/loci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/loci/teams","hooks_url":"https://api.github.com/repos/mozilla/loci/hooks","issue_events_url":"https://api.github.com/repos/mozilla/loci/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/loci/events","assignees_url":"https://api.github.com/repos/mozilla/loci/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/loci/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/loci/tags","blobs_url":"https://api.github.com/repos/mozilla/loci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/loci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/loci/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/loci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/loci/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/loci/languages","stargazers_url":"https://api.github.com/repos/mozilla/loci/stargazers","contributors_url":"https://api.github.com/repos/mozilla/loci/contributors","subscribers_url":"https://api.github.com/repos/mozilla/loci/subscribers","subscription_url":"https://api.github.com/repos/mozilla/loci/subscription","commits_url":"https://api.github.com/repos/mozilla/loci/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/loci/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/loci/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/loci/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/loci/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/loci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/loci/merges","archive_url":"https://api.github.com/repos/mozilla/loci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/loci/downloads","issues_url":"https://api.github.com/repos/mozilla/loci/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/loci/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/loci/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/loci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/loci/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/loci/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/loci/deployments","created_at":"2016-06-06T21:10:36Z","updated_at":"2016-06-07T02:41:18Z","pushed_at":"2016-07-07T21:52:45Z","git_url":"git://github.com/mozilla/loci.git","ssh_url":"git@github.com:mozilla/loci.git","clone_url":"https://github.com/mozilla/loci.git","svn_url":"https://github.com/mozilla/loci","homepage":"","size":113,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/loci/pulls/15"},"html":{"href":"https://github.com/mozilla/loci/pull/15"},"issue":{"href":"https://api.github.com/repos/mozilla/loci/issues/15"},"comments":{"href":"https://api.github.com/repos/mozilla/loci/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/loci/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/loci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/loci/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/loci/statuses/1eecec18cdb34bec0e1a70527c79932b596d35ac"}}}}
{"actor":{"display_login":"oyiptong"}}