diff --git a/.travis.yml b/.travis.yml index ed763ac..d4ead12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ os: # - windows # TODO: https://github.com/pingcap/kvproto/issues/355 - osx rust: - # Requires nightly for now, stable can be re-enabled when async/await is stable. - # - stable + - stable - nightly env: global: @@ -36,7 +35,9 @@ install: script: - if [[ $TRAVIS_OS_NAME == "linux" ]]; then cargo fmt -- --check; fi - if [[ $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy -- -D clippy::all; fi - - cargo test --all -- --nocapture + - cargo build --all + - cargo build --examples + - if [[ $TRAVIS_RUST_VERSION == "nightly" ]]; then cargo test --all -- --nocapture; fi # For now we only run full integration tests on Linux. Here's why: # * Docker on OS X is not supported by Travis. # * Docker on Windows seems to not have the correct binary at `"/c/Program Files/Docker/Docker/DockerCli.exe" to switch it to Linux containers. diff --git a/Cargo.toml b/Cargo.toml index a7edc12..a70d96e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,30 +21,27 @@ name = "tikv_client" derive-new = "0.5" failure = "0.1" futures = { version = "0.3.1", features = ["compat", "async-await", "thread-pool"] } -grpcio = { version = "0.5.0-alpha", features = [ "secure", "prost-codec" ], default-features = false } +grpcio = { version = "0.5.0", features = [ "secure", "prost-codec" ], default-features = false } kvproto = { git = "https://github.com/pingcap/kvproto.git", features = [ "prost-codec" ], default-features = false } lazy_static = "1" -log = "0.3.9" +log = "0.4" regex = "1" serde = "1.0" serde_derive = "1.0" -futures-timer = "2.0" +futures-timer = "3.0" [dependencies.prometheus] -version = "0.4.2" +version = "0.8" default-features = false features = ["push", "process"] [dev-dependencies] clap = "2.32" tempdir = "0.3" -runtime = { version = "0.3.0-alpha.8", default-features = false } -runtime-tokio = "0.3.0-alpha.6" +tokio = { version = "0.2", features = ["rt-threaded", "macros"] } proptest = "0.9" proptest-derive = "0.1.0" fail = { version = "0.3", features = [ "failpoints" ] } -[replace] -"protobuf:2.8.0" = { git = "https://github.com/nrc/rust-protobuf", rev="4df576feca3b10c01d55b0e7c634bfab30982087" } -"protobuf-build:0.10.0" = { git = "https://github.com/tikv/protobuf-build", rev="42e52b9311f7fb31bbbe089fef5a24ec0392f9ce" } - +[patch.crates-io] +raft-proto = { git = "https://github.com/tikv/raft-rs", rev = "e624c1d48460940a40d8aa69b5329460d9af87dd" } \ No newline at end of file diff --git a/examples/raw.rs b/examples/raw.rs index 722e92a..2c68f56 100644 --- a/examples/raw.rs +++ b/examples/raw.rs @@ -10,7 +10,7 @@ use tikv_client::{Config, Key, KvPair, RawClient as Client, Result, ToOwnedRange const KEY: &str = "TiKV"; const VALUE: &str = "Rust"; -#[runtime::main(runtime_tokio::Tokio)] +#[tokio::main] async fn main() -> Result<()> { // You can try running this example by passing your pd endpoints // (and SSL options if necessary) through command line arguments. diff --git a/examples/transaction.rs b/examples/transaction.rs index 68bfc41..055a7b8 100644 --- a/examples/transaction.rs +++ b/examples/transaction.rs @@ -48,7 +48,7 @@ async fn dels(client: &Client, keys: impl IntoIterator) { txn.commit().await.expect("Could not commit transaction"); } -#[runtime::main(runtime_tokio::Tokio)] +#[tokio::main] async fn main() { // You can try running this example by passing your pd endpoints // (and SSL options if necessary) through command line arguments. diff --git a/rust-toolchain b/rust-toolchain index 85d0bf1..bf867e0 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2019-11-16 \ No newline at end of file +nightly diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index ad81200..542dba3 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; use std::env; use tikv_client::{Config, Key, Result, TransactionClient, Value}; -#[runtime::test(runtime_tokio::Tokio)] +#[tokio::test] async fn get_timestamp() -> Fallible<()> { const COUNT: usize = 1 << 16; let config = Config::new(pd_addrs()); @@ -25,7 +25,7 @@ async fn get_timestamp() -> Fallible<()> { Ok(()) } -#[runtime::test(runtime_tokio::Tokio)] +#[tokio::test] async fn crud() -> Fallible<()> { let config = Config::new(pd_addrs());