Support ignore scenarios
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f9f7033e Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f9f7033e Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f9f7033e Branch: refs/heads/master Commit: f9f7033ed3abd9aaadc7203054fed9554315a78f Parents: b8eb6c0 Author: Jorge Bay Gondra <jorgebaygon...@gmail.com> Authored: Tue Nov 28 13:14:26 2017 +0100 Committer: Jorge Bay Gondra <jorgebaygon...@gmail.com> Committed: Fri Jan 19 09:30:16 2018 +0100 ---------------------------------------------------------------------- .../test/cucumber/feature-steps.js | 20 ++++++++++++++------ .../gremlin-javascript/test/cucumber/world.js | 4 +++- 2 files changed, 17 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f9f7033e/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js ---------------------------------------------------------------------- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js index 99e2ec8..06a3283 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js @@ -52,8 +52,20 @@ const parsers = [ [ 'c\\[(.+)\\]', toLambda ] ].map(x => [ new RegExp('^' + x[0] + '$'), x[1] ]); +const ignoreReason = { + lambdaNotSupported: 'Lambdas are not supported on gremlin-javascript', +}; + +const ignoredScenarios = { + // An associative array containing the scenario name as key, for example: + // 'g_V_branchXlabel_eq_person': new IgnoreError(ignoreReason.lambdaNotSupported), +}; + defineSupportCode(function(methods) { methods.Given(/^the (.+) graph$/, function (graphName) { + if (ignoredScenarios[this.scenario]) { + return 'skipped'; + } this.graphName = graphName; const data = this.getData(); this.g = new Graph().traversal().withRemote(data.connection); @@ -282,7 +294,7 @@ function parseMapValue(value) { } function toLambda() { - throw new IgnoreError(IgnoreError.reason.lambdaNotSupported); + throw new IgnoreError(ignoreReason.lambdaNotSupported); } /** @@ -310,8 +322,4 @@ function IgnoreError(reason) { Error.captureStackTrace(this, IgnoreError); } -util.inherits(IgnoreError, Error); - -IgnoreError.reason = { - lambdaNotSupported: 'Lambdas are not supported on gremlin-javascript', -}; \ No newline at end of file +util.inherits(IgnoreError, Error); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f9f7033e/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/world.js ---------------------------------------------------------------------- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/world.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/world.js index 03febd1..ae3f9a6 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/world.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/world.js @@ -33,6 +33,7 @@ defineSupportCode(function (methods) { const cache = {}; function TinkerPopWorld(){ + this.scenario = null; this.g = null; this.traversal = null; this.result = null; @@ -91,7 +92,8 @@ defineSupportCode(function (methods) { return Promise.all(Object.keys(cache).map(graphName => cache[graphName].connection.close())); }); - methods.Before(function () { + methods.Before(function (info) { + this.scenario = info.pickle.name; this.cache = cache; }); });