You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when we need a DocHandle in a third-party library / app's integration tests, we'd need to spin up an entire thread with Repo::run, while also requiring us to provide our own Storage implementation.
Perhaps test mocks could be provided, similar to tokio_test::io? (Probably not in the same way, as that is trait-based.)
while also requiring us to provide our own Storage implementation
If you are not testing your storage back-end, I suggest using an empty Storage implementation such as SimpleStorage as used in our own test suite.
Currently, when we need a DocHandle in a third-party library / app's integration tests, we'd need to spin up an entire thread with Repo::run, while also requiring us to provide our own Storage implementation.
Do you mean unit-tests? For integration tests that rely on the workings on this library I would recommend doing exactly as in your description of the problem.
If you do mean unit tests, I guess one could work towards adding a mock of the repo, that would not run in a thread but instead follow a per-determined script(return per-determined doc handles and so on). Maybe hide it behind a test flag as opposed to add traits where none are currently needed?
Currently, when we need a
DocHandle
in a third-party library / app's integration tests, we'd need to spin up an entire thread withRepo::run
, while also requiring us to provide our ownStorage
implementation.Perhaps test mocks could be provided, similar to tokio_test::io? (Probably not in the same way, as that is trait-based.)
For another reference, check out
tonic
's mock example.I'm sure neither of those patterns are directly applicable here, but it's something that could be improved here?
The text was updated successfully, but these errors were encountered: