surrealdb.go
surrealdb.go copied to clipboard
Bug: Broken Tests for Fetch
Describe the bug
This bug is a follow up from the below PR. This requires us to fix testcases listed in TestFetch() This is not a bug in the SDK and a bug in the core engine which needs to be fixed.
https://github.com/surrealdb/surrealdb.go/pull/115
Steps to reproduce
- Comment out s.T().Skip
- Run testcase and ensure it passes successfully
Expected behaviour
The tests listed above are expected to pass.
SurrealDB version
surreal 1.0.0 for MacOS
Contact Details
Is there an existing issue for this?
- [X] I have searched the existing issues
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thinking briefly here, this may be to do with deserialising the results from fetch. We might want to try to reproduce a JSON reponse to the deserialiser for a test.
Also, this might be related in case it is deserialisation: https://stackoverflow.com/questions/77553464/deserializing-a-graph-query/77582309#77582309
We might want to try to reproduce a JSON reponse to the deserialiser for a test. This would be a test in the core engine surrealdb code itself?
This would be a test in the driver. We would have a fake network layer, and fake json responses.
fakeNetwork := FakeNetwork() // This doesnt exist, we would need to create a mock or something
driver := fakeNetwork.newDriver() // Hypothetically. We basically need a factory that allows a network layer to be injected for testing
fakeNetwork.when(any()).then(someJson)
let result = driver.query(bla)
assertResult(result)
Something like that
I guess this is a known issue, but would like to make it more obvious.
I believe that https://github.com/surrealdb/surrealdb/issues/3028 block this issue as any parsing after fetch
will result in an error.