You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2020/02/13 19:33:43 UTC
[openwhisk-runtime-nodejs] branch master updated (3e843c0 ->
7aca443)
This is an automated email from the ASF dual-hosted git repository.
dgrove pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-nodejs.git.
from 3e843c0 release prep (#158)
new 5ca1d86 add license header to *.tmpl files
new 7aca443 build nodejs-test.zip from source before running tests
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.gitignore | 12 ++----------
core/nodejsActionBase/docker-secret.yaml.tmpl | 17 +++++++++++++++++
tests/build.gradle | 11 +++++++++++
.../application.conf => dat/actions/build.sh} | 16 +++++++++++-----
tests/dat/actions/nodejs-test.zip | Bin 1186 -> 0 bytes
.../build.gradle => actions/nodejs-test/main.js} | 11 +++++++++--
.../nodejs-test/node_modules/abcxyz/index.js} | 5 +++--
tests/dat/actions/nodejs-test/package.json | 14 ++++++++++++++
tests/src/test/knative/helloworld/build.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/helloworld/service.yaml.tmpl | 17 +++++++++++++++++
.../helloworldwithparams/build-without-code.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/helloworldwithparams/build.yaml.tmpl | 17 +++++++++++++++++
.../knative/helloworldwithparams/service.yaml.tmpl | 17 +++++++++++++++++
.../webactionhelloworld/build-without-code.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/webactionhelloworld/build.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/webactionhelloworld/service.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/webactionraw/build.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/webactionraw/service.yaml.tmpl | 17 +++++++++++++++++
18 files changed, 237 insertions(+), 19 deletions(-)
copy tests/{src/test/resources/application.conf => dat/actions/build.sh} (82%)
mode change 100644 => 100755
delete mode 100644 tests/dat/actions/nodejs-test.zip
copy tests/dat/{docker/nodejs8docker/build.gradle => actions/nodejs-test/main.js} (86%)
copy tests/dat/{docker/nodejs8docker/build.gradle => actions/nodejs-test/node_modules/abcxyz/index.js} (90%)
create mode 100644 tests/dat/actions/nodejs-test/package.json
[openwhisk-runtime-nodejs] 02/02: build nodejs-test.zip from source
before running tests
Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-nodejs.git
commit 7aca44335c567164a9108cf83c8c06b660f215a5
Author: David Grove <gr...@us.ibm.com>
AuthorDate: Thu Feb 13 13:25:05 2020 -0500
build nodejs-test.zip from source before running tests
---
.gitignore | 12 ++-------
tests/build.gradle | 11 ++++++++
tests/dat/actions/build.sh | 28 +++++++++++++++++++
tests/dat/actions/nodejs-test.zip | Bin 1186 -> 0 bytes
.../actions/nodejs-test/main.js} | 30 +++++----------------
.../nodejs-test/node_modules/abcxyz/index.js} | 28 ++-----------------
tests/dat/actions/nodejs-test/package.json | 14 ++++++++++
7 files changed, 63 insertions(+), 60 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0bc5144..d5aef40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,14 +61,6 @@ ansible/roles/nginx/files/openwhisk-client*
ansible/roles/nginx/files/*.csr
ansible/roles/nginx/files/*cert.pem
-# .zip files must be explicited whitelisted
+# Generated by tests:buildArtifacts
+.built
*.zip
-!tests/dat/actions/blackbox.zip
-!tests/dat/actions/helloSwift.zip
-!tests/dat/actions/nodejs-test.zip
-!tests/dat/actions/python.zip
-!tests/dat/actions/python2_virtualenv.zip
-!tests/dat/actions/python3_virtualenv.zip
-!tests/dat/actions/python_virtualenv_dir.zip
-!tests/dat/actions/python_virtualenv_name.zip
-!tests/dat/actions/zippedaction.zip
diff --git a/tests/build.gradle b/tests/build.gradle
index 1ae5a4b..bdb648e 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -42,3 +42,14 @@ dependencies {
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
}
+
+task buildArtifacts(type:Exec) {
+ workingDir 'tests/dat/actions'
+ commandLine './build.sh'
+}
+
+tasks.withType(Test) {
+ dependsOn buildArtifacts
+}
+
+testClasses.dependsOn(buildArtifacts)
diff --git a/tests/dat/actions/build.sh b/tests/dat/actions/build.sh
new file mode 100755
index 0000000..0ee1a9c
--- /dev/null
+++ b/tests/dat/actions/build.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+
+if [ -f ".built" ]; then
+ echo "Test zip artifacts already built, skipping"
+ exit 0
+fi
+
+(cd nodejs-test && zip ../nodejs-test.zip -r .)
+
+touch .built
diff --git a/tests/dat/actions/nodejs-test.zip b/tests/dat/actions/nodejs-test.zip
deleted file mode 100644
index c7483e3..0000000
Binary files a/tests/dat/actions/nodejs-test.zip and /dev/null differ
diff --git a/tests/build.gradle b/tests/dat/actions/nodejs-test/main.js
similarity index 52%
copy from tests/build.gradle
copy to tests/dat/actions/nodejs-test/main.js
index 1ae5a4b..453e9c8 100644
--- a/tests/build.gradle
+++ b/tests/dat/actions/nodejs-test/main.js
@@ -15,30 +15,12 @@
* limitations under the License.
*/
-apply plugin: 'scala'
-apply plugin: 'eclipse'
-compileTestScala.options.encoding = 'UTF-8'
-
-repositories {
- mavenCentral()
- mavenLocal()
-}
-
-tasks.withType(Test) {
- testLogging {
- events "passed", "skipped", "failed"
- showStandardStreams = true
- exceptionFormat = 'full'
- }
- outputs.upToDateWhen { false } // force tests to run every time
-}
-
-dependencies {
- compile "org.scala-lang:scala-library:${gradle.scala.version}"
- compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests"
- compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources"
+function main(args) {
+ let x = require('abcxyz')
+ return { "message": x() };
}
-tasks.withType(ScalaCompile) {
- scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
+module.exports = {
+ main: main,
+ niam: main
}
diff --git a/tests/build.gradle b/tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js
similarity index 52%
copy from tests/build.gradle
copy to tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js
index 1ae5a4b..ca6dea7 100644
--- a/tests/build.gradle
+++ b/tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js
@@ -15,30 +15,6 @@
* limitations under the License.
*/
-apply plugin: 'scala'
-apply plugin: 'eclipse'
-compileTestScala.options.encoding = 'UTF-8'
-
-repositories {
- mavenCentral()
- mavenLocal()
-}
-
-tasks.withType(Test) {
- testLogging {
- events "passed", "skipped", "failed"
- showStandardStreams = true
- exceptionFormat = 'full'
- }
- outputs.upToDateWhen { false } // force tests to run every time
-}
-
-dependencies {
- compile "org.scala-lang:scala-library:${gradle.scala.version}"
- compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests"
- compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources"
-}
-
-tasks.withType(ScalaCompile) {
- scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
+module.exports = function() {
+ return 'hello local library';
}
diff --git a/tests/dat/actions/nodejs-test/package.json b/tests/dat/actions/nodejs-test/package.json
new file mode 100644
index 0000000..2ee776e
--- /dev/null
+++ b/tests/dat/actions/nodejs-test/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "nodejs-zip",
+ "version": "1.0.0",
+ "description": "Zip to test NodeJS runtime against",
+ "main": "main.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "openwhisk": "^2.0.0"
+ }
+}
[openwhisk-runtime-nodejs] 01/02: add license header to *.tmpl files
Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-nodejs.git
commit 5ca1d863c425eb848dc7ed7282f16468313ac878
Author: David Grove <gr...@us.ibm.com>
AuthorDate: Thu Feb 13 11:53:15 2020 -0500
add license header to *.tmpl files
---
core/nodejsActionBase/docker-secret.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/helloworld/build.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/helloworld/service.yaml.tmpl | 17 +++++++++++++++++
.../helloworldwithparams/build-without-code.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/helloworldwithparams/build.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/helloworldwithparams/service.yaml.tmpl | 17 +++++++++++++++++
.../webactionhelloworld/build-without-code.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/webactionhelloworld/build.yaml.tmpl | 17 +++++++++++++++++
.../test/knative/webactionhelloworld/service.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/webactionraw/build.yaml.tmpl | 17 +++++++++++++++++
tests/src/test/knative/webactionraw/service.yaml.tmpl | 17 +++++++++++++++++
11 files changed, 187 insertions(+)
diff --git a/core/nodejsActionBase/docker-secret.yaml.tmpl b/core/nodejsActionBase/docker-secret.yaml.tmpl
index ea2ec2c..1ac49e9 100644
--- a/core/nodejsActionBase/docker-secret.yaml.tmpl
+++ b/core/nodejsActionBase/docker-secret.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: v1
kind: Secret
metadata:
diff --git a/tests/src/test/knative/helloworld/build.yaml.tmpl b/tests/src/test/knative/helloworld/build.yaml.tmpl
index fb327dc..1a11b4d 100644
--- a/tests/src/test/knative/helloworld/build.yaml.tmpl
+++ b/tests/src/test/knative/helloworld/build.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/helloworld/service.yaml.tmpl b/tests/src/test/knative/helloworld/service.yaml.tmpl
index 18eb93c..b623d16 100644
--- a/tests/src/test/knative/helloworld/service.yaml.tmpl
+++ b/tests/src/test/knative/helloworld/service.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
diff --git a/tests/src/test/knative/helloworldwithparams/build-without-code.yaml.tmpl b/tests/src/test/knative/helloworldwithparams/build-without-code.yaml.tmpl
index 623c9e2..5afbd5b 100644
--- a/tests/src/test/knative/helloworldwithparams/build-without-code.yaml.tmpl
+++ b/tests/src/test/knative/helloworldwithparams/build-without-code.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/helloworldwithparams/build.yaml.tmpl b/tests/src/test/knative/helloworldwithparams/build.yaml.tmpl
index 3d68459..0d16094 100644
--- a/tests/src/test/knative/helloworldwithparams/build.yaml.tmpl
+++ b/tests/src/test/knative/helloworldwithparams/build.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/helloworldwithparams/service.yaml.tmpl b/tests/src/test/knative/helloworldwithparams/service.yaml.tmpl
index 1259f97..5688ace 100644
--- a/tests/src/test/knative/helloworldwithparams/service.yaml.tmpl
+++ b/tests/src/test/knative/helloworldwithparams/service.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
diff --git a/tests/src/test/knative/webactionhelloworld/build-without-code.yaml.tmpl b/tests/src/test/knative/webactionhelloworld/build-without-code.yaml.tmpl
index 5892a29..c04482c 100644
--- a/tests/src/test/knative/webactionhelloworld/build-without-code.yaml.tmpl
+++ b/tests/src/test/knative/webactionhelloworld/build-without-code.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/webactionhelloworld/build.yaml.tmpl b/tests/src/test/knative/webactionhelloworld/build.yaml.tmpl
index 8c7a384..748a010 100644
--- a/tests/src/test/knative/webactionhelloworld/build.yaml.tmpl
+++ b/tests/src/test/knative/webactionhelloworld/build.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/webactionhelloworld/service.yaml.tmpl b/tests/src/test/knative/webactionhelloworld/service.yaml.tmpl
index aa4a123..d1abef9 100644
--- a/tests/src/test/knative/webactionhelloworld/service.yaml.tmpl
+++ b/tests/src/test/knative/webactionhelloworld/service.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
diff --git a/tests/src/test/knative/webactionraw/build.yaml.tmpl b/tests/src/test/knative/webactionraw/build.yaml.tmpl
index f4df3db..e1b719c 100644
--- a/tests/src/test/knative/webactionraw/build.yaml.tmpl
+++ b/tests/src/test/knative/webactionraw/build.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
diff --git a/tests/src/test/knative/webactionraw/service.yaml.tmpl b/tests/src/test/knative/webactionraw/service.yaml.tmpl
index 73c9ffb..f0816c2 100644
--- a/tests/src/test/knative/webactionraw/service.yaml.tmpl
+++ b/tests/src/test/knative/webactionraw/service.yaml.tmpl
@@ -1,3 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata: