-
Notifications
You must be signed in to change notification settings - Fork 121
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
IEP-946 Test coverage for ExecutableFinder #759
Conversation
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.
@kolipakakondal, @alirana01
FYI: I left some comments to explain some design choices
bundles/com.espressif.idf.core/src/com/espressif/idf/core/ExecutableFinder.java
Outdated
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/SystemExecutableFinder.java
Show resolved
Hide resolved
@@ -4,16 +4,19 @@ | |||
*******************************************************************************/ | |||
package com.espressif.idf.core.test; |
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.
probably we can move this class to unittest package and leave the test package for other kinds of tests
bundles/com.espressif.idf.core/src/com/espressif/idf/core/SystemExecutableFinder.java
Outdated
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/SystemExecutableFinder.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
I have left a comment that we can probably look into and if needed I can explain on call my idea related to design. The other changes you mentioned I think are valid and can be done just try to take a look at the big test class.
tests/com.espressif.idf.core.test/src/com/espressif/idf/core/unittest/ExecutableFinderTest.java
Outdated
Show resolved
Hide resolved
Removed an unused method from the ExecutableFinder interface and cleaned up unreachable code |
bundles/com.espressif.idf.core/src/com/espressif/idf/core/ExecutableFinder.java
Show resolved
Hide resolved
bundles/com.espressif.idf.core/src/com/espressif/idf/core/SystemWrapper.java
Show resolved
Hide resolved
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.
Hi @sigmaaa thank you for explaining I just went over your PR again I am a bit confused about the interfaces you are using and I am not able to get the idea why we need them. About the test cases and this I think we can discuss this on a call it would be better
Hi @alirana01. I prefer using interfaces for several reasons, but in this case mostly because of these ones:
|
Hi @sigmaaa thanks for the response, I think you are pretty clear on the design and it makes sense to me now in many places. Only thing I would suggest is that my last discussion over stuff when added for future references with @kolipakakondal led to the outcome that we are supposed to keep YAGNI or KISS in mind. If you think it satisfies those things and is viable for not so distant PRs its good to go. Happy Testing :) |
@sigmaaa about interfaces I can agree that it maynot be a standard convention but it increases the readability by a lot. |
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.
Just take a look at the comments mentioned and see if you can incorporate @kolipakakondal should be the final person to finalize design side stuff
Hi @alirana01, thank you for your feedback. I'm always trying to keep in mind KISS and YAGNI principles, that's the reason why during this refactoring I removed one method from public API and also removed the boolean parameter :) I do plan on using interfaces to mimic ExecutableFinders in future tests, which I will add soon. As for the “I” prefix, for me personally, it hurts readability, because we always have to rely on abstraction as much as possible, so treat interfaces like any other type. I think "I" is a standard convention for C# where it is not clear that we are extending an implementation class or interface. Regardless, I'm grateful for our discussion. Taking the time to contemplate matters repeatedly is always beneficial and provides ample mental stimulation :D |
Hi @sigmaaa, Thanks for the PR! I understand that you introduced the In general, it's best to only introduce interfaces when you have multiple classes that will implement them, each with a different implementation. This allows us to decouple the different parts of our code and make it more flexible. If you've designed these interfaces with future extensibility in mind, and you see some use cases coming up where we'll need different implementations, then it's probably fine to leave them as-is. Otherwise, PR looks good to me. |
I see builds are getting failed, we can fix and merge this PR. @sigmaaa |
Hi @kolipakakondal, thanks for the review. We already using different implementations of SystemWrapper in the tests. I'm planning to use different implementations of ExecutableFinder in future tests for IDFUtil class (but first need to make a dependency injection there). It's possible to mock a class for this purpose instead of a mock interface, but I've heard that some Mockito frameworks don't support mocking classes, so it's better to not rely on it and use an interface for abstraction.
fixed in the last commit |
Description
PR summary:
Fixes # (IEP-946)
Type of change
Please delete options that are not relevant.
How has this been tested?
Test Configuration:
Dependent components impacted by this PR:
Checklist