{"action":"created","comment":{"url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/comments/84110480","pull_request_review_id":4908802,"id":84110480,"diff_hunk":"@@ -36,40 +35,45 @@ function readScript(options) {\n }\n \n /**\n+ * Checks working directory for service config, otherwise uses default.\n+ * @returns {string} - path to service config\n+ */\n+function findServicePath() {\n+    const localServerlessPath = path.join(process.cwd(), 'serverless.yml');\n+\n+    if (fileExists(localServerlessPath)) {\n+        return process.cwd();\n+    } else {\n+        // use the default serverless.yml in project\n+        return path.join(__dirname, 'lambda');\n+    }\n+}\n+\n+/**\n  * Copy the test script into the lambda directory.\n  * @param {Object} options - options.script may contain path to test script\n  */\n function copyTestScript(options) {\n-    const localScriptPath = path.join(process.cwd(), options.script),\n+    const isAbsolutePath = path.isAbsolutePath(options.script),\n+          localScriptPath = path.join(process.cwd(), options.script),\n           scriptFilename = path.basename(localScriptPath),\n-          projectServicePath = path.join(__dirname, 'lambda');\n+          projectServicePath = findServicePath();\n \n-    // Fist, check if the script might refer to a local file.\n-    if (fileExists(localScriptPath)) {\n+    if (isAbsolutePath && fileExists(options.script)) {\n+        // script refers to absolute path.\n+        copyFile(options.script, path.join(projectServicePath, scriptFilename));\n+    } else if (fileExists(localScriptPath)) {\n         // Copy the test script into the lambda directory to run, and set the script name\n-        options.script = scriptFilename;\n-        let projectScriptPath = path.join(projectServicePath, options.script);\n-        copyFile(localScriptPath, projectScriptPath);\n-    } else {\n+        copyFile(localScriptPath, path.join(projectServicePath, scriptFilename));\n+    } else if (options.script === 'script.yml') {","path":"lib/index.js","position":null,"original_position":50,"commit_id":"a431cf7b1554b7bfc3fbd6b61761cc54a240a684","original_commit_id":"a431cf7b1554b7bfc3fbd6b61761cc54a240a684","user":{"login":"erikerikson","id":571200,"avatar_url":"https://avatars.githubusercontent.com/u/571200?v=3","gravatar_id":"","url":"https://api.github.com/users/erikerikson","html_url":"https://github.com/erikerikson","followers_url":"https://api.github.com/users/erikerikson/followers","following_url":"https://api.github.com/users/erikerikson/following{/other_user}","gists_url":"https://api.github.com/users/erikerikson/gists{/gist_id}","starred_url":"https://api.github.com/users/erikerikson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikerikson/subscriptions","organizations_url":"https://api.github.com/users/erikerikson/orgs","repos_url":"https://api.github.com/users/erikerikson/repos","events_url":"https://api.github.com/users/erikerikson/events{/privacy}","received_events_url":"https://api.github.com/users/erikerikson/received_events","type":"User","site_admin":false},"body":"shouldn't this be \"if no script was provided\"?  ","created_at":"2016-10-19T16:26:21Z","updated_at":"2016-10-19T16:26:21Z","html_url":"https://github.com/Nordstrom/serverless-artillery/pull/17#discussion_r84110480","pull_request_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/comments/84110480"},"html":{"href":"https://github.com/Nordstrom/serverless-artillery/pull/17#discussion_r84110480"},"pull_request":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17","id":89741353,"html_url":"https://github.com/Nordstrom/serverless-artillery/pull/17","diff_url":"https://github.com/Nordstrom/serverless-artillery/pull/17.diff","patch_url":"https://github.com/Nordstrom/serverless-artillery/pull/17.patch","issue_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/17","number":17,"state":"closed","locked":false,"title":"Switch CLI Parser, Update Docs","user":{"login":"erikerikson","id":571200,"avatar_url":"https://avatars.githubusercontent.com/u/571200?v=3","gravatar_id":"","url":"https://api.github.com/users/erikerikson","html_url":"https://github.com/erikerikson","followers_url":"https://api.github.com/users/erikerikson/followers","following_url":"https://api.github.com/users/erikerikson/following{/other_user}","gists_url":"https://api.github.com/users/erikerikson/gists{/gist_id}","starred_url":"https://api.github.com/users/erikerikson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikerikson/subscriptions","organizations_url":"https://api.github.com/users/erikerikson/orgs","repos_url":"https://api.github.com/users/erikerikson/repos","events_url":"https://api.github.com/users/erikerikson/events{/privacy}","received_events_url":"https://api.github.com/users/erikerikson/received_events","type":"User","site_admin":false},"body":"Switch from 'commander' to 'yargs' and then update the commands and associated docs with my latest understanding of the target.","created_at":"2016-10-18T03:32:46Z","updated_at":"2016-10-19T16:26:21Z","closed_at":"2016-10-19T02:29:37Z","merged_at":"2016-10-19T02:29:37Z","merge_commit_sha":"029e8304bd67e74e3a040ea96fc8cb9ef669dcf7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17/commits","review_comments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17/comments","review_comment_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/17/comments","statuses_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/statuses/a431cf7b1554b7bfc3fbd6b61761cc54a240a684","head":{"label":"Nordstrom:develop","ref":"develop","sha":"a431cf7b1554b7bfc3fbd6b61761cc54a240a684","user":{"login":"Nordstrom","id":2488485,"avatar_url":"https://avatars.githubusercontent.com/u/2488485?v=3","gravatar_id":"","url":"https://api.github.com/users/Nordstrom","html_url":"https://github.com/Nordstrom","followers_url":"https://api.github.com/users/Nordstrom/followers","following_url":"https://api.github.com/users/Nordstrom/following{/other_user}","gists_url":"https://api.github.com/users/Nordstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/Nordstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nordstrom/subscriptions","organizations_url":"https://api.github.com/users/Nordstrom/orgs","repos_url":"https://api.github.com/users/Nordstrom/repos","events_url":"https://api.github.com/users/Nordstrom/events{/privacy}","received_events_url":"https://api.github.com/users/Nordstrom/received_events","type":"Organization","site_admin":false},"repo":{"id":65584082,"name":"serverless-artillery","full_name":"Nordstrom/serverless-artillery","owner":{"login":"Nordstrom","id":2488485,"avatar_url":"https://avatars.githubusercontent.com/u/2488485?v=3","gravatar_id":"","url":"https://api.github.com/users/Nordstrom","html_url":"https://github.com/Nordstrom","followers_url":"https://api.github.com/users/Nordstrom/followers","following_url":"https://api.github.com/users/Nordstrom/following{/other_user}","gists_url":"https://api.github.com/users/Nordstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/Nordstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nordstrom/subscriptions","organizations_url":"https://api.github.com/users/Nordstrom/orgs","repos_url":"https://api.github.com/users/Nordstrom/repos","events_url":"https://api.github.com/users/Nordstrom/events{/privacy}","received_events_url":"https://api.github.com/users/Nordstrom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nordstrom/serverless-artillery","description":null,"fork":false,"url":"https://api.github.com/repos/Nordstrom/serverless-artillery","forks_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/forks","keys_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/teams","hooks_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/hooks","issue_events_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/events{/number}","events_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/events","assignees_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/assignees{/user}","branches_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/branches{/branch}","tags_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/tags","blobs_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/statuses/{sha}","languages_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/languages","stargazers_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/stargazers","contributors_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/contributors","subscribers_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/subscribers","subscription_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/subscription","commits_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/contents/{+path}","compare_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/merges","archive_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/downloads","issues_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues{/number}","pulls_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls{/number}","milestones_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/milestones{/number}","notifications_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/labels{/name}","releases_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/releases{/id}","deployments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/deployments","created_at":"2016-08-12T21:17:28Z","updated_at":"2016-10-12T14:52:34Z","pushed_at":"2016-10-19T03:38:33Z","git_url":"git://github.com/Nordstrom/serverless-artillery.git","ssh_url":"git@github.com:Nordstrom/serverless-artillery.git","clone_url":"https://github.com/Nordstrom/serverless-artillery.git","svn_url":"https://github.com/Nordstrom/serverless-artillery","homepage":null,"size":56,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":6,"default_branch":"master"}},"base":{"label":"Nordstrom:master","ref":"master","sha":"d9b4c311dfa1aa958380adb729a0bf4f5f0f596e","user":{"login":"Nordstrom","id":2488485,"avatar_url":"https://avatars.githubusercontent.com/u/2488485?v=3","gravatar_id":"","url":"https://api.github.com/users/Nordstrom","html_url":"https://github.com/Nordstrom","followers_url":"https://api.github.com/users/Nordstrom/followers","following_url":"https://api.github.com/users/Nordstrom/following{/other_user}","gists_url":"https://api.github.com/users/Nordstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/Nordstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nordstrom/subscriptions","organizations_url":"https://api.github.com/users/Nordstrom/orgs","repos_url":"https://api.github.com/users/Nordstrom/repos","events_url":"https://api.github.com/users/Nordstrom/events{/privacy}","received_events_url":"https://api.github.com/users/Nordstrom/received_events","type":"Organization","site_admin":false},"repo":{"id":65584082,"name":"serverless-artillery","full_name":"Nordstrom/serverless-artillery","owner":{"login":"Nordstrom","id":2488485,"avatar_url":"https://avatars.githubusercontent.com/u/2488485?v=3","gravatar_id":"","url":"https://api.github.com/users/Nordstrom","html_url":"https://github.com/Nordstrom","followers_url":"https://api.github.com/users/Nordstrom/followers","following_url":"https://api.github.com/users/Nordstrom/following{/other_user}","gists_url":"https://api.github.com/users/Nordstrom/gists{/gist_id}","starred_url":"https://api.github.com/users/Nordstrom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nordstrom/subscriptions","organizations_url":"https://api.github.com/users/Nordstrom/orgs","repos_url":"https://api.github.com/users/Nordstrom/repos","events_url":"https://api.github.com/users/Nordstrom/events{/privacy}","received_events_url":"https://api.github.com/users/Nordstrom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nordstrom/serverless-artillery","description":null,"fork":false,"url":"https://api.github.com/repos/Nordstrom/serverless-artillery","forks_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/forks","keys_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/teams","hooks_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/hooks","issue_events_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/events{/number}","events_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/events","assignees_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/assignees{/user}","branches_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/branches{/branch}","tags_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/tags","blobs_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/statuses/{sha}","languages_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/languages","stargazers_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/stargazers","contributors_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/contributors","subscribers_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/subscribers","subscription_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/subscription","commits_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/contents/{+path}","compare_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/merges","archive_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/downloads","issues_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues{/number}","pulls_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls{/number}","milestones_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/milestones{/number}","notifications_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/labels{/name}","releases_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/releases{/id}","deployments_url":"https://api.github.com/repos/Nordstrom/serverless-artillery/deployments","created_at":"2016-08-12T21:17:28Z","updated_at":"2016-10-12T14:52:34Z","pushed_at":"2016-10-19T03:38:33Z","git_url":"git://github.com/Nordstrom/serverless-artillery.git","ssh_url":"git@github.com:Nordstrom/serverless-artillery.git","clone_url":"https://github.com/Nordstrom/serverless-artillery.git","svn_url":"https://github.com/Nordstrom/serverless-artillery","homepage":null,"size":56,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":7,"forks":2,"open_issues":7,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17"},"html":{"href":"https://github.com/Nordstrom/serverless-artillery/pull/17"},"issue":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/17"},"comments":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/Nordstrom/serverless-artillery/statuses/a431cf7b1554b7bfc3fbd6b61761cc54a240a684"}}}}
{"actor":{"display_login":"erikerikson"}}