Skip to content

Commit

Permalink
ut
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhao-su committed Jul 3, 2024
1 parent 1d4549a commit 44d586b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd_all/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ mod test {
heap_profiling_dir: None,
dangerous_max_idle_secs: None,
connector_rpc_endpoint: None,
temp_secret_file_dir: None,
},
),
compute_opts: Some(
Expand All @@ -367,6 +368,7 @@ mod test {
async_stack_trace: None,
heap_profiling_dir: None,
connector_rpc_endpoint: None,
temp_secret_file_dir: None,
},
),
frontend_opts: Some(
Expand All @@ -383,6 +385,7 @@ mod test {
config_path: "src/config/test.toml",
metrics_level: None,
enable_barrier_read: None,
temp_secret_file_dir: None,
},
),
compactor_opts: None,
Expand Down
5 changes: 5 additions & 0 deletions src/common/secret/src/secret_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static INSTANCE: std::sync::OnceLock<LocalSecretManager> = std::sync::OnceLock::
#[derive(Debug)]
pub struct LocalSecretManager {
secrets: RwLock<HashMap<SecretId, Vec<u8>>>,
/// The local directory used to write secrets into file, so that it can be passed into some libararies
secret_file_dir: PathBuf,
}

Expand All @@ -59,6 +60,10 @@ impl LocalSecretManager {
/// # Panics
/// Panics if the secret manager is not initialized.
pub fn global() -> &'static LocalSecretManager {
// Initialize the secret manager for unit tests.
#[cfg(debug_assertions)]
LocalSecretManager::init(None);

INSTANCE.get().unwrap()
}

Expand Down

0 comments on commit 44d586b

Please sign in to comment.