syncstorage-rs icon indicating copy to clipboard operation
syncstorage-rs copied to clipboard

Investigate separating out test database methods

Open ethowitz opened this issue 3 years ago • 0 comments

With our work to split syncstorage-rs into separate crates, we have removed #[cfg(test)] from those database methods that are only included in tests. (Code specific to the test feature is not visible to external crates, so we had to remove the cfg(test) attribute from the test methods in the Db trait.) This isn't ideal, since it makes it easy to accidentally use methods that were intended only for testing purposes.

There are a few approaches we could take to resolve this:

  • Move the methods to a separate DbTest trait
  • Add our own syncstorage-test feature that we use to handle test code
  • Add comments that explain the nature of the test methods
  • Use the #[deprecated] attribute on the test methods so they generated warnings if used in non-test code

┆Issue is synchronized with this Jira Task

ethowitz avatar May 06 '22 21:05 ethowitz