mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
refactor: randomize app name for databases tests
This commit is contained in:
@@ -182,6 +182,7 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
|
||||
let mut environment = test_utilities::aws::working_minimal_environment(&context);
|
||||
|
||||
let app_name = format!("postgresql-app-{}", generate_id());
|
||||
let database_host = "postgresql-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; // External access check
|
||||
let database_port = 5432;
|
||||
let database_db_name = "my-postgres".to_string();
|
||||
@@ -208,7 +209,7 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.branch = "postgres-app".to_string();
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "5990752647af11ef21c3d46a51abbde3da1ab351".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.environment_variables = vec![
|
||||
@@ -236,7 +237,8 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
environment.routers[0].routes[0].application_name = "postgres-app".to_string();
|
||||
environment.routers[0].routes[0].application_name = app_name.clone();
|
||||
|
||||
let environment_to_redeploy = environment.clone();
|
||||
let environment_check = environment.clone();
|
||||
let ea_redeploy = EnvironmentAction::Environment(environment_to_redeploy);
|
||||
@@ -284,7 +286,8 @@ fn test_postgresql_configuration(context: Context, mut environment: Environment,
|
||||
let _enter = span.enter();
|
||||
let context_for_delete = context.clone_not_same_execution_id();
|
||||
|
||||
let database_host = "postgres-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; //
|
||||
let app_name = format!("postgresql-app-{}", generate_id());
|
||||
let database_host = "postgres-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN";
|
||||
let database_port = 5432;
|
||||
let database_db_name = "postgres".to_string();
|
||||
let database_username = "superuser".to_string();
|
||||
@@ -316,7 +319,7 @@ fn test_postgresql_configuration(context: Context, mut environment: Environment,
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.branch = "postgres-app".to_string();
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "ad65b24a0470e7e8aa0983e036fb9a05928fd973".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.dockerfile_path = Some(format!("Dockerfile-{}", version));
|
||||
@@ -345,7 +348,7 @@ fn test_postgresql_configuration(context: Context, mut environment: Environment,
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
environment.routers[0].routes[0].application_name = "postgres-app".to_string();
|
||||
environment.routers[0].routes[0].application_name = app_name.clone();
|
||||
|
||||
let mut environment_delete = environment.clone();
|
||||
environment_delete.action = Action::Delete;
|
||||
@@ -465,6 +468,7 @@ fn test_mongodb_configuration(context: Context, mut environment: Environment, ve
|
||||
let _enter = span.enter();
|
||||
let context_for_delete = context.clone_not_same_execution_id();
|
||||
|
||||
let app_name = format!("mongodb-app-{}", generate_id());
|
||||
let database_host = "mongodb-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; // External access check
|
||||
let database_port = 27017;
|
||||
let database_db_name = "my-mongodb".to_string();
|
||||
@@ -501,7 +505,7 @@ fn test_mongodb_configuration(context: Context, mut environment: Environment, ve
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.branch = "mongodb-app".to_string();
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "3fdc7e784c1d98b80446be7ff25e35370306d9a8".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.dockerfile_path = Some(format!("Dockerfile-{}", version));
|
||||
@@ -546,7 +550,7 @@ fn test_mongodb_configuration(context: Context, mut environment: Environment, ve
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
environment.routers[0].routes[0].application_name = "mongodb-app".to_string();
|
||||
environment.routers[0].routes[0].application_name = app_name.clone();
|
||||
|
||||
let mut environment_delete = environment.clone();
|
||||
environment_delete.action = Action::Delete;
|
||||
@@ -663,6 +667,7 @@ fn test_mysql_configuration(context: Context, mut environment: Environment, vers
|
||||
|
||||
let deletion_context = context.clone_not_same_execution_id();
|
||||
|
||||
let app_name = format!("mysql-app-{}", generate_id());
|
||||
let database_host = "mysql-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; // External access check
|
||||
let database_port = 3306;
|
||||
let database_db_name = "mysqldatabase".to_string();
|
||||
@@ -695,7 +700,7 @@ fn test_mysql_configuration(context: Context, mut environment: Environment, vers
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.branch = "mysql-app".to_string();
|
||||
app.branch = app_name.clone();
|
||||
app.commit_id = "fc8a87b39cdee84bb789893fb823e3e62a1999c0".to_string();
|
||||
app.private_port = Some(1234);
|
||||
app.dockerfile_path = Some(format!("Dockerfile-{}", version));
|
||||
@@ -732,7 +737,7 @@ fn test_mysql_configuration(context: Context, mut environment: Environment, vers
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
environment.routers[0].routes[0].application_name = "mysql-app".to_string();
|
||||
environment.routers[0].routes[0].application_name = app_name.clone();
|
||||
|
||||
let mut environment_delete = environment.clone();
|
||||
environment_delete.action = Action::Delete;
|
||||
@@ -821,6 +826,7 @@ fn test_redis_configuration(context: Context, mut environment: Environment, vers
|
||||
|
||||
let context_for_delete = context.clone_not_same_execution_id();
|
||||
|
||||
let app_name = format!("redis-app-{}", generate_id());
|
||||
let database_host = "redis-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; // External access check
|
||||
let database_port = 6379;
|
||||
let database_db_name = "my-redis".to_string();
|
||||
@@ -853,7 +859,7 @@ fn test_redis_configuration(context: Context, mut environment: Environment, vers
|
||||
.applications
|
||||
.into_iter()
|
||||
.map(|mut app| {
|
||||
app.name = "redis-app".to_string();
|
||||
app.name = app_name.clone();
|
||||
app.branch = "redis-app".to_string();
|
||||
app.commit_id = "80ad41fbe9549f8de8dbe2ca4dd5d23e8ffc92de".to_string();
|
||||
app.private_port = Some(1234);
|
||||
@@ -891,7 +897,7 @@ fn test_redis_configuration(context: Context, mut environment: Environment, vers
|
||||
app
|
||||
})
|
||||
.collect::<Vec<qovery_engine::models::Application>>();
|
||||
environment.routers[0].routes[0].application_name = "redis-app".to_string();
|
||||
environment.routers[0].routes[0].application_name = app_name.clone();
|
||||
|
||||
let mut environment_delete = environment.clone();
|
||||
environment_delete.action = Action::Delete;
|
||||
|
||||
Reference in New Issue
Block a user