Skip to content

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
irach-ramos committed Oct 2, 2024
1 parent e4f4e22 commit dfdd283
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions golem-test-framework/src/config/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use crate::components::worker_service::docker::DockerWorkerService;
use crate::components::worker_service::spawned::SpawnedWorkerService;
use crate::components::worker_service::WorkerService;
use crate::config::{DbType, TestDependencies};
use once_cell::sync::Lazy;
use tracing::Level;

pub struct EnvBasedTestDependenciesConfig {
Expand Down Expand Up @@ -153,7 +154,7 @@ pub struct EnvBasedTestDependencies {
component_compilation_service: Arc<dyn ComponentCompilationService + Send + Sync + 'static>,
worker_service: Arc<dyn WorkerService + Send + Sync + 'static>,
worker_executor_cluster: Arc<dyn WorkerExecutorCluster + Send + Sync + 'static>,
cassandra: Arc<dyn Cassandra + Send + Sync + 'static>,
cassandra: Lazy<Arc<dyn Cassandra + Send + Sync + 'static>>,
}

impl EnvBasedTestDependencies {
Expand Down Expand Up @@ -411,8 +412,8 @@ impl EnvBasedTestDependencies {

fn make_cassandra(
_config: Arc<EnvBasedTestDependenciesConfig>,
) -> Arc<dyn Cassandra + Send + Sync + 'static> {
Arc::new(DockerCassandra::new(false))
) -> Lazy<Arc<dyn Cassandra + Send + Sync + 'static>> {
Lazy::new(|| Arc::new(DockerCassandra::new(false)))
}

pub async fn new(config: EnvBasedTestDependenciesConfig) -> Self {
Expand Down
3 changes: 1 addition & 2 deletions golem-worker-executor-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub mod error;
pub mod grpc;
pub mod http_server;

pub mod cassandra;
pub mod function_result_interpreter;
pub mod invocation;
pub mod metrics;
Expand Down Expand Up @@ -65,7 +64,6 @@ use crate::storage::keyvalue::KeyValueStorage;
use crate::workerctx::WorkerCtx;
use anyhow::anyhow;
use async_trait::async_trait;
use cassandra::CassandraSession;
use golem_api_grpc::proto;
use golem_api_grpc::proto::golem::workerexecutor::v1::worker_executor_server::WorkerExecutorServer;
use golem_common::golem_version;
Expand All @@ -74,6 +72,7 @@ use humansize::{ISizeFormatter, BINARY};
use nonempty_collections::NEVec;
use prometheus::Registry;
use std::sync::Arc;
use storage::cassandra::CassandraSession;
use storage::keyvalue::cassandra::CassandraKeyValueStorage;
use storage::keyvalue::sqlite::SqliteKeyValueStorage;
use storage::sqlite_types::SqlitePool;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions golem-worker-executor-base/src/storage/keyvalue/cassandra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::{
use crate::storage::{
cassandra::CassandraSession,
storage::keyvalue::{KeyValueStorage, KeyValueStorageNamespace},
keyvalue::{KeyValueStorage, KeyValueStorageNamespace},
};
use async_trait::async_trait;
use bytes::Bytes;
Expand Down
1 change: 1 addition & 0 deletions golem-worker-executor-base/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

pub mod blob;
pub mod cassandra;
pub mod indexed;
pub mod keyvalue;
pub mod sqlite_types;
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/key_value_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use golem_common::redis::RedisPool;
use golem_test_framework::components::redis::Redis;
use golem_test_framework::components::redis_monitor::RedisMonitor;
use golem_test_framework::config::TestDependencies;
use golem_worker_executor_base::cassandra::CassandraSession;
use golem_worker_executor_base::storage::cassandra::CassandraSession;
use golem_worker_executor_base::storage::keyvalue::cassandra::CassandraKeyValueStorage;
use golem_worker_executor_base::storage::keyvalue::memory::InMemoryKeyValueStorage;
use golem_worker_executor_base::storage::keyvalue::redis::RedisKeyValueStorage;
Expand Down

0 comments on commit dfdd283

Please sign in to comment.