Unit tests for FeatureProviderStatusManager..#39
Conversation
Summary of ChangesHello @NeaguGeorgiana23, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the test coverage for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds comprehensive unit tests for FeatureProviderStatusManager, including a mock for FeatureProvider and the necessary BUILD file configurations. The tests are well-structured, using GTest fixtures and parameterized tests to cover various scenarios like initialization, shutdown, and status management. My review includes a couple of suggestions: one to correct a dependency in the BUILD file for the mock library, and another to enhance test coverage by including all possible provider statuses in one of the tests. Overall, this is a great addition to improve the project's test coverage and reliability.
265fe6a to
a72b335
Compare
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
a72b335 to
c14ccd7
Compare
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
| protected: | ||
| void SetUp() override { | ||
| mock_provider = std::make_shared<MockFeatureProvider>(); | ||
| auto result = FeatureProviderStatusManager::Create(mock_provider); |
There was a problem hiding this comment.
Is FeatureProviderStatusManager needed here?
There was a problem hiding this comment.
yes, since we need the result to initialize the manager_ . We first need this line to check the status returned is ok and only then init the manager_ with the value.
There was a problem hiding this comment.
You should be able to just call Create(mock_provider) since FeatureProviderStatusManager is in the header you are testing and the tests are in the same namespace
There was a problem hiding this comment.
We can't use jus Create(mock_provider) because this is a static function: static absl::StatusOr<std::unique_ptr<FeatureProviderStatusManager>> Create( std::shared_ptr<FeatureProvider> provider);.
We used a static function to follow the Factory Method pattern so we can also return a StatusOr instead of having a throw in a regular constructor.
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
…/cpp-sdk into status_manager_test
…tatus_manager_test
…tatus_manager_test
This PR
Adds unit-tests for FeatureProviderStatusManager.