You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by gi...@git.apache.org on 2017/06/01 20:31:47 UTC

[GitHub] ddragosd commented on a change in pull request #38: added script to node-local testing for running test.js via the action?

ddragosd commented on a change in pull request #38: added script to node-local testing for running test.js via the action?
URL: https://github.com/apache/incubator-openwhisk-devtools/pull/38#discussion_r119720924
 
 

 ##########
 File path: node-local/runtest.sh
 ##########
 @@ -0,0 +1,47 @@
+#!/bin/bash
+
+pushd `dirname $0` > /dev/null
+SCRIPTPATH=`pwd`
+popd > /dev/null
+
+test_js_file="$SCRIPTPATH/test.js"
+actionimage="openwhisk/nodejs6action:latest"
+debug_env="debug_disabled"
+
+
+while [[ $# -gt 1 ]]
+do
+key="$1"
+
+case $key in
+    --target)
+    target_action_file="$2"
+    shift # past argument
+    ;;
+    --param)
+    params="$2"
+    shift # past argument
+    ;;
+    --image)
+    actionimage="$2"
+    shift # past argument
+    ;;
+    --debug)
+    debug_env="NODE_DEBUG=request"
+    ;;
+    *)
+            # unknown option
+    ;;
+esac
+shift # past argument or value
+done
+
+echo "#######################################################"
+echo "Testing action $target_action_file using image $actionimage"
+echo "#######################################################"
+
+docker run --name="actiontest" --rm -it \
+    -e "$debug_env" \
+    -v "$test_js_file:/nodejsAction/actiontest.js" \
 
 Review comment:
   What is the diff between test_js_file and target_action_file ?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services