This is an automated email from the ASF dual-hosted git repository.

mrutkowski pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-devtools.git


The following commit(s) were added to refs/heads/master by this push:
     new 33158bd  renaming test files (#243)
33158bd is described below

commit 33158bdeac30cab9b866cd054b4717bd0c0b9383
Author: Priti Desai <[email protected]>
AuthorDate: Wed Apr 10 11:41:36 2019 -0700

    renaming test files (#243)
---
 .../runtimes/javascript/tests/helloworld/README.md | 26 +++++++++++++++++++---
 .../tests/helloworld/build-without-code.yaml.tmpl  | 19 ++++++++++++++++
 .../tests/helloworld/knative-data-init-run.json    | 18 +++++++++++++++
 .../tests/helloworld/knative-data-init.json        |  8 +++++++
 .../{data-run.json => knative-data-run.json}       |  9 ++++----
 .../{data-init.json => openwhisk-data-init.json}   |  0
 .../{data-run.json => openwhisk-data-run.json}     |  0
 .../tests/helloworldwithparams/README.md           | 24 ++++++++++++++++++--
 .../build-without-code.yaml.tmpl                   | 19 ++++++++++++++++
 ...ta-init-run.json => knative-data-init-run.json} |  0
 .../{data-init.json => knative-data-init.json}     |  0
 .../{data-run.json => knative-data-run.json}       |  0
 .../helloworldwithparams/openwhisk-data-init.json  |  8 +++++++
 .../helloworldwithparams/openwhisk-data-run.json   | 12 ++++++++++
 .../tests/helloworldwithparamsfromenv/README.md    | 24 ++++++++++++++++++--
 .../build-without-code.yaml.tmpl                   | 19 ++++++++++++++++
 ...ta-init-run.json => knative-data-init-run.json} |  0
 .../{data-init.json => knative-data-init.json}     |  9 ++++----
 .../{data-init-run.json => knative-data-run.json}  |  7 +-----
 .../{data-init.json => openwhisk-data-init.json}   |  0
 .../{data-run.json => openwhisk-data-run.json}     |  0
 21 files changed, 181 insertions(+), 21 deletions(-)

diff --git a/knative-build/runtimes/javascript/tests/helloworld/README.md 
b/knative-build/runtimes/javascript/tests/helloworld/README.md
index 36b4f95..73f761d 100644
--- a/knative-build/runtimes/javascript/tests/helloworld/README.md
+++ b/knative-build/runtimes/javascript/tests/helloworld/README.md
@@ -31,6 +31,26 @@ Depending on the value you set in 
[buildtemplate.yaml](../../buildtemplate.yaml)
 curl -H "Host: nodejs-helloworld.default.example.com" -X POST http://localhost/
 ```
 
+#### Initialize the runtime
+
+You have an option to initialize the runtime with the function and other 
configuration data if its not initialized (i.e. built using 
[build-without-code.yaml.tmpl](build-without-code.yaml.tmpl))
+
+```
+curl -H "Host: nodejs-helloworld.default.example.com" -d 
"@knative-data-init.json" -H "Content-Type: application/json" http://localhost/
+
+{"OK":true}
+```
+
+#### Run the function
+
+Execute the function.
+
+```
+curl -H "Host: nodejs-helloworld.default.example.com" -d 
"@knative-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/
+
+{"payload":"Hello World!"};
+```
+
 ### Running with OW_RUNTIME_PLATFORM set to "openwhisk"
 
 #### Initialize the runtime
@@ -38,7 +58,7 @@ curl -H "Host: nodejs-helloworld.default.example.com" -X POST 
http://localhost/
 Initialize the runtime with the function and other configuration data using 
the ```/init``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld.default.example.com" -d "@data-init.json" -H 
"Content-Type: application/json" http://localhost/init
+curl -H "Host: nodejs-helloworld.default.example.com" -d 
"@openwhisk-data-init.json" -H "Content-Type: application/json" 
http://localhost/init
 
 {"OK":true}
 ```
@@ -48,7 +68,7 @@ curl -H "Host: nodejs-helloworld.default.example.com" -d 
"@data-init.json" -H "C
 Execute the function using the ```/run``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld.default.example.com" -d "@data-run.json" -H 
