chore(unit-tests): Implements unit tests for src/libcommon with the help of OpenCode#1465
Conversation
484c291 to
6513579
Compare
1c1e2a6 to
66fddd4
Compare
herve-er
left a comment
There was a problem hiding this comment.
It looks like some of the previous tests are no longer included (see my comments).
Regarding the changes in KeychainManager:
I totally see the benefit of IKeychainStore for testing purposes, but I feel like the keychain handling is becoming a bit overcomplicated.
The current chain (mixing inheritance and members) is:
IKeychainStore → KeychainStore → KeychainManager → KeychainManagerSingleton
KeychainManager mainly acts as a wrapper around KeychainStore methods, adding logging and Sentry reporting. However, logging is already handled everywhere we call KeychainManager(Singleton)::Instance()->…, so this feels somewhat redundant. Its added value is storing _service and _package, but this could probably be handled directly within KeychainStore.
KeychainManagerSingleton simply holds an instance of KeychainManager, effectively acting as a makeshift dependency injection mechanism. I would suggest waiting a proper DI approach instead of relying on these kinds of workarounds.
This is an interesting subject, we can discuss it anytime tomorrow 😄
66fddd4 to
b583f17
Compare
… injection and re-write relevant unit tests
…ger with the feature of a setter for a custom store used in tests as a mock object
…s to KeyChainManager::instance()
…ts.txt caused by rebasing
… while addressing merge conflicts
b583f17 to
3023589
Compare
src/libcommon with the help of OpenCodesrc/libcommon with the help of OpenCode
|
The What the proper DI approach that you envision? |



No description provided.