Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1864 6bd319996 -> fe447eabf (forced update)
TINKERPOP-1864 Run python glv tests on GraphSON 2.0 and 3.0 There was about a 10 second time increase for adding the additional test execution option. Seems worthwhile. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fe447eab Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fe447eab Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fe447eab Branch: refs/heads/TINKERPOP-1864 Commit: fe447eabfddf099ff7354509d3585cf9ed97ec49 Parents: e1ef8b6 Author: Stephen Mallette <sp...@genoprime.com> Authored: Thu Jun 21 17:24:58 2018 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Mon Jun 25 12:10:19 2018 -0400 ---------------------------------------------------------------------- gremlin-python/pom.xml | 10 +++++++++- gremlin-python/src/main/jython/radish/terrain.py | 12 +++++++++++- gremlin-python/src/main/jython/setup.py | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fe447eab/gremlin-python/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml index e48901c..fdb4642 100644 --- a/gremlin-python/pom.xml +++ b/gremlin-python/pom.xml @@ -420,11 +420,19 @@ limitations under the License. <env key="PYTHONPATH" value=""/> <arg line="setup.py install"/> </exec> + <!-- run for graphson 3.0 --> <exec executable="env/bin/radish" dir="${project.build.directory}/python2" failonerror="true"> <env key="PYTHONPATH" value=""/> <env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/> - <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/"/> <!-- -no-line-jump --> + <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="graphson=v2""/> <!-- -no-line-jump --> + </exec> + <!-- run for graphson 3.0 --> + <exec executable="env/bin/radish" dir="${project.build.directory}/python2" + failonerror="true"> + <env key="PYTHONPATH" value=""/> + <env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/> + <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="graphson=v3""/> <!-- -no-line-jump --> </exec> </target> </configuration> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fe447eab/gremlin-python/src/main/jython/radish/terrain.py ---------------------------------------------------------------------- diff --git a/gremlin-python/src/main/jython/radish/terrain.py b/gremlin-python/src/main/jython/radish/terrain.py index ba8f372..3da9a0e 100644 --- a/gremlin-python/src/main/jython/radish/terrain.py +++ b/gremlin-python/src/main/jython/radish/terrain.py @@ -66,7 +66,17 @@ def prepare_static_traversal_source(features, marker): @before.each_scenario def prepare_traversal_source(scenario): # some tests create data - create a fresh remote to the empty graph and clear that graph prior to each test - remote = DriverRemoteConnection('ws://localhost:45940/gremlin', "ggraph", message_serializer=serializer.GraphSONSerializersV3d0()) + if not("graphson" in world.config.user_data): + raise ValueError('test configuration requires setting of --user-data="graphson=*" to one of [v2,v3]') + + if world.config.user_data["graphson"] == "v3": + s = serializer.GraphSONSerializersV3d0() + elif world.config.user_data["graphson"] == "v2": + s = serializer.GraphSONSerializersV2d0() + else: + raise ValueError('serializer set with --user-data="graphson=v2" must be one of [v2,v3]') + + remote = DriverRemoteConnection('ws://localhost:45940/gremlin', "ggraph", message_serializer=s) scenario.context.remote_conn["empty"] = remote g = Graph().traversal().withRemote(remote) g.V().drop().iterate() http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fe447eab/gremlin-python/src/main/jython/setup.py ---------------------------------------------------------------------- diff --git a/gremlin-python/src/main/jython/setup.py b/gremlin-python/src/main/jython/setup.py index 5d26749..5bde9ed 100644 --- a/gremlin-python/src/main/jython/setup.py +++ b/gremlin-python/src/main/jython/setup.py @@ -71,7 +71,7 @@ setup( tests_require=[ 'pytest', 'mock', - 'radish-bdd==0.8.0', + 'radish-bdd==0.8.6', 'PyHamcrest' ], install_requires=install_requires,