-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
test(GraphService): Thorough graph service tests #3011
test(GraphService): Thorough graph service tests #3011
Conversation
@EnricoMi-
|
I'll also look into the graph service test issue- those should be running. We recently refactored the logic to run graph service tests, that may have done it. |
Thanks for answering those questions. I will adjust the tests to reflect that behaviour.
Would you say an empty type string
You are right. The relationship types argument is a non-nullable list, so the semantics of providing an empty list is to ask for no types. If any relationship type should be supported in the future, than this could be done through a null for a nullable-list. |
@gabe-lyons Given existing implementations currently fail these tests I would like to suggest the following approach:
This way, this PR is not blocked by fixing ES and Neo4J implementations, test from this PR reproduce above issues, and upcoming changes to the GraphService API do not conflict with this PR in the meanwhile. |
CC @jjoyce0510 |
3939d47
to
b25f443
Compare
5e5a3d9
to
a08f80d
Compare
a08f80d
to
58f46de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding all tests- I will get to reviewing ASAP!
ecf3e63
to
1cfcc02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just read through all these changes- thanks for all the additional tests & documentation. This looks great @EnricoMi 👍
If you have a chance, would you mind rebasing this? After that I would be good to merge
b47be69
to
26fb848
Compare
26fb848
to
4bac19a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adds a more complex test graph and tests all
GraphService
methods thoroughly. In the current implementation, tests depend on the order of test execution, as they share the state of the tested service.As the interface is not documented, a couple of questions on which results to expect from the given graph arose:
findRelatedUrns
returns duplicates, i.e. Urns may occur multiple times?findRelatedUrns
withRelationshipDirection.UNDIRECTED
return the union ofRelationshipDirection.OUTGOING
andRelationshipDirection.INCOMING
?sourceType
anddestinationType
offindRelatedUrns
are explicitly@Nullable
. Doesnull
represent any type?null
sourceType
ordestinationType
represents any type.""
is also interpreted as any type. Should this be deprecated in favour ofnull
and disallow empty types? When a type is given (non-null), it should be a useful type string.null
to reference any type.removeEdgesFromNode
withRelationshipDirection.UNDIRECTED
be equivalent to calling it withRelationshipDirection.OUTGOING
andRelationshipDirection.INCOMING
?removeEdgesFromNode
withRelationshipDirection.UNDIRECTED
should be equivalent to calling it withRelationshipDirection.OUTGOING
andRelationshipDirection.INCOMING
.findRelatedUrns
andremoveEdgesFromNode
? Is an implementation allowed to enforce this limitation?ElasticSearchGraphServiceTest
fails these tests while above questions are open.It further seems like no Neo4j tests are running. This includes a fix for #2678.