This is an automated email from the ASF dual-hosted git repository. dubeejw pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-js.git
The following commit(s) were added to refs/heads/master by this push: new 80075e3 Fixes #100 (#102) 80075e3 is described below commit 80075e32cb4abc85dd1e655d2ffebd292c8877b8 Author: James Thomas <jthomas...@gmail.com> AuthorDate: Tue Mar 13 20:21:09 2018 +0000 Fixes #100 (#102) Connect echo action to trigger with rule to ensure result has activation identifier. --- README.md | 6 +++--- test/integration/triggers.test.js | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 81cdbb2..8d6af41 100644 --- a/README.md +++ b/README.md @@ -493,16 +493,16 @@ Swagger parameter must be a well-formed JSON string, containing a valid Swagger ## Debugging -Setting an environment parameter (`NODE_DEBUG=request`) will dump the HTTP requests from the client library and responses received to `stderr`. +Setting an environment parameter (`DEBUG=needle`) will dump the HTTP requests from the client library and responses received to `stderr`. ```bash -NODE_DEBUG=request node script.js +DEBUG=needle node script.js ``` This parameter can also be set dynamically at runtime, provided this happens before the `openwhisk` module is required. ```javascript -process.env.NODE_DEBUG='request'; +process.env.DEBUG='needle'; var openwhisk = require('openwhisk'); ``` diff --git a/test/integration/triggers.test.js b/test/integration/triggers.test.js index 4b68e2b..04515db 100644 --- a/test/integration/triggers.test.js +++ b/test/integration/triggers.test.js @@ -5,11 +5,12 @@ const test = require('ava') const Triggers = require('../../lib/triggers.js') +const Rules = require('../../lib/rules.js') const Client = require('../../lib/client.js') const Utils = require('./utils.js') const envParams = ['API_KEY', 'API_HOST', 'NAMESPACE'] -const options = Utils.autoOptions(); +const options = Utils.autoOptions() // check that mandatory configuration properties are available envParams.forEach(key => { @@ -52,7 +53,7 @@ test('list all triggers using options namespace', t => { test('get a non-existing trigger, expecting 404', async t => { const triggers = new Triggers(new Client(options)) await triggers.get({name: 'glorfindel'}).catch(err => { - t.is(err.statusCode, 404) + t.is(err.statusCode, 404) }) }) @@ -107,11 +108,16 @@ test('fire a trigger', t => { } const triggers = new Triggers(new Client(options)) + const rules = new Rules(new Client(options)) + return triggers.create({triggerName: 'random_fire_test'}).then(result => { - return triggers.invoke({triggerName: 'random_fire_test'}).then(update_result => { - t.true(update_result.hasOwnProperty('activationId')) - t.pass() - return triggers.delete({triggerName: 'random_fire_test'}).catch(errors) + return rules.create({ruleName: 'echo_rule', action: `/whisk.system/utils/echo`, trigger: `/${NAMESPACE}/random_fire_test`}).then(rule_result => { + return triggers.invoke({triggerName: 'random_fire_test'}).then(update_result => { + t.true(update_result.hasOwnProperty('activationId')) + t.pass() + return triggers.delete({triggerName: 'random_fire_test'}) + .then(() => rules.delete({ruleName: 'echo_rule'})) + }).catch(errors) }).catch(errors) }).catch(errors) }) -- To stop receiving notification emails like this one, please contact dube...@apache.org.