Skip to content
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

Merged
merged 2 commits into from Mar 16, 2019

Conversation

Projects
None yet
5 participants
@sehrope
Copy link
Contributor

commented Mar 14, 2019

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.

sehrope added some commits Mar 14, 2019

fix: Change testCrossReference() to validate column order and row count
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.

@sehrope sehrope referenced this pull request Mar 14, 2019

Merged

Cleanup encoding #1441

6 of 8 tasks complete
@AppVeyorBot

This comment has been minimized.

Copy link

commented Mar 14, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Mar 14, 2019

Codecov Report

Merging #1442 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@             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
@bokken

bokken approved these changes Mar 16, 2019

@vlsi vlsi changed the title Fix metadata test to use explicit PK/FK names test: fix metadata test to use explicit PK/FK names Mar 16, 2019

@vlsi vlsi merged commit 42d6bfa into pgjdbc:master Mar 16, 2019

3 checks passed

codecov/project 68.75% (+0.01%) compared to 0c5cf47
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sehrope

This comment has been minimized.

Copy link
Contributor Author

commented Mar 16, 2019

🎉

}
assertEquals(2, numRows);

This comment has been minimized.

Copy link
@vlsi

vlsi Mar 16, 2019

Member

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.

This comment has been minimized.

Copy link
@sehrope

sehrope Mar 16, 2019

Author Contributor

Good point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.