Skip to content

Commit 05e844e

Browse files
committed
fix: e2e tests lib different db setup
1 parent b40a802 commit 05e844e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

fplus-database/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,22 @@ pub async fn get_database_connection() -> Result<DatabaseConnection, DbErr> {
5050
Err(DbErr::Custom("Database connection is not established".into()))
5151
}
5252
}
53+
54+
/**
55+
* Sets up the initial test environment (database connection and env variables)
56+
*/
57+
pub async fn setup_test_environment() {
58+
init();
59+
setup().await.expect("Failed to setup database connection.");
60+
}
61+
5362
#[cfg(test)]
5463
mod tests {
5564

5665
use super::*;
5766
use tokio;
5867
use serial_test::serial;
5968

60-
/**
61-
* Sets up the initial test environment (database connection and env variables)
62-
*/
63-
async fn setup_test_environment() {
64-
init();
65-
setup().await.expect("Failed to setup database connection.");
66-
}
67-
6869
/**
6970
* Test the establish_connection function
7071
*

fplus-lib/src/core/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ mod tests {
21072107
log::info!("Starting end-to-end test");
21082108

21092109
// Test Creating an application
2110-
let _ = fplus_database::setup().await;
2110+
let _ = fplus_database::setup_test_environment().await;
21112111
let gh = github_async_new(OWNER.to_string(), REPO.to_string()).await;
21122112

21132113
log::info!("Creating a new LDNApplication from issue");

0 commit comments

Comments
 (0)