{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/echidna/pulls/comments/24047580","id":24047580,"diff_hunk":"@@ -0,0 +1,193 @@\n+\n+/**\n+ * Behaviour of the Echidna testbed.\n+ *\n+ * @author Antonio <antonio@w3.org>\n+ */\n+\n+'use strict';\n+\n+var JOBS = ['retrieve-resources', 'specberus', 'token-checker', 'third-party-checker', 'publish', 'tr-install', 'update-tr-shortlink'];\n+\n+var log;\n+var inspector;\n+var allSpecs = [];\n+var allJobs = {};\n+var allMessages = {};\n+\n+function logMessage(message) {\n+\n+    log = log || $('pre#console');\n+    log.append(new Date().toLocaleTimeString() + '  ' + message + '\\n');\n+\n+}\n+\n+function dumpObject(obj) {\n+\n+    inspector = inspector || $('pre#inspector');\n+\n+    if (!obj) {\n+        inspector.text('');\n+    }\n+    else {\n+        inspector.text(JSON.stringify(obj, null, 2));\n+    }","path":"test/views/behaviour.js","position":34,"original_position":34,"commit_id":"79bb8aa85072b307fec0bbccf2f20fd2955034a9","original_commit_id":"57957b8edfb68cb66078bf07ff2991161e0b09e9","user":{"login":"astorije","id":113730,"avatar_url":"https://avatars.githubusercontent.com/u/113730?v=3","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"body":"Douglas Crockford recommends that when there is more that one line, for reasons that the JS interpreter isn't always nice when you don't.\r\n\r\nAnd no, I don't think it's harder to read. Actually, I think it's way easier to read when the `if` condition is short (aka when condition + execution < 80 chars). I prefer that billion times over scrolling all over the place when reading a file. Here, the function is **14 lines** when it could be half! Come on...","created_at":"2015-02-03T22:45:01Z","updated_at":"2015-02-03T22:45:01Z","html_url":"https://github.com/w3c/echidna/pull/56#discussion_r24047580","pull_request_url":"https://api.github.com/repos/w3c/echidna/pulls/56","_links":{"self":{"href":"https://api.github.com/repos/w3c/echidna/pulls/comments/24047580"},"html":{"href":"https://github.com/w3c/echidna/pull/56#discussion_r24047580"},"pull_request":{"href":"https://api.github.com/repos/w3c/echidna/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/w3c/echidna/pulls/56","id":28456614,"html_url":"https://github.com/w3c/echidna/pull/56","diff_url":"https://github.com/w3c/echidna/pull/56.diff","patch_url":"https://github.com/w3c/echidna/pull/56.patch","issue_url":"https://api.github.com/repos/w3c/echidna/issues/56","number":56,"state":"open","locked":false,"title":"Add a web-based testbed that automatically submits a batch of publications to Echidna and monitors results","user":{"login":"tripu","id":1016538,"avatar_url":"https://avatars.githubusercontent.com/u/1016538?v=3","gravatar_id":"","url":"https://api.github.com/users/tripu","html_url":"https://github.com/tripu","followers_url":"https://api.github.com/users/tripu/followers","following_url":"https://api.github.com/users/tripu/following{/other_user}","gists_url":"https://api.github.com/users/tripu/gists{/gist_id}","starred_url":"https://api.github.com/users/tripu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tripu/subscriptions","organizations_url":"https://api.github.com/users/tripu/orgs","repos_url":"https://api.github.com/users/tripu/repos","events_url":"https://api.github.com/users/tripu/events{/privacy}","received_events_url":"https://api.github.com/users/tripu/received_events","type":"User","site_admin":false},"body":"Change `http://localhost:3001/` to make it a better tool for automated testing of the system.\r\n\r\nThe testbed lists all specs and some metadata about them. A rudimentary *console* and a simple *inspector* allow the user to track progress of submitted specs. A *settings* sections at the top of the page makes it possible to easily test instances of Echidna deployed in different hosts/ports. Specs can be examined one by one; their contents, metadata, and errors thrown at each stage of the publication process.\r\n\r\nIn addition to that:\r\n* Load specs and their metadata asynchronously from a new JSON file (prerrequisite to better handle those test cases, their metadata and publication results form the test page).\r\n* Add CORS support, to be able to restrict usage of the Echidna API to an approved set of clients; new configuration variable `ALLOWED_CLIENTS` used for this.\r\n* Better handle errors when starting the servers (both Echidna and test server); specifically, RTEs when the port is already in use.\r\n* Use jQuery for DOM manipulation and AJAJ.\r\n* Start using JS' *strict mode* in a few more files.\r\n* Update test assertions to adapt to the contents of the new dynamic test page.\r\n* Update the documentation accordingly.","created_at":"2015-02-02T10:09:15Z","updated_at":"2015-02-03T22:45:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f272538a2bd44e6a4b0d0135b5db2014dc4de7c","assignee":{"login":"plehegar","id":1490400,"avatar_url":"https://avatars.githubusercontent.com/u/1490400?v=3","gravatar_id":"","url":"https://api.github.com/users/plehegar","html_url":"https://github.com/plehegar","followers_url":"https://api.github.com/users/plehegar/followers","following_url":"https://api.github.com/users/plehegar/following{/other_user}","gists_url":"https://api.github.com/users/plehegar/gists{/gist_id}","starred_url":"https://api.github.com/users/plehegar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plehegar/subscriptions","organizations_url":"https://api.github.com/users/plehegar/orgs","repos_url":"https://api.github.com/users/plehegar/repos","events_url":"https://api.github.com/users/plehegar/events{/privacy}","received_events_url":"https://api.github.com/users/plehegar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/w3c/echidna/milestones/1","labels_url":"https://api.github.com/repos/w3c/echidna/milestones/1/labels","id":934685,"number":1,"title":"v1","description":"","creator":{"login":"dontcallmedom","id":216410,"avatar_url":"https://avatars.githubusercontent.com/u/216410?v=3","gravatar_id":"","url":"https://api.github.com/users/dontcallmedom","html_url":"https://github.com/dontcallmedom","followers_url":"https://api.github.com/users/dontcallmedom/followers","following_url":"https://api.github.com/users/dontcallmedom/following{/other_user}","gists_url":"https://api.github.com/users/dontcallmedom/gists{/gist_id}","starred_url":"https://api.github.com/users/dontcallmedom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dontcallmedom/subscriptions","organizations_url":"https://api.github.com/users/dontcallmedom/orgs","repos_url":"https://api.github.com/users/dontcallmedom/repos","events_url":"https://api.github.com/users/dontcallmedom/events{/privacy}","received_events_url":"https://api.github.com/users/dontcallmedom/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":8,"state":"open","created_at":"2015-01-14T07:37:23Z","updated_at":"2015-02-03T20:36:39Z","due_on":"2015-02-01T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/w3c/echidna/pulls/56/commits","review_comments_url":"https://api.github.com/repos/w3c/echidna/pulls/56/comments","review_comment_url":"https://api.github.com/repos/w3c/echidna/pulls/comments/{number}","comments_url":"https://api.github.com/repos/w3c/echidna/issues/56/comments","statuses_url":"https://api.github.com/repos/w3c/echidna/statuses/79bb8aa85072b307fec0bbccf2f20fd2955034a9","head":{"label":"w3c:tripu/test-runner","ref":"tripu/test-runner","sha":"79bb8aa85072b307fec0bbccf2f20fd2955034a9","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":26229585,"name":"echidna","full_name":"w3c/echidna","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/echidna","description":"New publication workflow at W3C — main component","fork":false,"url":"https://api.github.com/repos/w3c/echidna","forks_url":"https://api.github.com/repos/w3c/echidna/forks","keys_url":"https://api.github.com/repos/w3c/echidna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/echidna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/echidna/teams","hooks_url":"https://api.github.com/repos/w3c/echidna/hooks","issue_events_url":"https://api.github.com/repos/w3c/echidna/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/echidna/events","assignees_url":"https://api.github.com/repos/w3c/echidna/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/echidna/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/echidna/tags","blobs_url":"https://api.github.com/repos/w3c/echidna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/echidna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/echidna/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/echidna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/echidna/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/echidna/languages","stargazers_url":"https://api.github.com/repos/w3c/echidna/stargazers","contributors_url":"https://api.github.com/repos/w3c/echidna/contributors","subscribers_url":"https://api.github.com/repos/w3c/echidna/subscribers","subscription_url":"https://api.github.com/repos/w3c/echidna/subscription","commits_url":"https://api.github.com/repos/w3c/echidna/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/echidna/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/echidna/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/echidna/issues/comments/{number}","contents_url":"https://api.github.com/repos/w3c/echidna/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/echidna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/echidna/merges","archive_url":"https://api.github.com/repos/w3c/echidna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/echidna/downloads","issues_url":"https://api.github.com/repos/w3c/echidna/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/echidna/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/echidna/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/echidna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/echidna/labels{/name}","releases_url":"https://api.github.com/repos/w3c/echidna/releases{/id}","created_at":"2014-11-05T16:53:27Z","updated_at":"2015-02-03T16:23:44Z","pushed_at":"2015-02-03T22:20:25Z","git_url":"git://github.com/w3c/echidna.git","ssh_url":"git@github.com:w3c/echidna.git","clone_url":"https://github.com/w3c/echidna.git","svn_url":"https://github.com/w3c/echidna","homepage":"","size":1847,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":2,"default_branch":"master"}},"base":{"label":"w3c:master","ref":"master","sha":"593bc7ede5acb12221dce8fe54266c97371ae588","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":26229585,"name":"echidna","full_name":"w3c/echidna","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/echidna","description":"New publication workflow at W3C — main component","fork":false,"url":"https://api.github.com/repos/w3c/echidna","forks_url":"https://api.github.com/repos/w3c/echidna/forks","keys_url":"https://api.github.com/repos/w3c/echidna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/echidna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/echidna/teams","hooks_url":"https://api.github.com/repos/w3c/echidna/hooks","issue_events_url":"https://api.github.com/repos/w3c/echidna/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/echidna/events","assignees_url":"https://api.github.com/repos/w3c/echidna/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/echidna/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/echidna/tags","blobs_url":"https://api.github.com/repos/w3c/echidna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/echidna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/echidna/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/echidna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/echidna/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/echidna/languages","stargazers_url":"https://api.github.com/repos/w3c/echidna/stargazers","contributors_url":"https://api.github.com/repos/w3c/echidna/contributors","subscribers_url":"https://api.github.com/repos/w3c/echidna/subscribers","subscription_url":"https://api.github.com/repos/w3c/echidna/subscription","commits_url":"https://api.github.com/repos/w3c/echidna/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/echidna/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/echidna/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/echidna/issues/comments/{number}","contents_url":"https://api.github.com/repos/w3c/echidna/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/echidna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/echidna/merges","archive_url":"https://api.github.com/repos/w3c/echidna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/echidna/downloads","issues_url":"https://api.github.com/repos/w3c/echidna/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/echidna/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/echidna/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/echidna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/echidna/labels{/name}","releases_url":"https://api.github.com/repos/w3c/echidna/releases{/id}","created_at":"2014-11-05T16:53:27Z","updated_at":"2015-02-03T16:23:44Z","pushed_at":"2015-02-03T22:20:25Z","git_url":"git://github.com/w3c/echidna.git","ssh_url":"git@github.com:w3c/echidna.git","clone_url":"https://github.com/w3c/echidna.git","svn_url":"https://github.com/w3c/echidna","homepage":"","size":1847,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/echidna/pulls/56"},"html":{"href":"https://github.com/w3c/echidna/pull/56"},"issue":{"href":"https://api.github.com/repos/w3c/echidna/issues/56"},"comments":{"href":"https://api.github.com/repos/w3c/echidna/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/echidna/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/echidna/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/w3c/echidna/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/echidna/statuses/79bb8aa85072b307fec0bbccf2f20fd2955034a9"}}}}