-
-
Notifications
You must be signed in to change notification settings - Fork 921
[WIP] using db-pool library to create a pool of databases #5846
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
Draft
momentary-lapse
wants to merge
28
commits into
LemmyNet:main
Choose a base branch
from
momentary-lapse:parallel-db-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
1443731
draft: using db-pool form a 2021 branch
momentary-lapse 55d010d
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 91613fb
fix
momentary-lapse 618f635
some renaming
momentary-lapse ef155c5
reusable pool integrated except everywhere, some tests adapted
momentary-lapse f949aea
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 6b13d21
generic pool in context and stat modules, now it compiles
momentary-lapse 8528a7f
Merge branch 'main' into parallel-db-tests
momentary-lapse e90c8be
fix taplo
momentary-lapse 5d6fe0c
clippy fix
momentary-lapse 906c36a
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 418e91b
clippy fix
momentary-lapse fe3305b
fmt fix
momentary-lapse a95ad45
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 4377da8
shear fix
momentary-lapse e18c7f7
clippy + shear fixes
momentary-lapse 5264ab1
fmt fix
momentary-lapse 9db404d
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 6e795ea
fix merge issues
momentary-lapse 603efb3
config forrunning new tests locally
momentary-lapse 0d59fcf
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 1fbe5f4
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 64bc9e6
removing the rest of serial tests
momentary-lapse 6534cbc
fmt
momentary-lapse 12037df
excluding serial_test dep
momentary-lapse b8c2836
fix
momentary-lapse aadfcca
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse 99f4f03
Merge branch 'main' of github.com:LemmyNet/lemmy into parallel-db-tests
momentary-lapse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,9 +400,8 @@ mod tests { | |
use serial_test::serial; | ||
|
||
#[tokio::test] | ||
#[serial] | ||
async fn test_admin_higher_check() -> LemmyResult<()> { | ||
let pool = &build_db_pool_for_tests(); | ||
let pool = &build_db_pool_for_tests().await; | ||
let pool = &mut pool.into(); | ||
|
||
let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string()).await?; | ||
|
@@ -439,9 +438,8 @@ mod tests { | |
} | ||
|
||
#[tokio::test] | ||
#[serial] | ||
async fn test_email_taken() -> LemmyResult<()> { | ||
let pool = &build_db_pool_for_tests(); | ||
let pool = &build_db_pool_for_tests().await; | ||
let pool = &mut pool.into(); | ||
|
||
let darwin_email = "[email protected]"; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is the moment which currently blocks me, and i think it's better to consult with you again.
LemmyContext
structure must be cloneable, therefore all the fields, therefore the pool. But unfortunately, reusable pool fromdb-pool
crate is not, and i don't have access to its fields to implement the trait here.But before asking
db-pool
developer, i'd like to be sure we really need this pool cloning stuff, especially for the tests. Cloning the pool seems a bit strange to me, but i may miss something. I'm looking at the code now, but maybe you folks already have some insights on thisThere 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.
Wrap it in
Arc
for now.