This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-nodejs.git
The following commit(s) were added to refs/heads/master by this push: new e6ba802 Switch to Maven based dependency (#21) e6ba802 is described below commit e6ba802c499c25fb0fae5e85254742f67be1adab Author: Chetan Mehrotra <chet...@apache.org> AuthorDate: Thu Mar 1 07:42:44 2018 +0530 Switch to Maven based dependency (#21) --- README.md | 30 ++++++++++++++++++++++++++++++ ansible/environments/local/group_vars/all | 5 +++-- settings.gradle | 16 ++++------------ tests/build.gradle | 7 +++---- tools/travis/build.sh | 21 +++++++++++---------- 5 files changed, 51 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 4d6d23d..5079c05 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,36 @@ ln -s ${ROOTDIR}/ansible/environments/local ${OPENWHISK_HOME}/ansible/environmen wskdev fresh -t local-nodejs ``` +### Testing +Install dependencies from the root directory on $OPENWHISK_HOME repository +``` +./gradlew install +``` + +Using gradle for the ActionContainer tests you need to use a proxy if running on Mac, if Linux then don't use proxy options +You can pass the flags `-Dhttp.proxyHost=localhost -Dhttp.proxyPort=3128` directly in gradle command. +Or save in your `$HOME/.gradle/gradle.properties` +``` +systemProp.http.proxyHost=localhost +systemProp.http.proxyPort=3128 +``` +Using gradle to run all tests +``` +./gradlew :tests:test +``` +Using gradle to run some tests +``` +./gradlew :tests:test --tests *ActionContainerTests* +``` +Using IntelliJ: +- Import project as gradle project. +- Make sure working directory is root of the project/repo +- Add the following Java VM properties in ScalaTests Run Configuration, easiest is to change the Defaults for all ScalaTests to use this VM properties +``` +-Dhttp.proxyHost=localhost +-Dhttp.proxyPort=3128 +``` + # License [Apache 2.0](LICENSE.txt) diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all index b3f5b82..a1af820 100755 --- a/ansible/environments/local/group_vars/all +++ b/ansible/environments/local/group_vars/all @@ -1,6 +1,7 @@ whisk_version_name: local -config_root_dir: /tmp/wskconf -whisk_logs_dir: /tmp/wsklogs +openwhisk_tmp_dir: "{{ lookup('env', 'OPENWHISK_TMP_DIR')|default('/tmp', true) }}" +config_root_dir: "{{ openwhisk_tmp_dir }}/wskconf" +whisk_logs_dir: "{{ openwhisk_tmp_dir }}/wsklogs" docker_registry: "" docker_dns: "" diff --git a/settings.gradle b/settings.gradle index 7f639a8..c304cf9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,15 +1,3 @@ -def owPath = System.getenv("OPENWHISK_HOME") ?: '../open' -def owDirectory = new File(owPath) - -if (!owDirectory.exists()) { - throw new GradleScriptException("Environment variable OPENWHISK_HOME must point to a valid OpenWhisk build", null) -} - -include 'common:scala'; project(':common:scala').projectDir = new File(owDirectory, 'common/scala') -include 'core:controller'; project(':core:controller').projectDir = new File(owDirectory, 'core/controller') -include 'core:invoker'; project(':core:invoker').projectDir = new File(owDirectory, 'core/invoker') -include 'whisktests'; project(':whisktests').projectDir = new File(owDirectory, 'tests') - include 'tests' include 'core:nodejsActionBase' @@ -19,6 +7,10 @@ include 'core:nodejs8Action' rootProject.name = 'runtime-nodejs' +gradle.ext.openwhisk = [ + version: '1.0.0-SNAPSHOT' +] + gradle.ext.scala = [ version: '2.11.11', compileFlags: ['-feature', '-unchecked', '-deprecation', '-Xfatal-warnings', '-Ywarn-unused-import'] diff --git a/tests/build.gradle b/tests/build.gradle index 124229c..3b60d6c 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -2,10 +2,9 @@ apply plugin: 'scala' apply plugin: 'eclipse' compileTestScala.options.encoding = 'UTF-8' -evaluationDependsOn(':whisktests') - repositories { mavenCentral() + mavenLocal() } tasks.withType(Test) { @@ -19,8 +18,8 @@ tasks.withType(Test) { dependencies { compile "org.scala-lang:scala-library:${gradle.scala.version}" - compile project(':whisktests') - compile project(':whisktests').sourceSets.test.output + compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests" + compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources" } tasks.withType(ScalaCompile) { diff --git a/tools/travis/build.sh b/tools/travis/build.sh index 30371d7..52ab2f1 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -11,14 +11,6 @@ export OPENWHISK_HOME=$WHISKDIR IMAGE_PREFIX="testing" -# Build runtime -cd $ROOTDIR -TERM=dumb ./gradlew \ -:core:nodejs6Action:distDocker \ -:core:nodejs8Action:distDocker \ --PdockerImagePrefix=${IMAGE_PREFIX} - - # Build OpenWhisk cd $WHISKDIR @@ -30,6 +22,15 @@ docker tag openwhisk/invoker ${IMAGE_PREFIX}/invoker docker pull openwhisk/nodejs6action docker tag openwhisk/nodejs6action ${IMAGE_PREFIX}/nodejs6action +TERM=dumb ./gradlew \ +:common:scala:install \ +:core:controller:install \ +:core:invoker:install \ +:tests:install - - +# Build runtime +cd $ROOTDIR +TERM=dumb ./gradlew \ +:core:nodejs6Action:distDocker \ +:core:nodejs8Action:distDocker \ +-PdockerImagePrefix=${IMAGE_PREFIX} -- To stop receiving notification emails like this one, please contact csantan...@apache.org.