You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2025/04/16 12:21:39 UTC
(tinkerpop) 01/02: Centralized graph computer test tag set
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch TINKERPOP-3136
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 55df4fd2c4526674ddb028036d67f72ce5f17edc
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Wed Apr 16 07:55:41 2025 -0400
Centralized graph computer test tag set
---
.../GraphBinaryRemoteComputerFeatureTest.java | 2 +-
.../remote/GraphSONRemoteComputerFeatureTest.java | 2 +-
.../driver/remote/GraphSONRemoteFeatureTest.java | 2 +-
.../gremlin/driver/remote/RemoteWorld.java | 37 ----------------------
.../apache/tinkerpop/gremlin/features/World.java | 15 +++++++++
.../spark/SparkGraphFeatureIntegrateTest.java | 9 ++----
.../TinkerGraphComputerFeatureTest.java | 2 +-
.../TinkerTransactionGraphComputerFeatureTest.java | 2 +-
.../tinkerpop/gremlin/tinkergraph/TinkerWorld.java | 28 ----------------
9 files changed, 22 insertions(+), 77 deletions(-)
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphBinaryRemoteComputerFeatureTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphBinaryRemoteComputerFeatureTest.java
index 0d04270b1f..3be1c8a509 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphBinaryRemoteComputerFeatureTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphBinaryRemoteComputerFeatureTest.java
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly",
+ tags = World.GRAPHCOMPUTER_TAG_FILTER,
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = GraphBinaryRemoteComputerFeatureTest.RemoteGuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java
index 2f9b17742b..22fed68201 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly",
+ tags = World.GRAPHCOMPUTER_TAG_FILTER + " and not @StepSubgraph", // TINKERPOP-3154
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = GraphSONRemoteComputerFeatureTest.RemoteGuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteFeatureTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteFeatureTest.java
index 901ac413b1..6eeba5dc9a 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteFeatureTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteFeatureTest.java
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly and not @GraphComputerOnly and not @AllowNullPropertyValues",
+ tags = "not @RemoteOnly and not @GraphComputerOnly and not @AllowNullPropertyValues and not @StepSubgraph", // TINKERPOP-3154
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = GraphSONRemoteFeatureTest.RemoteGuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java
index 966d50cf4a..5735a67f8f 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java
@@ -111,23 +111,6 @@ public abstract class RemoteWorld implements World {
* instances that include the VertexProgramStrategy.
*/
public abstract static class RemoteComputerWorld extends RemoteWorld {
- private static final List<String> TAGS_TO_IGNORE = Arrays.asList(
- "@StepDrop",
- "@StepInject",
- "@StepMidV",
- "@StepMidE",
- "@StepSubgraph",
- "@InsertionOrderingRequired",
- "@StepIndex",
- "@GraphComputerVerificationElementSupported",
- "@GraphComputerVerificationOneBulk",
- "@GraphComputerVerificationStrategyNotSupported",
- "@GraphComputerVerificationMidENotSupported",
- "@GraphComputerVerificationMidVNotSupported",
- "@GraphComputerVerificationInjectionNotSupported",
- "@GraphComputerVerificationStarGraphExceeded",
- "@GraphComputerVerificationReferenceOnly",
- "@TinkerServiceRegistry");
private final int AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors();
@@ -135,15 +118,6 @@ public abstract class RemoteWorld implements World {
super(cluster);
}
- @Override
- public void beforeEachScenario(final Scenario scenario) {
- final List<String> ignores = TAGS_TO_IGNORE.stream().filter(t -> scenario.getSourceTagNames().contains(t)).collect(Collectors.toList());
- if (!ignores.isEmpty())
- throw new AssumptionViolatedException(String.format("This scenario is not supported with GraphComputer: %s", ignores));
-
- super.beforeEachScenario(scenario);
- }
-
@Override
public GraphTraversalSource getGraphTraversalSource(final LoadGraphWith.GraphData graphData) {
if (null == graphData) throw new AssumptionViolatedException("GraphComputer does not support mutation");
@@ -180,17 +154,6 @@ public abstract class RemoteWorld implements World {
public static class GraphSONRemoteWorld extends RemoteWorld {
public GraphSONRemoteWorld() { super(createTestCluster(Serializers.GRAPHSON_V3)); }
-
- @Override
- public void beforeEachScenario(final Scenario scenario) {
- // not sure if it is expected or not that subgraph() does not work with GraphSON fully.
- // getting serialization problems
- final List<String> ignores = Arrays.asList("@StepSubgraph").stream().filter(t -> scenario.getSourceTagNames().contains(t)).collect(Collectors.toList());
- if (!ignores.isEmpty())
- throw new AssumptionViolatedException(String.format("This scenario is not supported with GraphComputer: %s", ignores));
-
- super.beforeEachScenario(scenario);
- }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/World.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/World.java
index 52a977e614..ec0fb4f447 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/World.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/World.java
@@ -19,6 +19,7 @@
package org.apache.tinkerpop.gremlin.features;
import io.cucumber.java.Scenario;
+import io.cucumber.junit.CucumberOptions;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.T;
@@ -33,6 +34,20 @@ import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData;
*/
public interface World {
+ /**
+ * Tag filter string for tests that will not run for tests using {@code withComputer()}. This is a helpful start
+ * point to filtering away tests using the "tags" argument for {@link CucumberOptions}.
+ */
+ public static final String GRAPHCOMPUTER_TAG_FILTER =
+ "not @RemoteOnly and " +
+ "not @StepDrop and not @StepV and not @StepE and not @StepIndex and not @StepInject and " +
+ "not @StepSubgraph and not @GraphComputerVerificationMidENotSupported and " +
+ "not @GraphComputerVerificationOneBulk and not @GraphComputerVerificationStrategyNotSupported and " +
+ "not @GraphComputerVerificationMidVNotSupported and not @GraphComputerVerificationElementSupported and " +
+ "not @GraphComputerVerificationInjectionNotSupported and " +
+ "not @GraphComputerVerificationStarGraphExceeded and not @GraphComputerVerificationReferenceOnly and " +
+ "not @TinkerServiceRegistry and not @InsertionOrderingRequired";
+
/**
* Gets a {@link GraphTraversalSource} that is backed by the specified {@link GraphData}. For {@code null}, the
* returned source should be an empty graph with no data in it. Tests do not mutate the standard graphs. Only tests
diff --git a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGraphFeatureIntegrateTest.java b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGraphFeatureIntegrateTest.java
index 404bad3830..bcbeaa6d9f 100644
--- a/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGraphFeatureIntegrateTest.java
+++ b/spark-gremlin/src/test/java/org/apache/tinkerpop/gremlin/spark/SparkGraphFeatureIntegrateTest.java
@@ -54,16 +54,11 @@ import java.util.Map;
import java.util.Optional;
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData;
+import static org.apache.tinkerpop.gremlin.features.World.GRAPHCOMPUTER_TAG_FILTER;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly and not @StepDrop and not @StepV and not @StepE and not @StepIndex and not @StepInject and " +
- "not @StepSubgraph and not @GraphComputerVerificationMidENotSupported and " +
- "not @GraphComputerVerificationOneBulk and not @GraphComputerVerificationStrategyNotSupported and " +
- "not @GraphComputerVerificationMidVNotSupported and not @GraphComputerVerificationElementSupported and " +
- "not @GraphComputerVerificationInjectionNotSupported and " +
- "not @GraphComputerVerificationStarGraphExceeded and not @GraphComputerVerificationReferenceOnly and " +
- "not @TinkerServiceRegistry and not @InsertionOrderingRequired and not @WithElementIdStrategy",
+ tags = GRAPHCOMPUTER_TAG_FILTER + " and not @WithElementIdStrategy",
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = GuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphComputerFeatureTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphComputerFeatureTest.java
index 51b39756e4..c3145bface 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphComputerFeatureTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerGraphComputerFeatureTest.java
@@ -31,7 +31,7 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly",
+ tags = World.GRAPHCOMPUTER_TAG_FILTER,
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = TinkerGraphComputerFeatureTest.TinkerGraphGuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerTransactionGraphComputerFeatureTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerTransactionGraphComputerFeatureTest.java
index 748c6dd609..5b85e0d37f 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerTransactionGraphComputerFeatureTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerTransactionGraphComputerFeatureTest.java
@@ -31,7 +31,7 @@ import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(
- tags = "not @RemoteOnly",
+ tags = World.GRAPHCOMPUTER_TAG_FILTER,
glue = { "org.apache.tinkerpop.gremlin.features" },
objectFactory = TinkerTransactionGraphComputerFeatureTest.TinkerGraphGuiceFactory.class,
features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" },
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerWorld.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerWorld.java
index ca94f2d7ea..0d69f0b0c7 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerWorld.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/TinkerWorld.java
@@ -280,25 +280,6 @@ public abstract class TinkerWorld implements World {
public static class ComputerWorld implements World {
private static final Random RANDOM = TestHelper.RANDOM;
- /**
- * Defining these here allows them to be globally ignored for all {@code withComputer()} test setups.
- */
- private static final List<String> TAGS_TO_IGNORE = Arrays.asList(
- "@StepDrop",
- "@StepInject",
- "@StepSubgraph",
- "@InsertionOrderingRequired",
- "@StepIndex",
- "@GraphComputerVerificationElementSupported",
- "@GraphComputerVerificationOneBulk",
- "@GraphComputerVerificationStrategyNotSupported",
- "@GraphComputerVerificationMidENotSupported",
- "@GraphComputerVerificationMidVNotSupported",
- "@GraphComputerVerificationInjectionNotSupported",
- "@GraphComputerVerificationStarGraphExceeded",
- "@GraphComputerVerificationReferenceOnly",
- "@TinkerServiceRegistry");
-
private final World world;
public ComputerWorld(final World world) { this.world = world; }
@@ -316,15 +297,6 @@ public abstract class TinkerWorld implements World {
}})));
}
- @Override
- public void beforeEachScenario(final Scenario scenario) {
- final List<String> ignores = TAGS_TO_IGNORE.stream().filter(t -> scenario.getSourceTagNames().contains(t)).collect(Collectors.toList());
- if (!ignores.isEmpty())
- throw new AssumptionViolatedException(String.format("This scenario is not supported with GraphComputer: %s", ignores));
-
- this.world.beforeEachScenario(scenario);
- }
-
@Override
public void afterEachScenario() {
this.world.afterEachScenario();