-
Notifications
You must be signed in to change notification settings - Fork 683
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
GEODE-5960: Add test to verify CommandMarker file for the JDBC connector #2751
GEODE-5960: Add test to verify CommandMarker file for the JDBC connector #2751
Conversation
Added a new test to the JDBC connector project to verify that the list of commands loaded via the scanner and the command marker match the list of commands found via these two sources. This is to avoid errors/warnings due to commands which appear in Command Marker files but don't have available source code. Co-authored-by: Ben Ross <bross@pivotal.io> Co-authored-by: Darrel Schneider <dschneider@pivotal.io>
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.
CommandAvailabilityIndicatorTest
is kind of providing some coverage to assert that commands are available online. But this test seems to be a more basic test to help developers to figure out if he misses the markers.
I am not sure what this test is for. the commandManager actually uses the package scanner to scan the classpath to compose its list of commands, so the test is just reiterates what the commandManager is doing. So if a command did not implement CommandMarker, this test would still pass, I believe. |
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.
A better test is probably to write an acceptance test for each jdbc gfsh commands.
Jinmei, this test is only to catch when we remove a command class that still has its name in the CommandMarker file. With what is currently checked in, all the open side tests pass even though a user of gfsh will get a warning about that command class not existing. |
@dschneider-pivotal now I see that this test is to make sure all commands defined in the commandMarker file is able to load, then you don't need to scan the packages to get a list of all the commands at all, you can just get the list of commands loaded by service loader and make sure they exists in the command manager, this can make your test a lot shorter. Something like this: ServiceLoader loader =
|
Added a new test to the JDBC connector project to verify that the list
of commands loaded via the scanner and the command marker match the list
of commands found via these two sources. This is to avoid
errors/warnings due to commands which appear in Command Marker files but
don't have available source code.
Co-authored-by: Ben Ross bross@pivotal.io
Co-authored-by: Darrel Schneider dschneider@pivotal.io
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop
)?Is your initial contribution a single, squashed commit?
Does
gradlew build
run cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.