Skip to content

Commit

Permalink
Put some unsolvable tests into methods filter (#714)
Browse files Browse the repository at this point in the history
Change-Id: Id853ede1bf8277ba2b942e3c502257e78ec23617
  • Loading branch information
Linary authored and zhoney committed Nov 8, 2019
1 parent 275b6d3 commit 6a126be
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -30,11 +30,15 @@ script:
fi
- |
if [[ "$TRAVIS_BRANCH" =~ $RELEASE_BRANCH ]]; then
mvn test -P tinkerpop-structure-test,$BACKEND
if [[ "$BACKEND" != "rocksdb" && "$BACKEND" != "hbase" ]]; then
mvn test -P tinkerpop-structure-test,$BACKEND
fi
fi
- |
if [[ "$TRAVIS_BRANCH" =~ $RELEASE_BRANCH ]]; then
mvn test -P tinkerpop-process-test,$BACKEND
if [[ "$BACKEND" != "rocksdb" && "$BACKEND" != "hbase" ]]; then
mvn test -P tinkerpop-process-test,$BACKEND
fi
fi
after_success:
Expand Down
Expand Up @@ -30,6 +30,8 @@
import org.apache.tinkerpop.gremlin.structure.io.graphson.TinkerPopJacksonModule;
import org.apache.tinkerpop.shaded.jackson.core.JsonGenerator;
import org.apache.tinkerpop.shaded.jackson.core.JsonParser;
import org.apache.tinkerpop.shaded.jackson.core.JsonToken;
import org.apache.tinkerpop.shaded.jackson.core.type.WritableTypeId;
import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
import org.apache.tinkerpop.shaded.jackson.databind.JsonSerializer;
import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
Expand Down Expand Up @@ -224,9 +226,11 @@ public void serializeWithType(T value,
SerializerProvider provider,
TypeSerializer typeSer)
throws IOException {
typeSer.writeTypePrefixForScalar(value, jsonGenerator);
// https://github.com/FasterXML/jackson-databind/issues/2320
WritableTypeId typeId = typeSer.typeId(value, JsonToken.VALUE_STRING);
typeSer.writeTypePrefix(jsonGenerator, typeId);
this.serialize(value, jsonGenerator, provider);
typeSer.writeTypeSuffixForScalar(value, jsonGenerator);
typeSer.writeTypeSuffix(jsonGenerator, typeId);
}
}

Expand Down
4 changes: 2 additions & 2 deletions hugegraph-dist/src/assembly/travis/install-cassandra.sh
Expand Up @@ -22,8 +22,8 @@ sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo ln -s /mnt/ramdisk $CASSA_PACKAGE/data

# config cassandra
sed -i "s/batch_size_warn_threshold_in_kb:.*/batch_size_warn_threshold_in_kb: 512/g" ${CASSA_PACKAGE}/conf/cassandra.yaml
sed -i "s/batch_size_fail_threshold_in_kb:.*/batch_size_fail_threshold_in_kb: 512/g" ${CASSA_PACKAGE}/conf/cassandra.yaml
sed -i "s/batch_size_warn_threshold_in_kb:.*/batch_size_warn_threshold_in_kb: 10240/g" ${CASSA_PACKAGE}/conf/cassandra.yaml
sed -i "s/batch_size_fail_threshold_in_kb:.*/batch_size_fail_threshold_in_kb: 10240/g" ${CASSA_PACKAGE}/conf/cassandra.yaml

# start cassandra service
sh ${CASSA_PACKAGE}/bin/cassandra
Expand Up @@ -147,6 +147,7 @@ public synchronized void open(HugeConfig config) {
"try to init CF later", this.store, this.namespace);
}

this.sessions.session();
LOG.debug("Store opened: {}", this.store);
}

Expand Down
Expand Up @@ -73,7 +73,6 @@
import org.apache.tinkerpop.gremlin.process.traversal.step.map.UnfoldTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.ValueMapTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.WriteTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ExplainTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
Expand All @@ -98,6 +97,7 @@
import org.junit.runners.model.Statement;

import com.baidu.hugegraph.dist.RegisterUtil;
import com.baidu.hugegraph.tinkerpop.tests.HugeGraphWriteTest;

