-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/6619 limit stats refresh #2526
Merged
Merged
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
96c3cf7
Migrate product leaderboards to Room: create DAO and Entity
JorgeMucientes 9d7113a
Add new TopPerformerProductsDao to database
JorgeMucientes dbc9d4e
Add migration policy for new TopPerformerProductEntity
JorgeMucientes 8e3d793
Fetch product leaderboard and save them in new Room DB
JorgeMucientes 2b96316
Fix tests
JorgeMucientes 9659ea2
Use correct id to save product
JorgeMucientes 24341fe
Add missing database scheme for v20
JorgeMucientes f4db396
Add function to retrieve top performers from DB
JorgeMucientes ef2b626
Remove old functions to fetch top performer products
JorgeMucientes 0115a50
Invalidate top performers cache when new order is placed
JorgeMucientes eed7650
Merge branch 'trunk' into feature/6619-limit-stats-refresh
JorgeMucientes db5fd52
Fix tests and add new ones
JorgeMucientes 76a07ca
Remove unused WCLeaderboardsSqlUtils
JorgeMucientes 5584ac9
Remove unused methods from WCLeaderboardsStore
JorgeMucientes 224cbfb
Fix detekt and checkstyle issues
JorgeMucientes 74af7f6
Make query functions suspendable
JorgeMucientes c306e06
Remove unneeded transactional Room operations
JorgeMucientes 4de12d9
Remove unused function
JorgeMucientes 68ae311
Convert to interface, abstract class not needed
JorgeMucientes 3771cb2
Add missing suspend function
JorgeMucientes 680ada3
Init StoreUnderTest in a more consistent way
JorgeMucientes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
very np 😄, I noticed some tests call
createStoreUnderTest
, and some don't.This is a little confusing, I think the reason is that sometimes we want to setup the mocks before creating the instance.
A small suggestion, but you don't have to implement it: remove the @before from setup, and add a
mocks
builder argument to it, then call it always, and make sure it callscreateStoreUnderTest
(similar to this from the WC app), this would make things consistent, always start withsetup
, but without thinking about a second instantiation ofstoreUnderTest
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.
Nice approach! I like it. I've applied it as I wanted to see it in action. In the end for this specific case it ended up being a bit more verbose, as I had to add an additional
setup()
call to all tests, when only one test needed to override the current instance ofstoreUnderTest
But I'll keep the changes as I think is consistent and I think is a cleaner way to defer SUT creation to override mocks.
Thanks for the tip 🙏🏼