"Content-Type: application/json" -X POST http://localhost/run
+curl -H "Host: nodejs-helloworld.default.example.com" -d 
"@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/run
 
-{"payload":"Hello"}
+{"payload":"Hello World!"}
 ```
diff --git 
a/knative-build/runtimes/javascript/tests/helloworld/build-without-code.yaml.tmpl
 
b/knative-build/runtimes/javascript/tests/helloworld/build-without-code.yaml.tmpl
new file mode 100644
index 0000000..a88d683
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworld/build-without-code.yaml.tmpl
@@ -0,0 +1,19 @@
+apiVersion: build.knative.dev/v1alpha1
+kind: Build
+metadata:
+  name: nodejs-10-helloworld
+spec:
+  serviceAccountName: openwhisk-runtime-builder
+  source:
+    git:
+      url: "https://github.com/apache/incubator-openwhisk-devtools.git";
+      revision: "master"
+  template:
+    name: openwhisk-nodejs-runtime
+    arguments:
+      - name: TARGET_IMAGE_NAME
+        value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld"
+      - name: DOCKERFILE
+        value: "./knative-build/runtimes/javascript/Dockerfile"
+      - name: OW_RUNTIME_DEBUG
+        value: "true"
diff --git 
a/knative-build/runtimes/javascript/tests/helloworld/knative-data-init-run.json 
b/knative-build/runtimes/javascript/tests/helloworld/knative-data-init-run.json
new file mode 100644
index 0000000..1cd9ea7
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworld/knative-data-init-run.json
@@ -0,0 +1,18 @@
+{
+  "init": {
+    "name": "nodejs-helloworld",
+    "main": "main",
+    "binary": false,
+    "code": "function main() {return {payload: 'Hello World!'};}"
+  },
+  "activation": {
+    "namespace": "default",
+    "action_name": "nodejs-helloworld",
+    "api_host": "",
+    "api_key": "",
+    "activation_id": "",
+    "deadline": "4102498800000"
+  },
+  "value": {
+  }
+}
diff --git 
a/knative-build/runtimes/javascript/tests/helloworld/knative-data-init.json 
b/knative-build/runtimes/javascript/tests/helloworld/knative-data-init.json
new file mode 100644
index 0000000..80ee380
--- /dev/null
+++ b/knative-build/runtimes/javascript/tests/helloworld/knative-data-init.json
@@ -0,0 +1,8 @@
+{
+  "init": {
+    "name": "nodejs-helloworld",
+    "main": "main",
+    "binary": false,
+    "code": "function main() {return {payload: 'Hello World!'};}"
+  }
+}
diff --git a/knative-build/runtimes/javascript/tests/helloworld/data-run.json 
b/knative-build/runtimes/javascript/tests/helloworld/knative-data-run.json
similarity index 79%
copy from knative-build/runtimes/javascript/tests/helloworld/data-run.json
copy to knative-build/runtimes/javascript/tests/helloworld/knative-data-run.json
index c833598..ecdc03e 100644
--- a/knative-build/runtimes/javascript/tests/helloworld/data-run.json
+++ b/knative-build/runtimes/javascript/tests/helloworld/knative-data-run.json
@@ -1,11 +1,12 @@
-{ 
-    "value": {
-        
-    },
+{
+  "activation": {
     "namespace": "default",
     "action_name": "nodejs-helloworld",
     "api_host": "",
     "api_key": "",
     "activation_id": "",
     "deadline": "4102498800000"
+  },
+  "value": {
+  }
 }
diff --git a/knative-build/runtimes/javascript/tests/helloworld/data-init.json 
b/knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-init.json
similarity index 100%
rename from knative-build/runtimes/javascript/tests/helloworld/data-init.json
rename to 
knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-init.json
diff --git a/knative-build/runtimes/javascript/tests/helloworld/data-run.json 
b/knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-run.json
similarity index 100%
rename from knative-build/runtimes/javascript/tests/helloworld/data-run.json
rename to 
knative-build/runtimes/javascript/tests/helloworld/openwhisk-data-run.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/README.md 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/README.md
index 74b243b..ca729f0 100644
--- a/knative-build/runtimes/javascript/tests/helloworldwithparams/README.md
+++ b/knative-build/runtimes/javascript/tests/helloworldwithparams/README.md
@@ -31,6 +31,26 @@ Depending on the value you set in 
[buildtemplate.yaml](../../buildtemplate.yaml)
 curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
'{"value": {"name": "Joe", "place": "TX"}}' -H "Content-Type: application/json" 
http://localhost/
 ```
 