/**
* Standard process test suite for tinkerpop graph
Expand Down Expand Up @@ -163,7 +163,8 @@ public class ProcessBasicSuite extends AbstractGremlinSuite {
VertexTest.Traversals.class,
UnfoldTest.Traversals.class,
ValueMapTest.Traversals.class,
WriteTest.Traversals.class,
// Override WriteTest.Traversals.class
HugeGraphWriteTest.class,

// sideEffect
AggregateTest.Traversals.class,
Expand Down
Expand Up @@ -35,6 +35,7 @@
import org.apache.tinkerpop.gremlin.structure.io.Io;

import com.baidu.hugegraph.HugeGraph;
import com.baidu.hugegraph.backend.store.BackendStoreSystemInfo;
import com.baidu.hugegraph.io.HugeGraphIoRegistry;
import com.baidu.hugegraph.io.HugeGraphSONModule;
import com.baidu.hugegraph.perf.PerfUtil.Watched;
Expand Down Expand Up @@ -74,7 +75,10 @@ public HugeGraph hugegraph() {

@Watched
protected void initBackend() {
this.graph.initBackend();
BackendStoreSystemInfo sysInfo = new BackendStoreSystemInfo(this.graph);
if (!sysInfo.exists()) {
this.graph.initBackend();
}
this.initedBackend = true;
}

Expand Down
Expand Up @@ -59,6 +59,7 @@
import com.baidu.hugegraph.util.E;
import com.baidu.hugegraph.util.Log;
import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.RateLimiter;

public class TestGraphProvider extends AbstractGraphProvider {

Expand Down Expand Up @@ -105,6 +106,9 @@ public class TestGraphProvider extends AbstractGraphProvider {
VertexPropertyFeatures.FEATURE_NUMERIC_IDS,
VertexPropertyFeatures.FEATURE_STRING_IDS);

private static final RateLimiter LOG_RATE_LIMITER =
RateLimiter.create(1.0 / 300);

private Map<String, String> blackMethods = new HashMap<>();
private Map<String, TestGraph> graphs = new HashMap<>();
private final String suite;
Expand Down Expand Up @@ -311,7 +315,10 @@ public Graph openTestGraph(final Configuration config) {
this.loadGraphData(testGraph, (LoadGraphWith.GraphData) loadGraph);
}

LOG.debug("Open graph '{}' for test '{}'", graphName, testMethod);
// Used for travis ci output log
if (LOG_RATE_LIMITER.tryAcquire(1)) {
LOG.info("Open graph '{}' for test '{}'", graphName, testMethod);
}
return testGraph;
}

Expand Down
@@ -0,0 +1,49 @@
/*
* 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 com.baidu.hugegraph.tinkerpop.tests;

import java.io.IOException;

import org.apache.tinkerpop.gremlin.process.traversal.IO;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.WriteTest;

import com.baidu.hugegraph.io.HugeGraphIoRegistry;

public class HugeGraphWriteTest extends WriteTest.Traversals {

@Override
public Traversal<Object, Object> get_g_io_write_withXwriter_gryoX(
String fileToWrite) throws IOException {
return g.io(fileToWrite)
.with(IO.writer, IO.gryo)
.with(IO.registry, HugeGraphIoRegistry.instance())
.write();
}

@Override
public Traversal<Object,Object> get_g_io_writeXkryoX(
final String fileToWrite)
throws IOException {
return g.io(fileToWrite)
.with(IO.registry, HugeGraphIoRegistry.instance())
.write();
}
}
8 changes: 8 additions & 0 deletions hugegraph-test/src/main/resources/fast-methods.filter
Expand Up @@ -53,6 +53,9 @@ org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGeneratorTest.Diffe
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeNumericLong: Not open the feature 'support user supplied id of numeric long' although numeric long id is allowed
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeNumericInt: Not open the feature 'support user supplied id of numeric long' although numeric long id is allowed

## user supplied uuid id
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeUuid: Not open the feature 'support user supplied id of uuid' although uuid id is allowed

## edge id format validate firstly and throw NotFoundException if invalid
org.apache.tinkerpop.gremlin.structure.GraphTest.shouldHaveExceptionConsistencyWhenFindEdgeByIdThatIsNonExistentViaIterator: Invalid format of edge id will introduce throwing NotFoundException before try to query in backend store

Expand All @@ -66,6 +69,11 @@ org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSeri
org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSerializePath: Vertex properties doesn't have nested structures with HugeVertexSerializer
org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSerializeTree: Vertex properties doesn't have nested structures with HugeVertexSerializer

## update property but no commit, lead there are changes in indexTx, can't do index query
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest.shouldConstructDetachedEdge: Can't do index query when there are changes in transaction
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest.shouldConstructDetachedEdgeAsReference: Can't do index query when there are changes in transaction
org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdgeTest.shouldConstructReferenceEdge: Can't do index query when there are changes in transaction

#################### process suite ####################

# unsupported automatic edge id, therefore number of edge is wrong
Expand Down
8 changes: 8 additions & 0 deletions hugegraph-test/src/main/resources/methods.filter
Expand Up @@ -53,6 +53,9 @@ org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGeneratorTest.Diffe
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeNumericLong: Not open the feature 'support user supplied id of numeric long' although numeric long id is allowed
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeNumericInt: Not open the feature 'support user supplied id of numeric long' although numeric long id is allowed

## user supplied uuid id
org.apache.tinkerpop.gremlin.structure.FeatureSupportTest.VertexFunctionalityTest.shouldSupportUserSuppliedIdsOfTypeUuid: Not open the feature 'support user supplied id of uuid' although uuid id is allowed

## edge id format validate firstly and throw NotFoundException if invalid
org.apache.tinkerpop.gremlin.structure.GraphTest.shouldHaveExceptionConsistencyWhenFindEdgeByIdThatIsNonExistentViaIterator: Invalid format of edge id will introduce throwing NotFoundException before try to query in backend store

Expand All @@ -66,6 +69,11 @@ org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSeri
org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSerializePath: Vertex properties doesn't have nested structures with HugeVertexSerializer
org.apache.tinkerpop.gremlin.structure.SerializationTest.GraphSONTest.shouldSerializeTree: Vertex properties doesn't have nested structures with HugeVertexSerializer

## update property but no commit, lead there are changes in indexTx, can't do index query
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest.shouldConstructDetachedEdge: Can't do index query when there are changes in transaction
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest.shouldConstructDetachedEdgeAsReference: Can't do index query when there are changes in transaction
org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdgeTest.shouldConstructReferenceEdge: Can't do index query when there are changes in transaction

#################### process suite ####################

# unsupported automatic edge id, therefore number of edge is wrong
Expand Down

0 comments on commit 6a126be

Please sign in to comment.