tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jorg...@apache.org
Subject [4/4] tinkerpop git commit: Support ignore scenarios
Date Tue, 28 Nov 2017 12:16:42 GMT
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/7f8aeb3e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7f8aeb3e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7f8aeb3e

Branch: refs/heads/TINKERPOP-1489
Commit: 7f8aeb3e9c0b6c3b4b36d5878baae159911887d5
Parents: 78190bd
Author: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Authored: Tue Nov 28 13:14:26 2017 +0100
Committer: Jorge Bay Gondra <jorgebaygondra@gmail.com>
Committed: Tue Nov 28 13:14:26 2017 +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/7f8aeb3e/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/7f8aeb3e/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;
   });
 });


Mime
View raw message