+#### Initialize the runtime
+
+You have an option to initialize the runtime with the function and other 
configuration data if its not initialized (i.e. built using 
[build-without-code.yaml.tmpl](build-without-code.yaml.tmpl))
+
+```
+curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@knative-data-init.json" -H "Content-Type: application/json" http://localhost/
+
+{"OK":true}
+```
+
+#### Run the function
+
+Execute the function.
+
+```
+curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@knative-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/
+
+{"payload":"Hello Jill from OK!"};
+```
+
 ### Running with OW_RUNTIME_PLATFORM set to "openwhisk"
 
 #### Initialize the runtime
@@ -38,7 +58,7 @@ curl -H "Host: 
nodejs-helloworld-with-params.default.example.com" -d '{"value":
 Initialize the runtime with the function and other configuration data using 
the ```/init``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@data-init.json" -H "Content-Type: application/json" http://localhost/init
+curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@openwhisk-data-init.json" -H "Content-Type: application/json" 
http://localhost/init
 
 {"OK":true}
 ```
@@ -48,7 +68,7 @@ curl -H "Host: 
nodejs-helloworld-with-params.default.example.com" -d "@data-init
 Execute the function using the ```/run``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/run
+curl -H "Host: nodejs-helloworld-with-params.default.example.com" -d 
"@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/run
 
 {"payload":"Hello Joe from TX!"};
 ```
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/build-without-code.yaml.tmpl
 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/build-without-code.yaml.tmpl
new file mode 100644
index 0000000..6789198
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/build-without-code.yaml.tmpl
@@ -0,0 +1,19 @@
+apiVersion: build.knative.dev/v1alpha1
+kind: Build
+metadata:
+  name: nodejs-10-helloworld-with-params
+spec:
+  serviceAccountName: openwhisk-runtime-builder
+  source:
+    git:
+      url: "https://github.com/apache/incubator-openwhisk-devtools.git";
+      revision: "master"
+  template:
+    name: openwhisk-nodejs-runtime
+    arguments:
+      - name: TARGET_IMAGE_NAME
+        value: "docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params"
+      - name: DOCKERFILE
+        value: "./knative-build/runtimes/javascript/Dockerfile"
+      - name: OW_RUNTIME_DEBUG
+        value: "true"
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init-run.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init-run.json
similarity index 100%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparams/data-init-run.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init-run.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init.json
similarity index 100%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparams/data-init.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-init.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-run.json
similarity index 100%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparams/data-run.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparams/knative-data-run.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-init.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-init.json
new file mode 100644
index 0000000..08ee77c
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-init.json
@@ -0,0 +1,8 @@
+{
+  "value": {
+    "name" : "nodejs-helloworld-with-params",
+    "main" : "main",
+    "binary": false,
+    "code" : "function main(params) {return {payload: 'Hello ' + params.name + 
' from ' + params.place +  '!'};}"
+  }
+}
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-run.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-run.json
new file mode 100644
index 0000000..7b4aa34
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparams/openwhisk-data-run.json
@@ -0,0 +1,12 @@
+{
+  "value": {
+    "name" : "Joe",
+    "place" : "TX"
+  },
+  "namespace": "default",
+  "action_name": "nodejs-helloworld-with-params",
+  "api_host": "",
+  "api_key": "",
+  "activation_id": "",
+  "deadline": "4102498800000"
+}
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/README.md 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/README.md
index 9a921fc..525dd00 100644
--- 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/README.md
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/README.md
@@ -31,6 +31,26 @@ Depending on the value you set in 
[buildtemplate.yaml](../../buildtemplate.yaml)
 curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -X 
