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

PT-6909 Extracted reader options to builder from private methods #112

Merged
merged 3 commits into from
Apr 3, 2020

Conversation

vgarvardt
Copy link
Contributor

One more piece extracted from #110

This time - reader options extracted from implementations private methods to a builder function.

@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #112 into master will increase coverage by 1.34%.
The diff coverage is 76.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   35.19%   36.53%   +1.34%     
==========================================
  Files           6        8       +2     
  Lines         233      260      +27     
==========================================
+ Hits           82       95      +13     
- Misses        145      159      +14     
  Partials        6        6
Impacted Files Coverage Δ
pkg/dumper/query/dumper.go 0% <0%> (ø) ⬆️
pkg/reader/reader.go 56.52% <100%> (ø)
pkg/reader/driver.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f81f7a5...9b40954. Read the comment docs.

Comment on lines +36 to +46
assert.Equal(t, tableCfg.Filter.Match, tableOpt.Match)
assert.Equal(t, tableCfg.Filter.Limit, tableOpt.Limit)
assert.Equal(t, tableCfg.Filter.Sorts, tableOpt.Sorts)

require.Equal(t, len(tableCfg.Relationships), len(tableOpt.Relationships))
for i := range tableCfg.Relationships {
assert.Equal(t, tableCfg.Relationships[i].Table, tableOpt.Relationships[i].Table)
assert.Equal(t, tableCfg.Relationships[i].ForeignKey, tableOpt.Relationships[i].ForeignKey)
assert.Equal(t, tableCfg.Relationships[i].ReferencedTable, tableOpt.Relationships[i].ReferencedTable)
assert.Equal(t, tableCfg.Relationships[i].ReferencedKey, tableOpt.Relationships[i].ReferencedKey)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use assert.EqualValues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tableCfg.Relationships and tableOpt.Relationships have different types, but fields list is the same


assert.Equal(t, tableCfg.Filter.Match, tableOpt.Match)
assert.Equal(t, tableCfg.Filter.Limit, tableOpt.Limit)
assert.Equal(t, tableCfg.Filter.Sorts, tableOpt.Sorts)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be here require as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not need to stop test if this condition is failing, we can check other asserts as well even if this one is bad

@boekkooi-fresh
Copy link
Contributor

boekkooi-fresh commented Apr 3, 2020

👍

Approved with Zappr Approved with Zappr Approved with Zappr Approved with Zappr

@vgarvardt vgarvardt merged commit ffb0bf8 into master Apr 3, 2020
@vgarvardt vgarvardt deleted the patch/read-table-opt branch April 3, 2020 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants