-
Notifications
You must be signed in to change notification settings - Fork 820
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
test: fix metadata test to use explicit PK/FK names #1442
Conversation
Changes testCrossReference() to validate the retrieved primary and foreign key columns against their expected values. Previously it would have accepted them in either order or the same value repeated twice for each. Also checks to ensure that the expected number of rows are actually returned. Previously it would have skipped all the checks if no rows were returned.
✅ Build pgjdbc 1.0.169 completed (commit 04a5ea632a by @sehrope) |
Codecov Report
@@ Coverage Diff @@
## master #1442 +/- ##
============================================
+ Coverage 68.74% 68.75% +0.01%
- Complexity 3902 3903 +1
============================================
Files 179 179
Lines 16414 16414
Branches 2672 2672
============================================
+ Hits 11284 11286 +2
+ Misses 3882 3881 -1
+ Partials 1248 1247 -1 |
🎉 |
} | ||
assertEquals(2, numRows); |
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.
Technically speaking, this should have been assertEquals("dbmd.getCrossReference should return 2 rows since primary key m_pkey was created as (m,n)", 2, numRows)
It does not hurt much, but it does bother when it fails like "expected: 2, got: 3".
The same for assertEquals
above.
Something like assertEquals("FK column " + j, expectedFkColumnNames[j - 1], fkColumnName);
would make failure messages much more convenient.
Thanks for the understanding.
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.
Good point!
Travis build against HEAD fails due to some changes in automated foreign key naming. Ex: #1435 (comment)_
This PR gives explicit names to the failing tests so that the results are consistent across versions.
Also, enhances the validation for that test to better validate the column order and row counts.