mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
fix: database tests failure because of prefix
This commit is contained in:
committed by
Pierre Mavro
parent
8774f935a3
commit
dcf3e8075f
@@ -157,11 +157,11 @@ pub fn environment_3_apps_3_routers_3_databases(context: &Context) -> Environmen
|
||||
// mongoDB management part
|
||||
let database_host_mongo = "mongodb-".to_string() + generate_id().as_str() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN"; // External access check
|
||||
let database_port_mongo = 27017;
|
||||
let database_db_name_mongo = "my-mongodb".to_string();
|
||||
let database_db_name_mongo = "mymongodb".to_string();
|
||||
let database_username_mongo = "superuser".to_string();
|
||||
let database_password_mongo = generate_id();
|
||||
let database_uri_mongo = format!(
|
||||
"mongodb://{}:{}@{}:{}/{}",
|
||||
"mongodb://{}:{}@{}:{}/mongodb{}",
|
||||
database_username_mongo,
|
||||
database_password_mongo,
|
||||
database_host_mongo,
|
||||
@@ -176,13 +176,13 @@ pub fn environment_3_apps_3_routers_3_databases(context: &Context) -> Environmen
|
||||
let database_port = 5432;
|
||||
let database_username = "superuser".to_string();
|
||||
let database_password = generate_id();
|
||||
let database_name = "my-psql".to_string();
|
||||
let database_name = "mypsql".to_string();
|
||||
|
||||
// pSQL 2 management part
|
||||
let fqdn_id_2 = "my-postgresql-2".to_string() + generate_id().as_str();
|
||||
let fqdn_2 = fqdn_id_2.clone() + ".CHANGE-ME/DEFAULT_TEST_DOMAIN";
|
||||
let database_username_2 = "superuser2".to_string();
|
||||
let database_name_2 = "my-psql-2".to_string();
|
||||
let database_name_2 = "mypsql2".to_string();
|
||||
|
||||
Environment {
|
||||
execution_id: context.execution_id().to_string(),
|
||||
@@ -216,7 +216,7 @@ pub fn environment_3_apps_3_routers_3_databases(context: &Context) -> Environmen
|
||||
environment_variables: vec![
|
||||
EnvironmentVariable {
|
||||
key: "PG_DBNAME".to_string(),
|
||||
value: database_name.clone(),
|
||||
value: format!("postgresql{}", database_name),
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_HOST".to_string(),
|
||||
@@ -266,7 +266,7 @@ pub fn environment_3_apps_3_routers_3_databases(context: &Context) -> Environmen
|
||||
environment_variables: vec![
|
||||
EnvironmentVariable {
|
||||
key: "PG_DBNAME".to_string(),
|
||||
value: database_name_2.clone(),
|
||||
value: format!("postgresql{}", database_name_2),
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_HOST".to_string(),
|
||||
@@ -506,7 +506,7 @@ pub fn environnement_2_app_2_routers_1_psql(context: &Context) -> Environment {
|
||||
let database_port = 5432;
|
||||
let database_username = "superuser".to_string();
|
||||
let database_password = generate_id();
|
||||
let database_name = "my-psql".to_string();
|
||||
let database_name = "mypsql".to_string();
|
||||
|
||||
let suffix = generate_id();
|
||||
let application_name1 = sanitize_name("postgresql", &format!("{}-{}", "postgresql-app1", &suffix));
|
||||
@@ -561,7 +561,7 @@ pub fn environnement_2_app_2_routers_1_psql(context: &Context) -> Environment {
|
||||
environment_variables: vec![
|
||||
EnvironmentVariable {
|
||||
key: "PG_DBNAME".to_string(),
|
||||
value: database_name.clone(),
|
||||
value: format!("postgresql{}", database_name.clone()),
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_HOST".to_string(),
|
||||
@@ -611,7 +611,7 @@ pub fn environnement_2_app_2_routers_1_psql(context: &Context) -> Environment {
|
||||
environment_variables: vec![
|
||||
EnvironmentVariable {
|
||||
key: "PG_DBNAME".to_string(),
|
||||
value: database_name.clone(),
|
||||
value: format!("postgresql{}", database_name.clone()),
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_HOST".to_string(),
|
||||
|
||||
@@ -63,10 +63,7 @@ fn deploy_an_environment_with_3_databases_and_3_apps() {
|
||||
fn postgresql_failover_dev_environment_with_all_options() {
|
||||
init();
|
||||
|
||||
let span = span!(
|
||||
Level::INFO,
|
||||
"postgresql_deploy_a_working_development_environment_with_all_options"
|
||||
);
|
||||
let span = span!(Level::INFO, "postgresql_failover_dev_environment_with_all_options");
|
||||
let _enter = span.enter();
|
||||
|
||||
let context = context();
|
||||
@@ -100,7 +97,7 @@ fn postgresql_failover_dev_environment_with_all_options() {
|
||||
TransactionResult::UnrecoverableError(_, _) => assert!(false),
|
||||
};
|
||||
// TO CHECK: DATABASE SHOULDN'T BE RESTARTED AFTER A REDEPLOY
|
||||
let database_name = format!("{}-0", &environment_check.databases[0].name);
|
||||
let database_name = format!("postgresql{}-0", &environment_check.databases[0].name);
|
||||
match is_pod_restarted_aws_env(environment_check.clone(), database_name.as_str()) {
|
||||
(true, _) => assert!(true),
|
||||
(false, _) => assert!(false),
|
||||
@@ -185,7 +182,7 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
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();
|
||||
let database_db_name = "mypostgres".to_string();
|
||||
let database_username = "superuser".to_string();
|
||||
let database_password = generate_id();
|
||||
environment.databases = vec![Database {
|
||||
@@ -223,7 +220,7 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_DBNAME".to_string(),
|
||||
value: database_db_name.clone(),
|
||||
value: format!("postgresql{}", database_db_name),
|
||||
},
|
||||
EnvironmentVariable {
|
||||
key: "PG_USERNAME".to_string(),
|
||||
@@ -259,7 +256,7 @@ fn postgresql_deploy_a_working_environment_and_redeploy() {
|
||||
TransactionResult::UnrecoverableError(_, _) => assert!(false),
|
||||
};
|
||||
// TO CHECK: DATABASE SHOULDN'T BE RESTARTED AFTER A REDEPLOY
|
||||
let database_name = format!("{}-0", &environment_check.databases[0].name);
|
||||
let database_name = format!("postgresql{}-0", &environment_check.databases[0].name);
|
||||
match is_pod_restarted_aws_env(environment_check, database_name.as_str()) {
|
||||
(true, _) => assert!(true),
|
||||
(false, _) => assert!(false),
|
||||
|
||||
Reference in New Issue
Block a user