Ensure empty payload is allowed

Bump Skytable driver git revision to ensure builds don't fail
(possibly a force push).
next
Sayan Nandan 2 years ago
parent ec24b2caad
commit a018b76f40
No known key found for this signature in database
GPG Key ID: 8BC07A0A4D41DD52

60
Cargo.lock generated

@ -91,14 +91,14 @@ checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b"
[[package]]
name = "bb8"
version = "0.7.1"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9f4fa9768efd269499d8fba693260cfc670891cf6de3adc935588447a77cc8"
checksum = "1627eccf3aa91405435ba240be23513eeca466b5dc33866422672264de061582"
dependencies = [
"async-trait",
"futures-channel",
"futures-util",
"parking_lot 0.11.2",
"parking_lot 0.12.0",
"tokio",
]
@ -460,9 +460,9 @@ dependencies = [
[[package]]
name = "flate2"
version = "1.0.22"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
dependencies = [
"cfg-if",
"crc32fast",
@ -556,7 +556,7 @@ dependencies = [
"log",
"openssl",
"powershell_script",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust.git)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust.git)",
"zip",
]
@ -661,9 +661,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.122"
version = "0.2.123"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259"
checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd"
[[package]]
name = "libsky"
@ -722,12 +722,11 @@ dependencies = [
[[package]]
name = "miniz_oxide"
version = "0.4.4"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
dependencies = [
"adler",
"autocfg",
]
[[package]]
@ -1043,9 +1042,9 @@ dependencies = [
[[package]]
name = "rayon"
version = "1.5.1"
version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221"
dependencies = [
"autocfg",
"crossbeam-deque",
@ -1055,14 +1054,13 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.9.1"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"lazy_static",
"num_cpus",
]
@ -1116,9 +1114,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rustix"
version = "0.34.2"
version = "0.34.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96619609a54d638872db136f56941d34e2a00bb0acf3fa783a90d6b96a093ba2"
checksum = "cb617eb09c4ef1536405e357e3b63f39e3ab4cc2159db05395278ad5c352bb16"
dependencies = [
"bitflags",
"errno",
@ -1266,7 +1264,7 @@ dependencies = [
"rand",
"serde",
"serde_json",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust?branch=next)",
]
[[package]]
@ -1277,7 +1275,7 @@ dependencies = [
"clap",
"env_logger",
"log",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust.git)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust.git)",
]
[[package]]
@ -1316,7 +1314,7 @@ dependencies = [
"regex",
"serde",
"sky_macros",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust?branch=next)",
"tokio",
"tokio-openssl",
"toml",
@ -1331,14 +1329,14 @@ dependencies = [
"crossterm",
"libsky",
"rustyline",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust?branch=next)",
"tokio",
]
[[package]]
name = "skytable"
version = "0.7.0-alpha.4"
source = "git+https://github.com/skytable/client-rust?branch=next#feb1dda0c41c866e6e52dac6589fadc20b41af68"
version = "0.7.0"
source = "git+https://github.com/skytable/client-rust?branch=next#297bd18fb864dc89f0a5c1a42b95a43150127597"
dependencies = [
"async-trait",
"bb8",
@ -1351,8 +1349,8 @@ dependencies = [
[[package]]
name = "skytable"
version = "0.7.0-alpha.4"
source = "git+https://github.com/skytable/client-rust.git#feb1dda0c41c866e6e52dac6589fadc20b41af68"
version = "0.7.0"
source = "git+https://github.com/skytable/client-rust.git#297bd18fb864dc89f0a5c1a42b95a43150127597"
dependencies = [
"r2d2",
]
@ -1396,7 +1394,7 @@ dependencies = [
"log",
"num_cpus",
"rand",
"skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"skytable 0.7.0 (git+https://github.com/skytable/client-rust?branch=next)",
"sysinfo",
]
@ -1425,9 +1423,9 @@ dependencies = [
[[package]]
name = "sysinfo"
version = "0.23.9"
version = "0.23.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3fb8adaa82317f1e8a040281807f411803c9111303cfe129b4abb4a14b2c223"
checksum = "4eea2ed6847da2e0c7289f72cb4f285f0bd704694ca067d32be811b2a45ea858"
dependencies = [
"cfg-if",
"core-foundation-sys",
@ -1550,9 +1548,9 @@ dependencies = [
[[package]]
name = "toml"
version = "0.5.8"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
dependencies = [
"serde",
]

@ -274,5 +274,4 @@ fn clear_screen() {
let mut stdout = stdout();
execute!(stdout, Clear(ClearType::All)).expect("Failed to clear screen");
execute!(stdout, cursor::MoveTo(0, 0)).expect("Failed to move cursor to origin");
drop(stdout); // aggressively drop stdout
}

@ -82,7 +82,7 @@ pub fn build(mode: BuildMode) -> HarnessResult<PathBuf> {
let target_folder = util::get_target_folder(mode);
if let Some(t) = util::get_var(util::VAR_TARGET) {
build_args.push("--target".to_owned());
build_args.push(t.to_string());
build_args.push(t);
};
// assemble build args

@ -28,11 +28,11 @@ use crate::{
util::{self},
HarnessError, HarnessResult, ROOT_DIR,
};
use skytable::Connection;
use skytable::{error::Error, Connection, SkyResult};
#[cfg(windows)]
use std::os::windows::process::CommandExt;
use std::{
io::{Error as IoError, ErrorKind},
io::ErrorKind,
path::Path,
process::{Child, Command},
};
@ -92,10 +92,10 @@ pub(super) fn wait_for_server_exit() -> HarnessResult<()> {
Ok(())
}
fn connection_refused<T>(input: Result<T, IoError>) -> HarnessResult<bool> {
fn connection_refused<T>(input: SkyResult<T>) -> HarnessResult<bool> {
match input {
Ok(_) => Ok(false),
Err(e)
Err(Error::IoError(e))
if matches!(
e.kind(),
ErrorKind::ConnectionRefused | ErrorKind::ConnectionReset

@ -66,8 +66,8 @@ struct ConnectionEntityState {
impl ConnectionEntityState {
fn default(ks: Arc<Keyspace>, tbl: Arc<Table>) -> Self {
Self {
table: Some((DEFAULT.clone(), tbl)),
ks: Some((DEFAULT.clone(), ks)),
table: Some((DEFAULT, tbl)),
ks: Some((DEFAULT, ks)),
}
}
fn set_ks(&mut self, ks: Arc<Keyspace>, ksid: ObjectID) {

@ -580,6 +580,16 @@ fn simple_query_okay() {
let query = simple_query(ret);
assert_eq!(query.into_owned().data, v!["SET", "x", "100"]);
}
#[test]
fn simple_query_okay_empty_elements() {
let body = v!(b"*3\n3\nSET0\n0\n");
let ret = Parser::parse(&body).unwrap();
assert_eq!(ret.forward, body.len());
let query = simple_query(ret);
assert_eq!(query.into_owned().data, v!["SET", "", ""]);
}
#[test]
fn parse_fail_because_not_enough() {
let full_payload = b"*3\n3\nSET1\nx3\n100";
@ -608,6 +618,18 @@ fn pipelined_query_okay() {
)
}
#[test]
fn pipelined_query_okay_empty_elements() {
let body = v!(b"$2\n3\n3\nSET0\n3\n1002\n3\nGET0\n");
let ret = Parser::parse(&body).unwrap();
assert_eq!(ret.forward, body.len());
let query = pipelined_query(ret);
assert_eq!(
query.into_owned().data,
vec![v!["SET", "", "100"], v!["GET", ""]]
)
}
#[test]
fn pipelined_query_fail_because_not_enough() {
let full_payload = v!(b"$2\n3\n3\nSET1\nx3\n1002\n3\nGET1\nx");

@ -47,7 +47,7 @@ macro_rules! hoststr {
macro_rules! sanity_test {
($host:expr, $port:expr) => {{
// Run a sanity test
if let Err(e) = crate::util::run_sanity_test(&$host, $port) {
if let Err(e) = $crate::util::run_sanity_test(&$host, $port) {
Err(e)
} else {
Ok(())

Loading…
Cancel
Save