Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
  • Loading branch information
CalvinNeo committed Sep 18, 2023
1 parent fb960a5 commit 3c661f4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proxy_scripts/ci_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ elif [[ $M == "testnew" ]]; then
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::write
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::snapshot
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::normal::store
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::normal::config
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::config
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::normal::restart
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::normal::persist
cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::ingest
Expand Down
2 changes: 2 additions & 0 deletions proxy_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ raft_log_engine = { workspace = true }
raftstore = { workspace = true }
raftstore-v2 = { workspace = true }
rand = "0.8.3"
serde = "1.0"
serde_derive = "1.0"
slog = { version = "2.3", features = ["max_level_trace", "release_max_level_debug"] }
slog-global = { version = "0.1", git = "https://github.com/breeswish/slog-global.git", rev = "d592f88e4dbba5eb439998463054f1a44fbf17b9" }
tempfile = "3.0"
Expand Down
16 changes: 16 additions & 0 deletions proxy_tests/proxy/shared/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ fn test_default_no_config_item() {
let mut proxy_config = gen_proxy_config(&cpath, false, &mut v);
overwrite_config_with_cmd_args(&mut config, &mut proxy_config, &matches);
address_proxy_config(&mut config, &proxy_config);
use serde_derive::{Deserialize, Serialize};
use serde_json::{Map, Value};
#[derive(Serialize, Deserialize)]
struct Data {
inner: Map<String, Value>,
}
let json_format_proxy = serde_json::to_string(&proxy_config).unwrap();
let parsed_json_proxy: Data = serde_json::from_str(json_format_proxy.as_str()).unwrap();
{
let raft_store = parsed_json_proxy.inner.get("raft_store").unwrap();
let snap_handle_pool_size = raft_store.get("snap_handle_pool_size").unwrap();
assert_eq!(
proxy_config.raft_store.snap_handle_pool_size as u64,
snap_handle_pool_size.as_u64().unwrap()
);
}

let total_mem = SysQuota::memory_limit_in_bytes();
let cpu_num = SysQuota::cpu_cores_quota();
Expand Down

0 comments on commit 3c661f4

Please sign in to comment.