Skip to content

Commit

Permalink
Merge branch 'tp32' into tp33
Browse files Browse the repository at this point in the history
Conflicts:
	data/tinkerpop-sink.json
	gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
	gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy
	gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
	gremlin-python/src/main/jython/radish/feature_steps.py
	gremlin-python/src/main/jython/tests/conftest.py
	gremlin-python/src/main/jython/tests/driver/test_client.py
	gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinResultSetIntegrateTest.java
	gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerHttpIntegrateTest.java
	gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
	gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
	gremlin-test/features/map/AddVertex.feature
	gremlin-test/features/map/Properties.feature
	gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
	gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink-typed.json
	gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/graphson/tinkerpop-sink.json
	gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
  • Loading branch information
spmallette committed Jun 1, 2018
2 parents ae8fee7 + 1a0947b commit f2e74ff
Show file tree
Hide file tree
Showing 51 changed files with 886 additions and 325 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Fixed bug in `branch()` where reducing steps as options would produce incorrect results.
* Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors.
* Improved performance of `TraversalVertexProgram` and related infrastructure.
* Added `createGratefulDead()`to `TinkerFactory` to help make it easier to try to instantiate that toy graph.
* Added identifiers to edges in the Kitchen Sink toy graph.
* Refactored the Gremlin Server integration testing framework and streamlined that infrastructure.
* Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects.
* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it.
* Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element.
Expand Down
6 changes: 3 additions & 3 deletions data/tinkerpop-sink.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{"id":{"@type":"g:Int32","@value":2000},"label":"message","inE":{"link":[{"id":{"@type":"g:Int32","@value":5},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"link":[{"id":{"@type":"g:Int32","@value":4},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":5},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"a"}]}}
{"id":{"@type":"g:Int32","@value":2001},"label":"message","inE":{"link":[{"id":{"@type":"g:Int32","@value":4},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":3},"value":"b"}]}}
{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
{"id":{"@type":"g:Int32","@value":2000},"label":"message","inE":{"link":[{"id":{"@type":"g:Int32","@value":2003},"outV":{"@type":"g:Int32","@value":2000}}]},"outE":{"link":[{"id":{"@type":"g:Int32","@value":2002},"inV":{"@type":"g:Int32","@value":2001}},{"id":{"@type":"g:Int32","@value":2003},"inV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":1},"value":"a"}]}}
{"id":{"@type":"g:Int32","@value":2001},"label":"message","inE":{"link":[{"id":{"@type":"g:Int32","@value":2002},"outV":{"@type":"g:Int32","@value":2000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"b"}]}}
{"id":{"@type":"g:Int32","@value":1000},"label":"loops","inE":{"self":[{"id":{"@type":"g:Int32","@value":1001},"outV":{"@type":"g:Int32","@value":1000}}]},"outE":{"self":[{"id":{"@type":"g:Int32","@value":1001},"inV":{"@type":"g:Int32","@value":1000}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"loop"}]}}
Binary file modified data/tinkerpop-sink.kryo
Binary file not shown.
5 changes: 2 additions & 3 deletions docs/src/tutorials/the-gremlin-console/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ However, if you find that a larger graph might be helpful, there is another opti
[gremlin-groovy]
----
graph = TinkerGraph.open()
graph.io(gryo()).readGraph('data/grateful-dead.kryo')
graph
graph = TinkerFactory.createGratefulDead()
g = graph.traversal()
----
The Grateful Dead graph ships with the Gremlin Console and the data can be found in several formats (along with the
Expand Down
8 changes: 8 additions & 0 deletions docs/src/upgrade/release-3.2.x-incubating.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
Please see the link:https://github.com/apache/tinkerpop/blob/3.2.10/CHANGELOG.asciidoc#release-3-2-10[changelog] for a complete list of all the modifications that are part of this release.
=== Upgrading for Users
==== TinkerFactory.createGratefulDead()
The Grateful Dead dataset has been with TinkerPop since the early days of 1.x. It has always been available as a
packaged dataset that needed to be loaded through the various IO options available, while other toy graphs had the
benefit of `TinkerFactory` to help get them bootstrapped. For 3.2.10, Grateful Dead is now more conveniently loaded
via that same method as the other toy graphs with `TinkerFactory.createGratefulDead()`.
== TinkerPop 3.2.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public class GherkinTestRunner
new Dictionary<string, IgnoreReason>()
{
{ "g_injectX1X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason },
{ "g_injectX2X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason }
{ "g_injectX2X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason },
{ "g_V_asXa_bX_out_asXcX_path_selectXkeysX", IgnoreReason.EmbeddedListAssertion }
};

private static class Keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ private static string GetMessage(IgnoreReason reason)
string reasonSuffix = null;
switch (reason)
{
case IgnoreReason.EmbeddedListAssertion:
reasonSuffix = "This test returns an embedded list in the result and the Gherkin processor does not parse that correctly";
break;
case IgnoreReason.NoReason:
reasonSuffix = "";
break;
Expand All @@ -55,6 +58,7 @@ public enum IgnoreReason
/// </summary>
TraversalTDeserializationNotSupported,
ReceivedDataDoesntMatchExpected,
NoReason
NoReason,
EmbeddedListAssertion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ internal class ModernGraphTypeInformation
{"lang", typeof(string)},
{"weight", typeof(float)},
{"foo", typeof(object)}, // used when for invalid property key lookups
{"friendWeight", typeof(float)} // used in an AddVertex.feature test
{"friendWeight", typeof(float)}, // used in an AddVertex.feature test
{"performances", typeof(int)} // grateful dead graph
};

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion gremlin-dotnet/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ limitations under the License.
</property>
<property>
<name>settingsFile</name>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml</value>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml</value>
</property>
<property>
<name>executionName</name>
Expand Down
2 changes: 1 addition & 1 deletion gremlin-javascript/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ limitations under the License.
</property>
<property>
<name>settingsFile</name>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml</value>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml</value>
</property>
<property>
<name>executionName</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ const parsers = [

const ignoreReason = {
lambdaNotSupported: 'Lambdas are not supported on gremlin-javascript',
embeddedListAssertion: '"This test returns an embedded list in the result and the Gherkin processor does not parse that correctly"',
needsFurtherInvestigation: '',
};

const ignoredScenarios = {
// An associative array containing the scenario name as key, for example:
// 'g_V_branchXlabel_eq_person': new IgnoreError(ignoreReason.lambdaNotSupported),
'g_V_asXa_bX_out_asXcX_path_selectXkeysX': new IgnoreError(ignoreReason.embeddedListAssertion),
};

defineSupportCode(function(methods) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let connection;

describe('DriverRemoteConnection', function () {
before(function () {
connection = helper.getConnection();
connection = helper.getConnection('gmodern');
return connection.open();
});
after(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let connection;

describe('Traversal', function () {
before(function () {
connection = helper.getConnection();
connection = helper.getConnection('gmodern');
return connection.open();
});
after(function () {
Expand Down
2 changes: 1 addition & 1 deletion gremlin-python/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ limitations under the License.
</property>
<property>
<name>settingsFile</name>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml</value>
<value>${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml</value>
</property>
<property>
<name>executionName</name>
Expand Down
2 changes: 1 addition & 1 deletion gremlin-python/src/main/jython/radish/feature_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
project = __.project
tail = __.tail

ignores = []
ignores = ["g.V().as(\"a\", \"b\").out().as(\"c\").path().select(Column.keys)"]


@given("the {graph_name:w} graph")
Expand Down
8 changes: 4 additions & 4 deletions gremlin-python/src/main/jython/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def connection(request):
executor = concurrent.futures.ThreadPoolExecutor(5)
pool = queue.Queue()
try:
conn = Connection('ws://localhost:45940/gremlin', 'g', protocol,
conn = Connection('ws://localhost:45940/gremlin', 'gmodern', protocol,
lambda: TornadoTransport(), executor, pool)
except OSError:
executor.shutdown()
Expand All @@ -56,7 +56,7 @@ def fin():
@pytest.fixture
def client(request):
try:
client = Client('ws://localhost:45940/gremlin', 'g')
client = Client('ws://localhost:45940/gremlin', 'gmodern')
except OSError:
pytest.skip('Gremlin Server is not running')
else:
Expand All @@ -69,10 +69,10 @@ def fin():
def remote_connection(request):
try:
if request.param == 'v2':
remote_conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g',
remote_conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'gmodern',
message_serializer=serializer.GraphSONSerializersV2d0())
else:
remote_conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'g')
remote_conn = DriverRemoteConnection('ws://localhost:45940/gremlin', 'gmodern')
except OSError:
pytest.skip('Gremlin Server is not running')
else:
Expand Down
18 changes: 9 additions & 9 deletions gremlin-python/src/main/jython/tests/driver/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
def test_connection(connection):
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
results_set = connection.write(message).result()
future = results_set.all()
results = future.result()
Expand All @@ -52,15 +52,15 @@ def test_client_eval_traversal(client):
def test_client_bytecode(client):
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
result_set = client.submit(message)
assert len(result_set.all().result()) == 6


def test_iterate_result_set(client):
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
result_set = client.submit(message)
results = []
for result in result_set:
Expand All @@ -71,19 +71,19 @@ def test_iterate_result_set(client):
def test_client_async(client):
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
future = client.submitAsync(message)
result_set = future.result()
assert len(result_set.all().result()) == 6


def test_connection_share(client):
# Overwrite fixture with pool_size=1 client
client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1)
client = Client('ws://localhost:45940/gremlin', 'gmodern', pool_size=1)
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
future = client.submitAsync(message)
future2 = client.submitAsync(message2)

Expand All @@ -99,8 +99,8 @@ def test_connection_share(client):
def test_multi_conn_pool(client):
g = Graph().traversal()
t = g.V()
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode})
message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}})
client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1)
future = client.submitAsync(message)
future2 = client.submitAsync(message2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class TestDriverRemoteConnection(object):
def test_traversals(self, remote_connection):
statics.load_statics(globals())
assert "remoteconnection[ws://localhost:45940/gremlin,g]" == str(remote_connection)
assert "remoteconnection[ws://localhost:45940/gremlin,gmodern]" == str(remote_connection)
g = Graph().traversal().withRemote(remote_connection)

assert long(6) == g.V().count().toList()[0]
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_in_tornado_app(remote_connection):
@gen.coroutine
def go():
conn = DriverRemoteConnection(
'ws://localhost:45940/gremlin', 'g', pool_size=4)
'ws://localhost:45940/gremlin', 'gmodern', pool_size=4)
g = Graph().traversal().withRemote(conn)
yield gen.sleep(0)
assert len(g.V().toList()) == 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_conns_in_threads(remote_connection):
child.join()
child2.join()


def test_conn_in_threads(remote_connection):
q = queue.Queue()
child = Thread(target=_executor, args=(q, remote_connection))
Expand All @@ -53,13 +54,14 @@ def test_conn_in_threads(remote_connection):
child.join()
child2.join()


def _executor(q, conn):
close = False
if not conn:
# This isn't a fixture so close manually
close = True
conn = DriverRemoteConnection(
'ws://localhost:45940/gremlin', 'g', pool_size=4)
'ws://localhost:45940/gremlin', 'gmodern', pool_size=4)
try:
g = Graph().traversal().withRemote(conn)
future = g.V().promise()
Expand Down
63 changes: 0 additions & 63 deletions gremlin-server/scripts/generate-all.groovy

This file was deleted.

3 changes: 0 additions & 3 deletions gremlin-server/src/assembly/standalone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ limitations under the License.
<fileSet>
<directory>scripts</directory>
<outputDirectory>/scripts</outputDirectory>
<excludes>
<exclude>generate-all.groovy</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>../target/docs/htmlsingle</directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public GraphTraversalSource traversal(final Graph graph) {
}

public static void startServer() throws Exception {
final InputStream stream = RemoteGraphProvider.class.getResourceAsStream("gremlin-server-integration.yaml");
final InputStream stream = GremlinServer.class.getResourceAsStream("gremlin-server-integration.yaml");
final Settings settings = Settings.read(stream);
ServerTestHelper.rewritePathsInGremlinServerSettings(settings);

Expand Down
Loading

0 comments on commit f2e74ff

Please sign in to comment.