Skip to content

Commit

Permalink
Rename variable in all places
Browse files Browse the repository at this point in the history
  • Loading branch information
adzialocha committed Sep 6, 2023
1 parent 6de1052 commit 34e790e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions aquadoggo/src/graphql/mutations/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ mod tests {
let context = HttpServiceContext::new(
node.context.store.clone(),
manager,
node.context.config.blob_dir.as_ref().unwrap().to_path_buf(),
node.context.config.blobs_base_path.to_path_buf(),
);

let response = context.schema.execute(publish_request).await;
Expand Down Expand Up @@ -305,7 +305,7 @@ mod tests {
let context = HttpServiceContext::new(
node.context.store.clone(),
manager,
node.context.config.blob_dir.as_ref().unwrap().to_path_buf(),
node.context.config.blobs_base_path.to_path_buf(),
);

let response = context
Expand Down Expand Up @@ -337,7 +337,7 @@ mod tests {
let context = HttpServiceContext::new(
node.context.store.clone(),
manager,
node.context.config.blob_dir.as_ref().unwrap().to_path_buf(),
node.context.config.blobs_base_path.to_path_buf(),
);

context.schema.execute(publish_request).await;
Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/http/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ mod tests {
let context = HttpServiceContext::new(
node.context.store.clone(),
graphql_schema_manager,
node.context.config.blobs_base_path.into(),
node.context.config.blobs_base_path.clone(),
);
let client = TestClient::new(build_server(context));

Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/materializer/tasks/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mod tests {
assert!(result.unwrap().is_none());

// Construct the expected path to the blob view file
let base_path = node.context.config.blobs_base_path;
let base_path = &node.context.config.blobs_base_path;
let blob_path = base_path.join(blob_view_id.to_string());

// Read from this file
Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/test_utils/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub async fn http_test_client(node: &TestNode) -> TestClient {
let http_context = HttpServiceContext::new(
node.context.store.clone(),
manager,
node.context.config.blob_dir.as_ref().unwrap().to_path_buf(),
node.context.config.blobs_base_path.to_path_buf(),
);

TestClient::new(build_server(http_context))
Expand Down
14 changes: 6 additions & 8 deletions aquadoggo/src/test_utils/runner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

use std::sync::Arc;
use std::{fs, panic};

use futures::Future;
use p2panda_rs::identity::KeyPair;
Expand Down Expand Up @@ -101,14 +100,13 @@ pub fn test_runner<F: AsyncTestFn + Send + Sync + 'static>(test: F) {
let (_config, pool) = initialize_db().await;
let store = SqlStore::new(pool);

// Construct temporary directory for the test runner
let tmp_dir = tempfile::TempDir::new().unwrap();
let blobs_base_path = tmp_dir.path().join("blobs");
fs::create_dir_all(&blobs_base_path).unwrap();
// Construct temporary blobs directory for the test runner
let temp_dir = tempfile::TempDir::new()
.expect("Could not create temporary test directory for blobs storage");

// Construct node config supporting any schema
let mut config = Configuration::default();
config.blobs_base_path = blobs_base_path;
config.blobs_base_path = temp_dir.path().to_path_buf();

// Construct the actual test node
let node = TestNode {
Expand Down Expand Up @@ -141,7 +139,7 @@ pub fn test_runner<F: AsyncTestFn + Send + Sync + 'static>(test: F) {
// there, we need to propagate it further to inform the test runtime about the result
match result {
Ok(_) => (),
Err(err) => panic::resume_unwind(err.into_panic()),
Err(err) => std::panic::resume_unwind(err.into_panic()),

Check warning on line 142 in aquadoggo/src/test_utils/runner.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/test_utils/runner.rs#L142

Added line #L142 was not covered by tests
};
});
}
Expand Down Expand Up @@ -186,7 +184,7 @@ pub fn test_runner_with_manager<F: AsyncTestFnWithManager + Send + Sync + 'stati
// there, we need to propagate it further to inform the test runtime about the result
match result {
Ok(_) => (),
Err(err) => panic::resume_unwind(err.into_panic()),
Err(err) => std::panic::resume_unwind(err.into_panic()),

Check warning on line 187 in aquadoggo/src/test_utils/runner.rs

View check run for this annotation

Codecov / codecov/patch

aquadoggo/src/test_utils/runner.rs#L187

Added line #L187 was not covered by tests
};
});
}
2 changes: 1 addition & 1 deletion aquadoggo_cli/src/key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn save_key_pair_to_file(key_pair: &KeyPair, path: PathBuf) -> Result<()> {
fn save_key_pair_to_file(key_pair: &KeyPair, path: PathBuf) -> Result<()> {
let private_key_hex = hex::encode(key_pair.private_key().as_bytes());

let mut file = File::create(&path)?;
let mut file = File::create(path)?;
file.write_all(private_key_hex.as_bytes())?;
file.sync_all()?;

Expand Down

0 comments on commit 34e790e

Please sign in to comment.