syncstorage-rs
syncstorage-rs copied to clipboard
Investigate separating out test database methods
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
DbTesttrait - Add our own
syncstorage-testfeature 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