I went a bit further with the tests but got stuck now. There is a
problem with Orient's ThreadLocal model and the test suite. Here's
what's going on:
1) Every graph operation first needs to set a ThreadLocal variable - I
copied the code from the Blueprints driver to OrientGraph and set the
ThreadLocal in every public method on OrientGraph:
https://github.com/mpollmeier/orientdb-gremlin/blob/master/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraph.java#L60
2) The tests create new graph instances using OrientGraph.open(). The
graph url defaults to `"memory:test-" + Math.random()` so that every
test uses a new in memory instance
https://github.com/mpollmeier/orientdb-gremlin/blob/master/src/main/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraph.java#L52
3) When executing the tests I get a lot of these:
`IllegalStateException: Current database instance
(com.orientechnologies.orient.core.db.ODatabaseFactory$1@1c9906a2) is
not active on current thread (Thread[main,5,main]). Current active
database is:
com.orientechnologies.orient.core.db.ODatabaseFactory$1@3bda8856`
Maybe that's because the tests all run in parallel and share Threads
from a threadpool? ThreadLocal doesn't work nicely with that model, so
we might need to configure them to run in serial.
@Stephen / @Luca, what do you think?
You can run the testsuite yourself if you remove the comments here:
https://github.com/mpollmeier/orientdb-gremlin/blob/master/src/test/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphStructureStandardTest.java#L10-L13
On 07/03/2015 09:59 AM, Michael Pollmeier wrote:
There might be only one test that verifies correct transactional
behaviour, however nearly all tests come past
`AbstractGremlinTest.tryCommit` which calls `g.tx().commit()`, which in
my case threw an Exception. I just changed that for a dummy
OrientTransaction which doesn't do anything and I get a bit further.
On 07/02/2015 11:31 PM, Stephen Mallette wrote:
There is really just one test case that has tests for transactions
(TransactionTest), so if you have a lot of red, it's likely related to
other things. I think that one of the fastest ways to get rid of the
failing tests would be to work on the making sure that your features are
defined properly. If you don't support transactions yet, then turn that
feature "off" for now until you do. That will make a lot of the tests go
from failing to ignored, thus saving you from chasing broken tests
that you
don't intend to support anyway.
On Wed, Jul 1, 2015 at 10:19 PM, Michael Pollmeier <
[email protected]> wrote:
I just put the structure in place so that it executes the
`StructureStandardSuite`.
The tests all fail at the moment though, as there's a number of areas
that
haven't been implemented yet, including Transaction handling which
seems to
be a prerequisite for the majority of the tests. It's still a POC I
suppose
;)
On 07/01/2015 10:00 PM, Stephen Mallette wrote:
I know you're just at a POC stage, but do you intend to hook up the
various
Gremlin Test Suites any time soon?
On Tue, Jun 30, 2015 at 10:01 PM, Michael Pollmeier <
[email protected]> wrote:
If you want to spread the word please retweet:
https://twitter.com/pollmeier/status/616063761070206976
On 07/01/2015 01:54 PM, Michael Pollmeier wrote:
Good news: I just released a first usable version of the OrientDB
TP3
driver [1] and added an example project [2] which uses gremlin-scala
with OrientDB.
Currently supported are vertex and edge creation and lookups,
properties
and traversals. Everything you need for simple use cases.
It's all released to maven central, so you can execute the example
project [2] or build your own. I'd really appreciate your feedback.
Cheers, Michael
[1] https://github.com/mpollmeier/orientdb-gremlin
[2] https://github.com/mpollmeier/gremlin-scala-examples
On 06/29/2015 09:35 AM, Michael Pollmeier wrote:
Currently I'm working on supporting edges and things like
vertex.edges(). With that we should be able to get traversals going.
Here's an incomplete list of other todos:
OrientGraphNoTx
index support
multi thread support: always do the setActive stuff?
cluster name support, e.g. on addVertex
tests: use the Standard TP3 testsuite. I run all my tests
from a
different repo using Gremlin-Scala.
go through remaining NotImplementedExceptions and TODOs in code
Michael
On 06/27/2015 02:52 AM, Luca Garulli wrote:
Sorry to didn't see it before. What are the missing parts of
OrientDB
BP3
implementation?
Lvc@