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

Add ability to create new database per test case #1121

Open
Ghost-str opened this issue Jan 1, 2025 · 2 comments
Open

Add ability to create new database per test case #1121

Ghost-str opened this issue Jan 1, 2025 · 2 comments
Labels

Comments

@Ghost-str
Copy link

Ghost-str commented Jan 1, 2025

Description

Add ability to create and delete new database per test case for isolation purpose.

Expected Behavior

#[tokio::test]
async fn  test_name() {
   configure_insta!();
   let uuid = uuid();
   let appConfig= testing::create_test_database_with_postfix(&uuid).await.unwraup;
   let boot = testing::boot_test_with_custom_config::<App>(appConfig).await.unwrap;

   ... test body ....

   testing::remove_test_database_with_postfix(&uuid).await.unwraup;
}

Environment:

test

@kaplanelad
Copy link
Contributor

Could you please clarify the reasoning behind this request?

@Ghost-str
Copy link
Author

If you remove #[serial] for tests, then the tests begin to influence each other.
I think it would be more convenient if for each element of the infrastructure it was possible to isolate the application when running tests.
I think that over long distances this will help to perform tests faster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants