{"action":"created","comment":{"url":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments/54793049","id":54793049,"diff_hunk":"@@ -0,0 +1,168 @@\n+'use strict';\n+\n+let _ = require('underscore');\n+let Promise = require('bluebird');\n+let chakram = require('chakram');\n+var expect = chakram.expect;\n+let execAsync = Promise.promisify(require('child_process').exec);\n+let fs = require('fs');\n+let http = require('http');\n+let logger = require('mocha-logger');\n+let path = require('path');\n+let retry = require('bluebird-retry');\n+let spawn = require('child_process').spawn;\n+let WebSocket = require('ws');\n+\n+function spawnify(command, args, options) {\n+    return new Promise((resolve, reject) => {\n+        args = args || [];\n+        logger.log('spawning \"' + command + ' ' + args.join(' '));\n+        options = _.extend( {\n+            detached: true,\n+            stdio: ['ignore', 'pipe', 'pipe']\n+        }, options);\n+\n+        var spawned = spawn(command, args, options);\n+        var stdout = '';\n+        var stderr = '';\n+\n+        spawned.stdout.on('data', (data) => {\n+            logger.log('STDOUT:', data);\n+            stdout += data;\n+        });\n+\n+        spawned.stderr.on('data', (data) => {\n+            logger.log('STDERR:', data);\n+            stderr += data;\n+        });\n+\n+        spawned.on('close', (code) => {\n+            if (code === 0) {\n+                resolve(stdout, stderr);\n+            } else {\n+                reject(Error('command: \"' + command + ' ' + args.join(' ') +\n+                             '\", failed with ' + code));\n+            }\n+        });\n+    });\n+}\n+\n+describe('examples', () => {\n+    let hostAddress = 'localhost';\n+    let juttleEnginePort = 8080;\n+    let baseUrl = `http://${hostAddress}:${juttleEnginePort}`\n+    let baseAPIUrl = `${baseUrl}/api/v0`\n+\n+    let retryHTTPOptions = {\n+        interval: 500,\n+        timeout: 10000\n+    }\n+\n+    before(() => {\n+        return execAsync('docker run ubuntu route | grep default | awk \\'{print $2}\\'')","path":"test/examples/examples.spec.js","position":62,"original_position":62,"commit_id":"c07ba9f03834d98c0b20c752f702fbda48ca8e71","original_commit_id":"c07ba9f03834d98c0b20c752f702fbda48ca8e71","user":{"login":"mstemm","id":13422831,"avatar_url":"https://avatars.githubusercontent.com/u/13422831?v=3","gravatar_id":"","url":"https://api.github.com/users/mstemm","html_url":"https://github.com/mstemm","followers_url":"https://api.github.com/users/mstemm/followers","following_url":"https://api.github.com/users/mstemm/following{/other_user}","gists_url":"https://api.github.com/users/mstemm/gists{/gist_id}","starred_url":"https://api.github.com/users/mstemm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstemm/subscriptions","organizations_url":"https://api.github.com/users/mstemm/orgs","repos_url":"https://api.github.com/users/mstemm/repos","events_url":"https://api.github.com/users/mstemm/events{/privacy}","received_events_url":"https://api.github.com/users/mstemm/received_events","type":"User","site_admin":false},"body":"Can you explain why you need to find the specific address the containers are using? You can't just use localhost?","created_at":"2016-03-02T21:18:57Z","updated_at":"2016-03-02T21:18:57Z","html_url":"https://github.com/juttle/juttle-engine/pull/58#discussion_r54793049","pull_request_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments/54793049"},"html":{"href":"https://github.com/juttle/juttle-engine/pull/58#discussion_r54793049"},"pull_request":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/juttle/juttle-engine/pulls/58","id":60429497,"html_url":"https://github.com/juttle/juttle-engine/pull/58","diff_url":"https://github.com/juttle/juttle-engine/pull/58.diff","patch_url":"https://github.com/juttle/juttle-engine/pull/58.patch","issue_url":"https://api.github.com/repos/juttle/juttle-engine/issues/58","number":58,"state":"open","locked":false,"title":"add tests to verify the examples work","user":{"login":"rlgomes","id":107359,"avatar_url":"https://avatars.githubusercontent.com/u/107359?v=3","gravatar_id":"","url":"https://api.github.com/users/rlgomes","html_url":"https://github.com/rlgomes","followers_url":"https://api.github.com/users/rlgomes/followers","following_url":"https://api.github.com/users/rlgomes/following{/other_user}","gists_url":"https://api.github.com/users/rlgomes/gists{/gist_id}","starred_url":"https://api.github.com/users/rlgomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlgomes/subscriptions","organizations_url":"https://api.github.com/users/rlgomes/orgs","repos_url":"https://api.github.com/users/rlgomes/repos","events_url":"https://api.github.com/users/rlgomes/events{/privacy}","received_events_url":"https://api.github.com/users/rlgomes/received_events","type":"User","site_admin":false},"body":"fixes #49\r\n\r\nwith this we'll have tests that spin up the examples setup using the same scripts that are documented in the README and then we basically iterate through the juttle and verify the expected data is returned.","created_at":"2016-02-23T23:28:21Z","updated_at":"2016-03-02T21:18:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ceb2d9bf753ce54ec602467402af94eda4dbb19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/58/commits","review_comments_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/58/comments","review_comment_url":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/issues/58/comments","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/c07ba9f03834d98c0b20c752f702fbda48ca8e71","head":{"label":"juttle:examples-tests","ref":"examples-tests","sha":"c07ba9f03834d98c0b20c752f702fbda48ca8e71","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":51180780,"name":"juttle-engine","full_name":"juttle/juttle-engine","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle-engine","description":"juttle execution engine","fork":false,"url":"https://api.github.com/repos/juttle/juttle-engine","forks_url":"https://api.github.com/repos/juttle/juttle-engine/forks","keys_url":"https://api.github.com/repos/juttle/juttle-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle-engine/teams","hooks_url":"https://api.github.com/repos/juttle/juttle-engine/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle-engine/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle-engine/events","assignees_url":"https://api.github.com/repos/juttle/juttle-engine/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle-engine/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle-engine/tags","blobs_url":"https://api.github.com/repos/juttle/juttle-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle-engine/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle-engine/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle-engine/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle-engine/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle-engine/subscription","commits_url":"https://api.github.com/repos/juttle/juttle-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle-engine/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle-engine/merges","archive_url":"https://api.github.com/repos/juttle/juttle-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle-engine/downloads","issues_url":"https://api.github.com/repos/juttle/juttle-engine/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle-engine/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle-engine/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle-engine/deployments","created_at":"2016-02-05T23:29:37Z","updated_at":"2016-03-02T07:13:18Z","pushed_at":"2016-03-02T20:56:26Z","git_url":"git://github.com/juttle/juttle-engine.git","ssh_url":"git@github.com:juttle/juttle-engine.git","clone_url":"https://github.com/juttle/juttle-engine.git","svn_url":"https://github.com/juttle/juttle-engine","homepage":null,"size":46555,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":4,"default_branch":"master"}},"base":{"label":"juttle:master","ref":"master","sha":"9eaa25e322780dcbf41cb4f5e7c4afe4590bf2c6","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":51180780,"name":"juttle-engine","full_name":"juttle/juttle-engine","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle-engine","description":"juttle execution engine","fork":false,"url":"https://api.github.com/repos/juttle/juttle-engine","forks_url":"https://api.github.com/repos/juttle/juttle-engine/forks","keys_url":"https://api.github.com/repos/juttle/juttle-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle-engine/teams","hooks_url":"https://api.github.com/repos/juttle/juttle-engine/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle-engine/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle-engine/events","assignees_url":"https://api.github.com/repos/juttle/juttle-engine/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle-engine/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle-engine/tags","blobs_url":"https://api.github.com/repos/juttle/juttle-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle-engine/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle-engine/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle-engine/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle-engine/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle-engine/subscription","commits_url":"https://api.github.com/repos/juttle/juttle-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle-engine/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle-engine/merges","archive_url":"https://api.github.com/repos/juttle/juttle-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle-engine/downloads","issues_url":"https://api.github.com/repos/juttle/juttle-engine/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle-engine/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle-engine/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle-engine/deployments","created_at":"2016-02-05T23:29:37Z","updated_at":"2016-03-02T07:13:18Z","pushed_at":"2016-03-02T20:56:26Z","git_url":"git://github.com/juttle/juttle-engine.git","ssh_url":"git@github.com:juttle/juttle-engine.git","clone_url":"https://github.com/juttle/juttle-engine.git","svn_url":"https://github.com/juttle/juttle-engine","homepage":null,"size":46555,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/58"},"html":{"href":"https://github.com/juttle/juttle-engine/pull/58"},"issue":{"href":"https://api.github.com/repos/juttle/juttle-engine/issues/58"},"comments":{"href":"https://api.github.com/repos/juttle/juttle-engine/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juttle/juttle-engine/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/juttle/juttle-engine/statuses/c07ba9f03834d98c0b20c752f702fbda48ca8e71"}}}}