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
In #138 we made sure stats are made available to the test functions that require it by leveraging the refresh_stats fixture. The implementation might seem more like a workaround though.
We need to come up with a more robust solution that ensures predictability while not sacrificing speed.
Bringing here some ideas outlined in the original PR thread:
Improve TreeItem's testability
Make TreeItem operations no-op by default in the test environment.
This removes the chance for accidental poisoning. We can also think of alternative ways to make this class easier to test.
Individual tests that require R/W access to stats can explicitly request so (via a custom marker, for instance), hence circumventing the default behavior.
Imitate rollback via code
Redis has DUMP and RESTORE commands that might come handy. If we know that a specific test is going to alter certain keys, we can wrap it with the decorator that will backup keys before they are modified with the application code, and then restore the modified keys once the test is finished.
This will allow us to actually test how the stats are affected during tests.
The text was updated successfully, but these errors were encountered:
In #138 we made sure stats are made available to the test functions that require it by leveraging the
refresh_stats
fixture. The implementation might seem more like a workaround though.We need to come up with a more robust solution that ensures predictability while not sacrificing speed.
Bringing here some ideas outlined in the original PR thread:
Improve
TreeItem
's testabilityTreeItem
operations no-op by default in the test environment.This removes the chance for accidental poisoning. We can also think of alternative ways to make this class easier to test.
Imitate rollback via code
DUMP
andRESTORE
commands that might come handy. If we know that a specific test is going to alter certain keys, we can wrap it with the decorator that will backup keys before they are modified with the application code, and then restore the modified keys once the test is finished.The text was updated successfully, but these errors were encountered: