build nodejs-test.zip from source before running tests
diff --git a/.gitignore b/.gitignore
index 0bc5144..d5aef40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,14 +61,6 @@
 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 @@
 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
--- a/tests/dat/actions/nodejs-test.zip
+++ /dev/null
Binary files differ
diff --git a/tests/dat/actions/nodejs-test/main.js b/tests/dat/actions/nodejs-test/main.js
new file mode 100644
index 0000000..453e9c8
--- /dev/null
+++ b/tests/dat/actions/nodejs-test/main.js
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+function main(args) {
+  let x = require('abcxyz')
+  return { "message": x() };
+}
+
+module.exports = {
+  main: main,
+  niam: main
+}
diff --git a/tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js b/tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js
new file mode 100644
index 0000000..ca6dea7
--- /dev/null
+++ b/tests/dat/actions/nodejs-test/node_modules/abcxyz/index.js
@@ -0,0 +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.
+ */
+
+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"
+  }
+}