Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduce RowBuilder to support writing basic unit tests#979

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
hunts wants to merge1 commit intorust-postgres:master
base:master
Choose a base branch
Loading
fromhunts:hunts/add-basic-testability-for-lib-users

Conversation

hunts
Copy link

Added RowDescription trait, and let rows to share the same description rather than having a copy in each row (think when there are thousand of them in the result).

Added RowBuilder to support adding stubs of row data in unit tests.

Currently, the library users have no chooice but have to use integration tests for testing Postgres data access code. With the changes in this commit, thetokio-postgres lib users can use RowBuilder to create sutbs to verify the deserialization from database result (Rows) to custom stucts in unit tests.

It can also serves as a base for future implementation of certain kind of mocks of the db connection.

Related-to#910#950

Added RowDescription trait, and let rows to share the same descriptionrather than having a copy in each row (think when there are thousand ofthem in the result).Added RowBuilder to support adding stubs of row data in unit tests.Currently, the library users have no chooice but have to use integrationtests for testing Postgres data access code. With the changes in thiscommit, the `tokio-postgres` lib users can use RowBuilder to createsutbs to verify the deserialization from database result (Rows) tocustom stucts in unit tests.It can also serves as a base for future implementation of certain kindof mocks of the db connection.Related-torust-postgres#910rust-postgres#950
@huntshuntsforce-pushed thehunts/add-basic-testability-for-lib-users branch fromf712d07 to07336e5CompareJanuary 5, 2023 21:37
@phyllipecesar
Copy link

Hi@sfackler ,

I usually create a struct and implementTryFrom<Row> for that struct, I rely on integration tests(which are usually more expensive) to test end to end.

Do you have any recommendation how to unit test conversions?
Thank you.

@deleted
Copy link

I, too, need something like this for unit testing.
@sfackler Any thoughts on accepting this or something similar?

@owlot
Copy link

I also need this, been watching the pr for a while, but seems like it's not going to be merged at all?

@deleted
Copy link

Nothing to add except that the ability to synthesize Rows / a RowStream in unit testing is still very important to me.

Is this something we can expect to ever see inrust-postgres or no?

@owlot
Copy link

@sfackler can you let us know if you're considering this PR at all or if we have to build around it some other way to be able to get our unit test coverage up.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@hunts@phyllipecesar@deleted@owlot

[8]ページ先頭

©2009-2025 Movatter.jp