-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use DB backend in test client #1779
Conversation
Co-Authored-By: svyatonik <[email protected]>
|
Can we not then drop |
|
Not sure, but imo it still will be useful for some small, low-level tests which should simulate abnormal cases. Original idea was to use DB backend in all tests where Also I'm using it here to compare DB backends (i.e. |
|
But the kvdb in memory implementation is also just in memory? In my opinion this just requires additional code that is only used in tests and we don't test the real code that interacts with the db interface. |
Comparing kvdb = comparing db-level representation (columns, ...) even if we improve it. Also it could be affected by some irrelevant factors (insertion order - idk?). To compare two client backends we need to compare the set of headers + the set of chain (best + last finalized + ...) + ... => we'll need several
Exactly. We have a lot of code that is only used in tests (helpers/stubs/mock objects/...). Consider |
|
That said, I'm ready to give up if you'll find more supporters on your side :) But would prefer to separate "Use DB backend in test-client" and "Get rid of in-memory backend" tasks. |
|
I don't want you to give up^^ In #1609 we have the situation that we need to implement a completely different interface for |
|
I'd say that it is probably better to rebase #1609 on this PR && add |
|
Okay, sounds like a plan :) |
bkchr
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.
Looks good, but the test interface should use kvdb-inmemory.
* use DB backend in test client * Update core/client/db/src/lib.rs Co-Authored-By: svyatonik <[email protected]>
closes #1603
Also fixed two issues, revealed by this migration:
This PR also introduced
test_client::new_lightto be used in integration tests. Thetest_client::LightFetcheris currently a stub, because I'm not sure yet about its implementation (it will be fixed as a part of #1669).