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
Fix and test schema generation interface #220
Conversation
This api has no test coverage. We didn't know that
|
graphql_compiler/__init__.py
Outdated
describes the name of an | ||
endpoint of the edge. | ||
- defaultValue: string, the textual representation of the | ||
default value for the property, as |
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.
Nit: the visual indentation is off by one space (compare string
vs default
)
}, | ||
] | ||
schema, _ = get_graphql_schema_from_orientdb_schema_data(orientdb_schema_data) | ||
self.assertMatchSnapshot(print_schema(schema)) |
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.
Do we actually need this to be a snapshot test here? This feels like a unit test to me since we have well-defined input and output, and a single function call being tested. Invoking all the snapshot testing machinery feels like overkill for this use case.
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.
I think it's a good idea because every time I've made a small change to the way we generate the schema, I've had to print it and then copy paste it into test_helpers. If I introduce this test as an unit test, every time we change the schema we now have to change two things.
@@ -64,6 +64,8 @@ CREATE INDEX Animal.net_worth NOTUNIQUE | |||
CREATE CLASS Animal_ParentOf EXTENDS E | |||
CREATE PROPERTY Animal_ParentOf.in LINK Animal | |||
CREATE PROPERTY Animal_ParentOf.out LINK Animal | |||
ALTER CLASS Animal_ParentOf CUSTOM human_name_in="Parent" |
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.
Add a test on the generated schema graph that these properties exist and have their expected values?
This also doesn't merge cleanly anymore, so I'll hold off on reviewing until you've had a chance to resolve the merge conflicts. |
1c69a18
to
4ff3b15
Compare
dd4a8c6
to
190dd1c
Compare
190dd1c
to
c39de5b
Compare
No description provided.