POST http://localhost/
 ```
 
+#### Initialize the runtime
+
+You have an option to initialize the runtime with the function and other 
configuration data if its not initialized (i.e. built using 
[build-without-code.yaml.tmpl](build-without-code.yaml.tmpl))
+
+```
+curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@knative-data-init.json" -H "Content-Type: application/json" http://localhost/
+
+{"OK":true}
+```
+
+#### Run the function
+
+Execute the function.
+
+```
+curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@knative-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/
+
+{"payload":"Hello Jess from OK!"};
+```
+
 ### Running with OW_RUNTIME_PLATFORM set to "openwhisk"
 
 #### Initialize the runtime
@@ -38,7 +58,7 @@ curl -H "Host: 
nodejs-helloworld-with-params-from-env.default.example.com" -X PO
 Initialize the runtime with the function and other configuration data using 
the ```/init``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@data-init.json" -H "Content-Type: application/json" http://localhost/init
+curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@openwhisk-data-init.json" -H "Content-Type: application/json" 
http://localhost/init
 
 {"OK":true}
 ```
@@ -48,7 +68,7 @@ curl -H "Host: 
nodejs-helloworld-with-params-from-env.default.example.com" -d "@
 Execute the function using the ```/run``` endpoint.
 
 ```
-curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/run
+curl -H "Host: nodejs-helloworld-with-params-from-env.default.example.com" -d 
"@openwhisk-data-run.json" -H "Content-Type: application/json" -X POST 
http://localhost/run
 
 {"payload":"Hello Jess from OK!"};
 ```
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/build-without-code.yaml.tmpl
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/build-without-code.yaml.tmpl
new file mode 100644
index 0000000..528160b
--- /dev/null
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/build-without-code.yaml.tmpl
@@ -0,0 +1,19 @@
+apiVersion: build.knative.dev/v1alpha1
+kind: Build
+metadata:
+  name: nodejs-10-helloworld-with-params-from-env
+spec:
+  serviceAccountName: openwhisk-runtime-builder
+  source:
+    git:
+      url: "https://github.com/apache/incubator-openwhisk-devtools.git";
+      revision: "master"
+  template:
+    name: openwhisk-nodejs-runtime
+    arguments:
+      - name: TARGET_IMAGE_NAME
+        value: 
"docker.io/${DOCKER_USERNAME}/nodejs-10-helloworld-with-params-from-env"
+      - name: DOCKERFILE
+        value: "./knative-build/runtimes/javascript/Dockerfile"
+      - name: OW_RUNTIME_DEBUG
+        value: "true"
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init-run.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init-run.json
similarity index 100%
copy from 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init-run.json
copy to 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init-run.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init.json
similarity index 72%
copy from 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init.json
copy to 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init.json
index b35bee0..8bcef8e 100644
--- 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init.json
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-init.json
@@ -1,8 +1,9 @@
-{ 
-    "value": { 
+{
+    "init": {
         "name" : "nodejs-helloworld-with-params-from-env",
-        "main" : "main", 
-        "binary": false, 
+        "main" : "main",
+        "binary": false,
         "code" : "function main() {return {payload: 'Hello ' + 
process.env.NAME + ' from ' + process.env.PLACE +  '!'};}"
     }
 }
+
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init-run.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-run.json
similarity index 55%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init-run.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-run.json
index 321a5d6..f7cfbc6 100644
--- 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init-run.json
+++ 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/knative-data-run.json
@@ -1,10 +1,4 @@
 {
-    "init": {
-        "name" : "nodejs-helloworld-with-params-from-env",
-        "main" : "main",
-        "binary": false,
-        "code" : "function main() {return {payload: 'Hello ' + 
process.env.NAME + ' from ' + process.env.PLACE +  '!'};}"
-    },
     "activation": {
         "namespace": "default",
         "action_name": "nodejs-helloworld-with-params-from-env",
@@ -18,3 +12,4 @@
         "place" : "OK"
     }
 }
+
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-init.json
similarity index 100%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-init.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-init.json
diff --git 
a/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-run.json
 
b/knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-run.json
similarity index 100%
rename from 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/data-run.json
rename to 
knative-build/runtimes/javascript/tests/helloworldwithparamsfromenv/openwhisk-data-run.json

Reply via email to