@@ -16,6 +16,7 @@ use std::path::{Path, PathBuf};
1616use std:: sync:: Arc ;
1717
1818use crate :: components;
19+ use crate :: components:: cassandra:: docker:: DockerCassandra ;
1920use crate :: components:: cassandra:: Cassandra ;
2021use crate :: components:: component_compilation_service:: docker:: DockerComponentCompilationService ;
2122use crate :: components:: component_compilation_service:: spawned:: SpawnedComponentCompilationService ;
@@ -80,7 +81,7 @@ impl EnvBasedTestDependenciesConfig {
8081 self . keep_docker_containers = keep_docker_containers
8182 }
8283
83- if let Some ( redis_port) = opt_env_var ( "REDIS_KEY_PREFIX " ) {
84+ if let Some ( redis_port) = opt_env_var ( "REDIS_PORT " ) {
8485 self . redis_port = redis_port. parse ( ) . expect ( "Failed to parse REDIS_PORT" ) ;
8586 }
8687
@@ -152,6 +153,7 @@ pub struct EnvBasedTestDependencies {
152153 component_compilation_service : Arc < dyn ComponentCompilationService + Send + Sync + ' static > ,
153154 worker_service : Arc < dyn WorkerService + Send + Sync + ' static > ,
154155 worker_executor_cluster : Arc < dyn WorkerExecutorCluster + Send + Sync + ' static > ,
156+ cassandra : Arc < dyn Cassandra + Send + Sync + ' static > ,
155157}
156158
157159impl EnvBasedTestDependencies {
@@ -407,6 +409,12 @@ impl EnvBasedTestDependencies {
407409 }
408410 }
409411
412+ fn make_cassandra (
413+ _config : Arc < EnvBasedTestDependenciesConfig > ,
414+ ) -> Arc < dyn Cassandra + Send + Sync + ' static > {
415+ Arc :: new ( DockerCassandra :: new ( false ) )
416+ }
417+
410418 pub async fn new ( config : EnvBasedTestDependenciesConfig ) -> Self {
411419 let config = Arc :: new ( config) ;
412420
@@ -462,6 +470,8 @@ impl EnvBasedTestDependencies {
462470
463471 let redis_monitor = redis_monitor_join. await . expect ( "Failed to join" ) ;
464472
473+ let cassandra = Self :: make_cassandra ( config. clone ( ) ) ;
474+
465475 Self {
466476 config : config. clone ( ) ,
467477 rdb,
@@ -472,6 +482,7 @@ impl EnvBasedTestDependencies {
472482 component_compilation_service,
473483 worker_service,
474484 worker_executor_cluster,
485+ cassandra,
475486 }
476487 }
477488}
@@ -515,7 +526,7 @@ impl TestDependencies for EnvBasedTestDependencies {
515526 self . worker_executor_cluster . clone ( )
516527 }
517528 fn cassandra ( & self ) -> Arc < dyn Cassandra + Send + Sync + ' static > {
518- panic ! ( "Not supported" )
529+ self . cassandra . clone ( )
519530 }
520531}
521532
0 commit comments