-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[improve] add connector options class exist check #8600
Conversation
path.getFileName().toString().replace(JAVA_FILE_EXTENSION, ""); | ||
connectorOptionFileNames.remove(className); | ||
}); | ||
Assertions.assertEquals( |
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.
Can we add some white list to let the test case passes? Then when one connector had Options class, we can remove it from white list.
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.
Ok, I will add the connector under this issue to the whitelist, #8576.
path.getFileName().toString().replace(JAVA_FILE_EXTENSION, ""); | ||
connectorOptionFileNames.remove(className); | ||
}); | ||
connectorOptionFileNames.removeAll(buildWhiteList()); |
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.
we should assert connectorOptionFileNames
size equals white list size.
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.
It seems that this might not be necessary.
If the white list size
is smaller than connectorOptionFileNames.size()
, the following Assertions.assertEquals(0, connectorOptionFileNames.size())
will fail.
On the other hand, if the white list size
is larger than connectorOptionFileNames.size()
, removing non-existent Options
or already removed Options
won't have any impact.
Additionally, if we check for equality of size before calling connectorOptionFileNames.remove(className)
, the size will never match when the update PR is done and the connector class is removed from the white list.
Please correct me if I'm wrong.
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.
Sorry, my logic needs to be corrected. We should check the size of connectorOptionFileNames be removed by white list
equals white list size
. So that we can make sure the white list
are all up to date and right.
Purpose of this pull request
check the Connector need has corresponding [Options] class.
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note
.