-
Notifications
You must be signed in to change notification settings - Fork 3.3k
test(GraphService): Thorough graph service tests #3011
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
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
gabe-lyons
left a comment
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
gabe-lyons
left a comment
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
shirshanka
left a comment
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
GraphServicemethods 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:
findRelatedUrnsreturns duplicates, i.e. Urns may occur multiple times?findRelatedUrnswithRelationshipDirection.UNDIRECTEDreturn the union ofRelationshipDirection.OUTGOINGandRelationshipDirection.INCOMING?sourceTypeanddestinationTypeoffindRelatedUrnsare explicitly@Nullable. Doesnullrepresent any type?nullsourceTypeordestinationTyperepresents any type.""is also interpreted as any type. Should this be deprecated in favour ofnulland disallow empty types? When a type is given (non-null), it should be a useful type string.nullto reference any type.removeEdgesFromNodewithRelationshipDirection.UNDIRECTEDbe equivalent to calling it withRelationshipDirection.OUTGOINGandRelationshipDirection.INCOMING?removeEdgesFromNodewithRelationshipDirection.UNDIRECTEDshould be equivalent to calling it withRelationshipDirection.OUTGOINGandRelationshipDirection.INCOMING.findRelatedUrnsandremoveEdgesFromNode? Is an implementation allowed to enforce this limitation?ElasticSearchGraphServiceTestfails these tests while above questions are open.It further seems like no Neo4j tests are running. This includes a fix for #2678.