mirror of https://github.com/tikv/client-rust.git
temporarily disable proptest
Signed-off-by: ekexium <ekexium@gmail.com>
This commit is contained in:
parent
bb1961d790
commit
1d3b3b86b1
|
@ -1,12 +1,10 @@
|
|||
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
|
||||
|
||||
use futures::{FutureExt, TryFutureExt};
|
||||
use grpcio::{ChannelBuilder, EnvBuilder, Environment, ResourceQuota, Server, ServerBuilder};
|
||||
use io::Read;
|
||||
use grpcio::{Environment, Server, ServerBuilder};
|
||||
use kvproto::{kvrpcpb::*, tikvpb::*};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
io,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
|
@ -302,7 +300,7 @@ impl Tikv for MockTikv {
|
|||
data.remove(key).unwrap();
|
||||
});
|
||||
} else {
|
||||
resp.set_error(format!("Non-existent keys:[{}]", pairs.join(", ")).to_owned());
|
||||
resp.set_error(format!("Non-existent keys:[{}]", pairs.join(", ")));
|
||||
}
|
||||
let f = sink
|
||||
.success(resp)
|
||||
|
|
|
@ -136,9 +136,9 @@ mod test {
|
|||
use crate::{mock::MockRpcPdClient, pd::PdClient, request::KvRequest};
|
||||
use grpcio::redirect_log;
|
||||
|
||||
use mock_tikv::start_server;
|
||||
use simple_logger::SimpleLogger;
|
||||
use mock_tikv::start_server;
|
||||
use tikv_client_common::{Config, KvPair};
|
||||
use tikv_client_common::{Config, KvPair};
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_raw_put_get() {
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
|
||||
|
||||
/*
|
||||
* FIXME: temporarily disable proptest because proptest-derive doesn't work in Rust 1.48.0 nightly.
|
||||
* Resume them when the issue is fixed.
|
||||
|
||||
use super::{arb_batch, pd_addrs};
|
||||
use crate::{raw::Client, Config, KvPair, Value};
|
||||
use futures::executor::block_on;
|
||||
|
@ -58,3 +63,5 @@ proptest! {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
|
@ -55,7 +55,7 @@ use std::{
|
|||
/// on ranges will accept any types which implement `Into<BoundRange>`.
|
||||
/// which means all of the above types can be passed directly to those functions.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(test, derive(Arbitrary))]
|
||||
// #[cfg_attr(test, derive(Arbitrary))]
|
||||
pub struct BoundRange {
|
||||
from: Bound<Key>,
|
||||
to: Bound<Key>,
|
||||
|
|
|
@ -4,7 +4,6 @@ use super::HexRepr;
|
|||
use kvproto::kvrpcpb;
|
||||
#[allow(unused_imports)]
|
||||
use proptest::{arbitrary::any_with, collection::size_range};
|
||||
use proptest_derive::Arbitrary;
|
||||
use std::{fmt, ops::Bound, u8};
|
||||
|
||||
const _PROPTEST_KEY_MAX: usize = 1024 * 2; // 2 KB
|
||||
|
@ -50,13 +49,14 @@ const _PROPTEST_KEY_MAX: usize = 1024 * 2; // 2 KB
|
|||
///
|
||||
/// Many functions which accept a `Key` accept an `Into<Key>`, which means all of the above types
|
||||
/// can be passed directly to those functions.
|
||||
#[derive(Default, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Arbitrary)]
|
||||
#[derive(Default, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
// #[cfg_attr(test, derive(Arbitrary))]
|
||||
#[repr(transparent)]
|
||||
pub struct Key(
|
||||
#[cfg_attr(
|
||||
test,
|
||||
proptest(strategy = "any_with::<Vec<u8>>((size_range(_PROPTEST_KEY_MAX), ()))")
|
||||
)]
|
||||
// #[cfg_attr(
|
||||
// test,
|
||||
// proptest(strategy = "any_with::<Vec<u8>>((size_range(_PROPTEST_KEY_MAX), ()))")
|
||||
// )]
|
||||
pub(super) Vec<u8>,
|
||||
);
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use super::{HexRepr, Key, Value};
|
||||
use kvproto::kvrpcpb;
|
||||
use proptest_derive::Arbitrary;
|
||||
use std::{fmt, str};
|
||||
|
||||
/// A key/value pair.
|
||||
|
@ -18,7 +17,8 @@ use std::{fmt, str};
|
|||
///
|
||||
/// Many functions which accept a `KvPair` accept an `Into<KvPair>`, which means all of the above
|
||||
/// types (Like a `(Key, Value)`) can be passed directly to those functions.
|
||||
#[derive(Default, Clone, Eq, PartialEq, Arbitrary)]
|
||||
#[derive(Default, Clone, Eq, PartialEq)]
|
||||
// #[cfg(test, derive(Arbitrary))]
|
||||
pub struct KvPair(pub Key, pub Value);
|
||||
|
||||
impl KvPair {
|
||||
|
|
Loading…
Reference in New Issue