Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put some unsolvable tests into methods filter #714

Merged
merged 7 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some comments

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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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