-
Notifications
You must be signed in to change notification settings - Fork 427
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
Fix random failure in BulkCopyColumnMapping test #165
Conversation
Before, when two random tables are created, there was a small chance that they would have identical schemas. This caused the ImplicitMismatchCM test case to pass when it was expected to fail. Modified creation of destination table to always have a different schema from the source table.
Codecov Report
@@ Coverage Diff @@
## dev #165 +/- ##
===========================================
- Coverage 29.7% 29.56% -0.15%
+ Complexity 1248 1246 -2
===========================================
Files 97 97
Lines 23305 23305
Branches 3871 3871
===========================================
- Hits 6923 6889 -34
- Misses 15028 15064 +36
+ Partials 1354 1352 -2
Continue to review full report at Codecov.
|
* @param autoGenerateSchema | ||
* @param alternateSchema | ||
*/ | ||
DBSchema(boolean autoGenerateSchema, boolean alternateSchema) { |
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.
Instead of copy paste you can use shuffle / reverse.
if(alternateSchema) {
Collections.shuffle(sqlTypes);
or
Collections.reverse(sqlTypes);
}
DBSchema(boolean autoGenerateSchema, boolean alternateSchema) {
this(autoGenerateSchema);
if(alternateSchema) {
Collections.shuffle(this.sqlTypes);
}
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.
done
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.
Think of rewriting DBSchema(...) by calling other constructor and on top of that shuffling instead of copy paste.
* @param alternateShcema | ||
* <code>true</code>: creates table with alternate schema | ||
*/ | ||
public DBTable(boolean autoGenerateSchema, boolean unicode, boolean alternateSchema) { |
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 can reduced copy paste by changing public DBTable(boolean autoGenerateSchema)
and public DBTable(boolean autoGenerateSchema, boolean unicode)
Example:
public DBTable(boolean autoGenerateSchema) {
this(autoGenerateSchema, false,false);
}
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.
done
Before, when two random tables are created, there was a small chance that they would have identical schemas. This caused the ImplicitMismatchCM test case to pass when it was expected to fail. Modified creation of destination table to always have a different schema from the source table.