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 2021/11/03 10:52:05 UTC

[tinkerpop] branch master updated: Removed optional "integrate" and "performance" test suites

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git


The following commit(s) were added to refs/heads/master by this push:
     new 1d43c58  Removed optional "integrate" and "performance" test suites
1d43c58 is described below

commit 1d43c58217a6ba3cc8ec3f38ee0db43862f86360
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Wed Nov 3 06:49:30 2021 -0400

    Removed optional "integrate" and "performance" test suites
    
    Performance tests were removed long ago and there was only one integrate test which really just validated serialization size which really should be a given (though at the time it wasn't). The time on that test ran long and i think it just moved to "integrate" tests because it was "long" but a pool of integration tests never really developed. CTR
---
 docs/src/dev/provider/index.asciidoc               |   6 +-
 .../gremlin/structure/StructureIntegrateSuite.java |  52 ----------
 .../gremlin/structure/io/IoIntegrateTest.java      | 111 ---------------------
 .../TinkerGraphStructureIntegrateTest.java         |  35 -------
 4 files changed, 1 insertion(+), 203 deletions(-)

diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc
index 8992db1..78d51e9 100644
--- a/docs/src/dev/provider/index.asciidoc
+++ b/docs/src/dev/provider/index.asciidoc
@@ -33,7 +33,7 @@ This document attempts to address the needs of the different providers that have
 ** Graph Database Provider
 ** Graph Processor Provider
 * Graph Driver Provider
-* Graph Language Provider
+* Graph Language Provider
 * Graph Plugin Provider
 
 [[graph-system-provider-requirements]]
@@ -661,10 +661,6 @@ public class XXXProcessComputerTest {}
 public class XXXProcessStandardTest {}
 ----
 
-The above set of tests represent the minimum test suite set to implement.  There are other "integration" and
-"performance" tests that should be considered optional.  Implementing those tests requires the same pattern as shown
-above.
-
 IMPORTANT: It is as important to look at "ignored" tests as it is to look at ones that fail.  The `gremlin-test`
 suite utilizes the `Feature` implementation exposed by the `Graph` to determine which tests to execute.  If a test
 utilizes features that are not supported by the graph, it will ignore them.  While that may be fine, implementers
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureIntegrateSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureIntegrateSuite.java
deleted file mode 100644
index c8759a4..0000000
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/StructureIntegrateSuite.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
-import org.apache.tinkerpop.gremlin.structure.io.IoIntegrateTest;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.RunnerBuilder;
-
-/**
- * The {@code StructureIntegrationSuite} is a JUnit test runner that executes the Gremlin Test Suite over a
- * {@link Graph} implementation. This suite contains "long-run" tests that enforce various behaviors and
- * expectations of a vendor implementation of {@link Graph}. Its usage is optional to providers as the tests are
- * somewhat redundant to those found elsewhere in other required test suites.
- * <p/>
- * For more information on the usage of this suite, please see {@link StructureStandardSuite}.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class StructureIntegrateSuite extends AbstractGremlinSuite {
-
-    /**
-     * This list of tests in the suite that will be executed.  Gremlin developers should add to this list
-     * as needed to enforce tests upon implementations.
-     */
-    private static final Class<?>[] allTests = new Class<?>[]{
-            IoIntegrateTest.class
-    };
-
-    public StructureIntegrateSuite(final Class<?> klass, final RunnerBuilder builder) throws InitializationError {
-        super(klass, builder, allTests, null, false, TraversalEngine.Type.STANDARD);
-    }
-
-
-}
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoIntegrateTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoIntegrateTest.java
deleted file mode 100644
index c9ad223..0000000
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoIntegrateTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.structure.io;
-
-import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
-import org.apache.tinkerpop.gremlin.FeatureRequirement;
-import org.apache.tinkerpop.gremlin.TestHelper;
-import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
-import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
-import org.javatuples.Pair;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Random;
-import java.util.UUID;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class IoIntegrateTest extends AbstractGremlinTest {
-    private static final Logger logger = LoggerFactory.getLogger(IoIntegrateTest.class);
-
-    @Test
-    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
-    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
-    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
-    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
-    @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
-    @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_PROPERTY)
-    public void shouldHaveSizeOfStarGraphLessThanDetached() throws Exception {
-        final Random random = TestHelper.RANDOM;
-        final Vertex vertex = graph.addVertex("person");
-        for (int i = 0; i < 100; i++) { // vertex properties and meta properties
-            vertex.property(VertexProperty.Cardinality.list, UUID.randomUUID().toString(), random.nextDouble(),
-                    "acl", random.nextBoolean() ? "public" : "private",
-                    "created", random.nextLong());
-        }
-        for (int i = 0; i < 50000; i++) {  // edges and edge properties
-            vertex.addEdge("knows", graph.addVertex("person"), "since", random.nextLong(), "acl", random.nextBoolean() ? "public" : "private");
-            graph.addVertex("software").addEdge("createdBy", vertex, "date", random.nextLong());
-            graph.addVertex("group").addEdge("hasMember", vertex);
-        }
-        ///////////////
-        Pair<StarGraph, Integer> pair = serializeDeserialize(StarGraph.of(vertex));
-        int starGraphSize = pair.getValue1();
-        TestHelper.validateEquality(vertex, pair.getValue0().getStarVertex());
-        ///
-        pair = serializeDeserialize(pair.getValue0());
-        assertEquals(starGraphSize, pair.getValue1().intValue());
-        starGraphSize = pair.getValue1();
-        TestHelper.validateEquality(vertex, pair.getValue0().getStarVertex());
-        ///
-        pair = serializeDeserialize(pair.getValue0());
-        assertEquals(starGraphSize, pair.getValue1().intValue());
-        starGraphSize = pair.getValue1();
-        TestHelper.validateEquality(vertex, pair.getValue0().getStarVertex());
-        ///
-        // this is a rough approximation of "detached" serialization of all vertices and edges.
-        // now that writeVertex in gryo writes StarGraph that approach can't be used anymore to test
-        // serialization size of detached.
-        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        final GryoWriter writer = graph.io(IoCore.gryo()).writer().create();
-        writer.writeObject(outputStream, DetachedFactory.detach(vertex, true));
-        vertex.edges(Direction.BOTH).forEachRemaining(e -> writer.writeObject(outputStream, DetachedFactory.detach(e, true)));
-        final int detachedVertexSize = outputStream.size();
-        assertTrue(starGraphSize < detachedVertexSize);
-
-        logger.info("Size of star graph:        {}", starGraphSize);
-        logger.info("Size of detached vertex:   {}", detachedVertexSize);
-        logger.info("Size reduction:            {}", (float) detachedVertexSize / (float) starGraphSize);
-    }
-
-    private Pair<StarGraph, Integer> serializeDeserialize(final StarGraph starGraph) {
-        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        try {
-            graph.io(IoCore.gryo()).writer().create().writeObject(outputStream, starGraph);
-            return Pair.with(graph.io(IoCore.gryo()).reader().create().readObject(new ByteArrayInputStream(outputStream.toByteArray()), StarGraph.class), outputStream.size());
-        } catch (IOException ioe) {
-            throw new RuntimeException(ioe);
-        }
-    }
-
-}
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphStructureIntegrateTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphStructureIntegrateTest.java
deleted file mode 100644
index fd92ec9..0000000
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphStructureIntegrateTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tinkerpop.gremlin.tinkergraph.structure;
-
-import org.apache.tinkerpop.gremlin.GraphProviderClass;
-import org.apache.tinkerpop.gremlin.structure.StructureIntegrateSuite;
-import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
-import org.junit.runner.RunWith;
-
-/**
- * Executes the Gremlin Structure Performance Test Suite using TinkerGraph.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-@RunWith(StructureIntegrateSuite.class)
-@GraphProviderClass(provider = TinkerGraphProvider.class, graph = TinkerGraph.class)
-public class TinkerGraphStructureIntegrateTest {
-
-}
\ No newline at end of file