-
Notifications
You must be signed in to change notification settings - Fork 4
Fix tests #3
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
base: master
Are you sure you want to change the base?
Fix tests #3
Conversation
|
Hi @draylang, you made a huge work and I really appreciate it, but I don't really like the idea of sorting hashes. If you take a look at the tests you can see that in similar cases I'm using If you would change your PR to use |
|
The tests are failing on a string match, not a deep structure comparison. Example from execute-variables.t: is_deeply execute($schema, $ast), { The value in fieldWithObjectInput is a string. A json string that is composed during each run on both the result and the test. The order in which the elements are composed into this json string is not guaranteed. Do your tests currently run reliably without failing? They don't for me and the failures are randomly changing between runs. Another fix would be to dispense with the json encoding altogether and compare structured data as you suggest with cmp_deeply. That would still require hooking or wrapping the graphql and execute methods and parsing the result as well as needing to touch a lot of test code to remove the json encoding for each test. I was aiming for a solution with the least number of changes. |
|
Tests are passing for me on Perl 5.16.3 and 5.10.1. But I aware some of them are unstable depends on Perl build parameters. |
|
Hi guys (hi Artur!), if you'd like to then I'd really appreciate any help you might want to give to the other graphql-perl: https://github.com/graphql-perl/graphql-perl - https://metacpan.org/pod/GraphQL on CPAN. Or, if you're interested:
Next phases of implementation will be:
Let me know your thoughts! |
Tests were failing due to uncertain key order in results. I made a shim that is to be used during testing only that fixes most of the cases. There are 2 instances that I added sorting to the error output in the source file but these should be low impact changes.