Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ prometheus = ["prometheus/push", "prometheus/process"]
# Enable integration tests with a running TiKV and PD instance.
# Use $PD_ADDRS, comma separated, to set the addresses the tests use.
integration-tests = []
# Test probes: drive a transaction's two-phase commit one phase at a time
# (`Transaction::probe`). For tests only.
test-utils = []

[lib]
name = "tikv_client"
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export RUSTFLAGS=-Dwarnings
export PD_ADDRS ?= 127.0.0.1:2379
export MULTI_REGION ?= 1

ALL_FEATURES := integration-tests
ALL_FEATURES := integration-tests test-utils

NEXTEST_ARGS := --config-file $(shell pwd)/config/nextest.toml

INTEGRATION_TEST_ARGS := --features "integration-tests" --test-threads 1
INTEGRATION_TEST_ARGS := --features "integration-tests test-utils" --test-threads 1

RUN_INTEGRATION_TEST := cargo nextest run ${NEXTEST_ARGS} --all ${INTEGRATION_TEST_ARGS}

Expand All @@ -24,7 +24,7 @@ check: generate
cargo clippy --all-targets --features "${ALL_FEATURES}" -- -D clippy::all

unit-test: generate
cargo nextest run ${NEXTEST_ARGS} --all --no-default-features
cargo nextest run ${NEXTEST_ARGS} --all --no-default-features --features test-utils

integration-test: integration-test-txn integration-test-raw

Expand Down
2 changes: 2 additions & 0 deletions src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub use transaction::Mutation;
pub use transaction::Scanner;
pub use transaction::Transaction;
pub use transaction::TransactionOptions;
#[cfg(feature = "test-utils")]
pub use transaction::TransactionProbe;

mod buffer;
mod client;
Expand Down
Loading
Loading