[package]
name = "tests"
version = "0.0.1"
edition = "2018"
publish = false

[[test]]
name = "failpoints"
path = "failpoints/mod.rs"
required-features = ["failpoints", "testexport"]

[[test]]
name = "integrations"
path = "integrations/mod.rs"
required-features = ["testexport"]

[[test]]
name = "cloud_engine"
path = "cloud_engine/mod.rs"
required-features = ["testexport"]

[[test]]
name = "random"
path = "random/mod.rs"
required-features = ["testexport", "failpoints"]

[[test]]
name = "cloud_engine_failpoints"
path = "cloud_engine_failpoints/mod.rs"
required-features = ["failpoints", "testexport"]

[[bench]]
name = "coprocessor_executors"
harness = false
path = "benches/coprocessor_executors/mod.rs"

[[bench]]
name = "hierarchy"
harness = false
path = "benches/hierarchy/mod.rs"

[[bench]]
name = "misc"
path = "benches/misc/mod.rs"
test = true

[[bench]]
name = "deadlock_detector"
harness = false
path = "benches/deadlock_detector/mod.rs"

[[bench]]
name = "storage_class"
harness = false
path = "cloud_engine_benches/storage_class/mod.rs"

[[bench]]
name = "memory"
harness = false
path = "benches/memory/mod.rs"

[features]
default = ["failpoints", "testexport", "cloud-aws", "cloud-gcp", "cloud-azure"]
failpoints = [
    "fail/failpoints",
    "tikv/failpoints",
    "pd_client/failpoints",
    "tikv_util/failpoints",
    "cloud_server/failpoints",
    "rfstore/failpoints",
    "native_br/failpoints",
    "rfengine/failpoints",
    "merged_engine/failpoints",
]
cloud-aws = ["external_storage_export/cloud-aws"]
cloud-gcp = ["external_storage_export/cloud-gcp"]
cloud-azure = ["external_storage_export/cloud-azure"]
testexport = [
    "raftstore/testexport",
    "tikv/testexport",
    "tikv_kv/testexport",
    "pd_client/testexport",
    "kvengine/testexport",
    "schema/testexport",
    "rfstore/testexport",
    "rfengine/testexport",
    "native_br/testexport",
    "cloud_worker/testexport",
    "test_cloud_server/testexport",
    "tikv_util/testexport",
    "replication_worker/testexport",
]
profiling = ["profiler/profiling"]

# Usage: set environment variable RUST_LOG (e.g, export RUST_LOG="info,raft=debug")
# Ref: https://docs.rs/env_logger/latest/env_logger/#enabling-logging
env-logger = ["tikv_util/env-logger", "slog-envlogger"]
jemalloc = ["tikv/jemalloc"]
mimalloc = ["tikv/mimalloc"]
snmalloc = ["tikv/snmalloc"]
mem-profiling = ["tikv/mem-profiling"]
sse = ["tikv/sse"]
portable = ["tikv/portable"]

debug-trace-ia-segments = ["kvengine/debug-trace-ia-segments"]
debug-trace-mem-table = ["kvengine/debug-trace-mem-table"]
debug-trace-txn-tasks = [
    "tikv/debug-trace-txn-tasks",
    "test_cloud_server/debug-trace-txn-tasks",
]

[dependencies]
api_version = { workspace = true }
async-trait = { workspace = true }
batch-system = { workspace = true }
bincode = { workspace = true }
builtin_dfs = { workspace = true }
bytes = { workspace = true }
cdc = { workspace = true }
chrono = { workspace = true }
clara_fts = { workspace = true }
cloud_encryption = { workspace = true }
cloud_server = { workspace = true }
cloud_worker = { workspace = true }
collections = { workspace = true }
crc64fast = { workspace = true }
crossbeam = { workspace = true }
dashmap = { workspace = true }
encryption = { workspace = true }
encryption_conf_change = { workspace = true }
error_code = { workspace = true }
etcd-client = { workspace = true }
fail = { workspace = true }
file_system = { workspace = true }
futures = { workspace = true }
grpcio = { workspace = true }
grpcio-health = { workspace = true }
health_controller = { workspace = true }
hex = { workspace = true }
http = { workspace = true }
kvengine = { workspace = true, features = ["testexport"] }
kvenginepb = { workspace = true }
kvproto = { workspace = true }
libc = { workspace = true }
load_data = { workspace = true }
log = { workspace = true }
log_wrappers = { workspace = true }
matches = { workspace = true }
merged_engine = { workspace = true }
more-asserts = { workspace = true }
native_br = { workspace = true }
online_config = { workspace = true }
paste = { workspace = true }
pd_client = { workspace = true }
protobuf = { workspace = true }
raft = { workspace = true }
raft-proto = { workspace = true }
raftstore = { workspace = true }
rand = "0.8.3"
replication_worker = { workspace = true }
rfengine = { workspace = true }
rfenginepb = { workspace = true }
rfstore = { workspace = true }
schema = { workspace = true }
serde_json = { workspace = true }
slog = { workspace = true }
slog-envlogger = { workspace = true, optional = true }
slog-global = { workspace = true }
sqlx = { workspace = true }
tempfile = { workspace = true }
tidb_query_aggr = { workspace = true }
tidb_query_common = { workspace = true }
tidb_query_datatype = { workspace = true }
tidb_query_executors = { workspace = true }
tidb_query_expr = { workspace = true }
tikv = { workspace = true }
tikv-client = { workspace = true }
tikv_util = { workspace = true }
tipb = { workspace = true }
toml = { workspace = true }
tracker = { workspace = true }
txn_types = { workspace = true }
url = { workspace = true }
uuid = { workspace = true }
workspace-hack = { version = "0.1", path = "../workspace-hack" }

[target.'cfg(target_os = "linux")'.dependencies]
procinfo = { git = "https://github.com/tikv/procinfo-rs", rev = "6599eb9dca74229b2c1fcc44118bef7eff127128" }

[dev-dependencies]
anyhow = { workspace = true }
arrow = { workspace = true }
byteorder = { workspace = true }
# See https://bheisler.github.io/criterion.rs/book/user_guide/known_limitations.html for the usage
# of `real_blackbox` feature.
codec = { workspace = true }
concurrency_manager = { workspace = true }
criterion = "0.3"
criterion-cpu-time = { workspace = true }
engine_traits = { workspace = true }
external_storage_export = { workspace = true }
file_system = { workspace = true }
hyper = { workspace = true }
keys = { workspace = true }
lazy_static = { workspace = true }
panic_hook = { workspace = true }
profiler = { workspace = true }
proptest = { workspace = true }
rand_xorshift = { workspace = true }
resource_control = { workspace = true }
resource_metering = { workspace = true }
rstest = { workspace = true }
security = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true }
serde_json = { workspace = true }
serial_test = { workspace = true }
sst_importer = { workspace = true }
test_cloud_server = { workspace = true }
test_coprocessor = { workspace = true }
test_pd = { workspace = true }
test_pd_client = { workspace = true }
test_raftstore = { workspace = true }
test_rfstore = { workspace = true }
test_sst_importer = { workspace = true }
test_storage = { workspace = true }
test_util = { workspace = true }
tidb_query_datatype = { workspace = true }
tikv-client = { workspace = true }
tikv_kv = { workspace = true }
tipb_helper = { workspace = true }
tokio = { workspace = true }

[target.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.dev-dependencies]
criterion-linux-perf = "0.1"
