Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't pass on fresh Master pull #91

Closed
brianbruggeman opened this issue Jan 23, 2021 · 22 comments
Closed

Tests don't pass on fresh Master pull #91

brianbruggeman opened this issue Jan 23, 2021 · 22 comments

Comments

@brianbruggeman
Copy link

I'm running macOS 10.14.6.

Reproduction Steps:

git clone https://github.com/aerospike/aerospike-client-rust.git \
 && docker run -v ${HOME}/.aerospike/data:/opt/aerospike/data -e "NAMESPACE=test" --rm -d -p 3000:3000 --name aerospike aerospike/aerospike-server \
 && cd aerospike-client-rust \
 && cargo test

Results:

running 20 tests
test bin::tests::into_bins ... ok
test net::parser::tests::read_addr_part ... ok
test net::host::tests::to_hosts ... ok
test key::tests::unsupported_float_key ... ok
test key::tests::unsupported_u64_key ... ok
test net::parser::tests::read_addr_tuple ... ok
test query::filter::tests::geo_filter_macros ... ok
test net::parser::tests::read_hosts ... ok
test record::tests::ttl_expiration_future ... ok
test record::tests::ttl_expiration_past ... ok
test record::tests::ttl_never_expires ... ok
test result_code::tests::from_result_code ... ok
test result_code::tests::from_unknown_result_code ... ok
test result_code::tests::into_string ... ok
test result_code::tests::unknown_into_string ... ok
test value::tests::as_geo ... ok
test value::tests::as_string ... ok
test key::tests::int_keys ... ok
test key::tests::string_keys ... ok
test key::tests::blob_keys ... ok

test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/client-0cb4beb2f607c922

running 5 tests
test cluster_name ... ok
test nodes ... ok
test get_node ... ok
test node_names ... ok
test close ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/lib-33687cbfd16d35e7

running 27 tests
test src::batch::batch_get ... ok
test src::cdt_bitwise::cdt_bitwise ... ok
test src::cdt_list::cdt_list ... ok
test src::cdt_map::map_operations ... ok
test src::exp::expression_rec_ops ... FAILED
test src::exp::expression_commands ... ok
test src::hll::hll ... ok
test src::index::recreate_index ... ok
test src::kv::connect ... ok
test src::exp::expression_condition ... ok
test src::query::query_multi_consumer ... ok
test src::query::query_nobins ... ok
test src::exp::expression_data_types ... ok
test src::exp::expression_compare ... ok
test src::query::query_node ... ok
test src::query::query_single_consumer ... ok
test src::exp_hll::expression_hll ... ok
test src::task::index_task_test ... ok
test src::truncate::truncate ... ok
test src::scan::scan_multi_consumer ... ok
test src::udf::execute_udf ... ok
test src::scan::scan_single_consumer ... ok
test src::scan::scan_node ... ok
test src::task::register_task_test ... ok
test src::exp_bitwise::expression_bitwise ... ok
test src::exp_list::expression_list ... ok
test src::exp_map::expression_map ... ok

failures:

---- src::exp::expression_rec_ops stdout ----
thread 'src::exp::expression_rec_ops' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `100`: DEVICE SIZE Test Failed', tests/src/exp.rs:244:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Running cargo clippy:

warning: this could be a `const fn`
   --> src/value.rs:221:5
    |
221 | /     pub fn is_nil(&self) -> bool {
222 | |         match *self {
223 | |             Value::Nil => true,
224 | |             _ => false,
225 | |         }
226 | |     }
    | |_____^
    |
note: the lint level is defined here
   --> src/lib.rs:25:40
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |                                        ^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::missing_const_for_fn)]` implied by `#[warn(clippy::nursery)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: match expression looks like `matches!` macro
   --> src/value.rs:222:9
    |
222 | /         match *self {
223 | |             Value::Nil => true,
224 | |             _ => false,
225 | |         }
    | |_________^ help: try this: `matches!(*self, Value::Nil)`
    |
note: the lint level is defined here
   --> src/lib.rs:25:9
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |         ^^^^^^^^^^^
    = note: `#[warn(clippy::match_like_matches_macro)]` implied by `#[warn(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: this could be a `const fn`
  --> src/bin.rs:70:5
   |
70 | /     pub fn is_all(&self) -> bool {
71 | |         match *self {
72 | |             Bins::All => true,
73 | |             _ => false,
74 | |         }
75 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: match expression looks like `matches!` macro
  --> src/bin.rs:71:9
   |
71 | /         match *self {
72 | |             Bins::All => true,
73 | |             _ => false,
74 | |         }
   | |_________^ help: try this: `matches!(*self, Bins::All)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: this could be a `const fn`
  --> src/bin.rs:78:5
   |
78 | /     pub fn is_none(&self) -> bool {
79 | |         match *self {
80 | |             Bins::None => true,
81 | |             _ => false,
82 | |         }
83 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: match expression looks like `matches!` macro
  --> src/bin.rs:79:9
   |
79 | /         match *self {
80 | |             Bins::None => true,
81 | |             _ => false,
82 | |         }
   | |_________^ help: try this: `matches!(*self, Bins::None)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: redundant closure found
   --> src/batch/batch_executor.rs:102:44
    |
102 |             map.entry(node).or_insert_with(|| vec![]).push(idx);
    |                                            ^^^^^^^^^ help: remove closure as shown: `$crate::vec::Vec::new`
    |
note: the lint level is defined here
   --> src/lib.rs:25:9
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |         ^^^^^^^^^^^
    = note: `#[warn(clippy::redundant_closure)]` implied by `#[warn(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

warning: this could be a `const fn`
   --> src/cluster/node.rs:139:5
    |
139 | /     fn services_name(&self) -> &'static str {
140 | |         if self.client_policy.use_services_alternate {
141 | |             "services-alternate"
142 | |         } else {
143 | |             "services"
144 | |         }
145 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: comparison to empty slice
   --> src/cluster/node.rs:196:36
    |
196 |             Some(friend_string) if friend_string == "" => return Ok(friends),
    |                                    ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `friend_string.is_empty()`
    |
note: the lint level is defined here
   --> src/lib.rs:25:9
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |         ^^^^^^^^^^^
    = note: `#[warn(clippy::comparison_to_empty)]` implied by `#[warn(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
   --> src/cluster/node.rs:290:9
    |
290 | /         Message::info(&mut conn, commands).or_else(|e| {
291 | |             conn.invalidate();
292 | |             Err(e)
293 | |         })
    | |__________^
    |
note: the lint level is defined here
   --> src/lib.rs:25:9
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |         ^^^^^^^^^^^
    = note: `#[warn(clippy::bind_instead_of_map)]` implied by `#[warn(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
help: try this
    |
290 |         Message::info(&mut conn, commands).map_err(|e| {
291 |             conn.invalidate();
292 |             e
    |

warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
   --> src/cluster/mod.rs:249:22
    |
249 |           let tokens = PartitionTokenizer::new(&mut conn).or_else(|e| {
    |  ______________________^
250 | |             conn.invalidate();
251 | |             Err(e)
252 | |         })?;
    | |__________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
help: try this
    |
249 |         let tokens = PartitionTokenizer::new(&mut conn).map_err(|e| {
250 |             conn.invalidate();
251 |             e
    |

warning: wildcard match will miss any future added variants
   --> src/cluster/mod.rs:324:17
    |
324 |                 _ => {
    |                 ^ help: try this: `std::prelude::v1::Err(..)`
    |
note: the lint level is defined here
   --> src/lib.rs:25:22
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |                      ^^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::match_wildcard_for_single_variants)]` implied by `#[warn(clippy::pedantic)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

warning: wildcard match will miss any future added variants
  --> src/commands/batch_read_command.rs:93:17
   |
93 |                 _ => continue, // Node is currently inactive. Retry.
   |                 ^ help: try this: `std::prelude::v1::Err(..)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

warning: match expression looks like `matches!` macro
   --> src/commands/buffer.rs:511:27
    |
511 |               let each_op = match operation.data {
    |  ___________________________^
512 | |                 OperationData::CdtMapOp(_) | OperationData::CdtBitOp(_) => true,
513 | |                 _ => false,
514 | |             };
    | |_____________^ help: try this: `matches!(operation.data, OperationData::CdtMapOp(_) | OperationData::CdtBitOp(_))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: comparison to empty slice
   --> src/commands/buffer.rs:606:12
    |
606 |         if namespace != "" {
    |            ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!namespace.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:611:12
    |
611 |         if set_name != "" {
    |            ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!set_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:653:12
    |
653 |         if namespace != "" {
    |            ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!namespace.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:657:12
    |
657 |         if set_name != "" {
    |            ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!set_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:712:12
    |
712 |         if statement.namespace != "" {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statement.namespace.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:717:12
    |
717 |         if statement.set_name != "" {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statement.set_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:723:16
    |
723 |             if index_name != "" {
    |                ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!index_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:810:12
    |
810 |         if statement.namespace != "" {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statement.namespace.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:820:12
    |
820 |         if statement.set_name != "" {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!statement.set_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:905:12
    |
905 |         if key.namespace != "" {
    |            ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.namespace.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
   --> src/commands/buffer.rs:910:12
    |
910 |         if key.set_name != "" {
    |            ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.set_name.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
    --> src/commands/buffer.rs:1073:12
     |
1073 |         if key.namespace != "" {
     |            ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.namespace.is_empty()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: comparison to empty slice
    --> src/commands/buffer.rs:1077:12
     |
1077 |         if key.set_name != "" {
     |            ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key.set_name.is_empty()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1196:9
     |
1196 | /         if let Some(pos) = pos {
1197 | |             Ok(self.data_buffer[pos])
1198 | |         } else {
1199 | |             let res = self.data_buffer[self.data_offset];
1200 | |             self.data_offset += 1;
1201 | |             Ok(res)
1202 | |         }
     | |_________^
     |
note: the lint level is defined here
    --> src/lib.rs:25:22
     |
25   | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
     |                      ^^^^^^^^^^^^^^^^
     = note: `#[warn(clippy::option_if_let_else)]` implied by `#[warn(clippy::pedantic)]`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1196 |         pos.map_or_else(|| {
1197 |             let res = self.data_buffer[self.data_offset];
1198 |             self.data_offset += 1;
1199 |             Ok(res)
1200 |         }, |pos| Ok(self.data_buffer[pos]))
     |

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1206:9
     |
1206 | /         if let Some(pos) = pos {
1207 | |             Ok(self.data_buffer[pos] as i8)
1208 | |         } else {
1209 | |             let res = self.data_buffer[self.data_offset] as i8;
1210 | |             self.data_offset += 1;
1211 | |             Ok(res)
1212 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1206 |         pos.map_or_else(|| {
1207 |             let res = self.data_buffer[self.data_offset] as i8;
1208 |             self.data_offset += 1;
1209 |             Ok(res)
1210 |         }, |pos| Ok(self.data_buffer[pos] as i8))
     |

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1217:9
     |
1217 | /         if let Some(pos) = pos {
1218 | |             Ok(NetworkEndian::read_u16(&self.data_buffer[pos..pos + len]))
1219 | |         } else {
1220 | |             let res = NetworkEndian::read_u16(
...    |
1224 | |             Ok(res)
1225 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1217 |         pos.map_or_else(|| {
1218 |             let res = NetworkEndian::read_u16(
1219 |                 &self.data_buffer[self.data_offset..self.data_offset + len],
1220 |             );
1221 |             self.data_offset += len;
1222 |             Ok(res)
   ...

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1235:9
     |
1235 | /         if let Some(pos) = pos {
1236 | |             Ok(NetworkEndian::read_u32(&self.data_buffer[pos..pos + len]))
1237 | |         } else {
1238 | |             let res = NetworkEndian::read_u32(
...    |
1242 | |             Ok(res)
1243 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1235 |         pos.map_or_else(|| {
1236 |             let res = NetworkEndian::read_u32(
1237 |                 &self.data_buffer[self.data_offset..self.data_offset + len],
1238 |             );
1239 |             self.data_offset += len;
1240 |             Ok(res)
   ...

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1253:9
     |
1253 | /         if let Some(pos) = pos {
1254 | |             Ok(NetworkEndian::read_u64(&self.data_buffer[pos..pos + len]))
1255 | |         } else {
1256 | |             let res = NetworkEndian::read_u64(
...    |
1260 | |             Ok(res)
1261 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1253 |         pos.map_or_else(|| {
1254 |             let res = NetworkEndian::read_u64(
1255 |                 &self.data_buffer[self.data_offset..self.data_offset + len],
1256 |             );
1257 |             self.data_offset += len;
1258 |             Ok(res)
   ...

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1277:9
     |
1277 | /         if let Some(pos) = pos {
1278 | |             Ok(NetworkEndian::read_f32(&self.data_buffer[pos..pos + len]))
1279 | |         } else {
1280 | |             let res = NetworkEndian::read_f32(
...    |
1284 | |             Ok(res)
1285 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1277 |         pos.map_or_else(|| {
1278 |             let res = NetworkEndian::read_f32(
1279 |                 &self.data_buffer[self.data_offset..self.data_offset + len],
1280 |             );
1281 |             self.data_offset += len;
1282 |             Ok(res)
   ...

warning: use Option::map_or_else instead of an if let/else
    --> src/commands/buffer.rs:1290:9
     |
1290 | /         if let Some(pos) = pos {
1291 | |             Ok(NetworkEndian::read_f64(&self.data_buffer[pos..pos + len]))
1292 | |         } else {
1293 | |             let res = NetworkEndian::read_f64(
...    |
1297 | |             Ok(res)
1298 | |         }
     | |_________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
     |
1290 |         pos.map_or_else(|| {
1291 |             let res = NetworkEndian::read_f64(
1292 |                 &self.data_buffer[self.data_offset..self.data_offset + len],
1293 |             );
1294 |             self.data_offset += len;
1295 |             Ok(res)
   ...

warning: `self.write_u8(0)?` is being shadowed
    --> src/commands/buffer.rs:1407:9
     |
1407 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
     |
note: the lint level is defined here
    --> src/lib.rs:25:22
     |
25   | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
     |                      ^^^^^^^^^^^^^^^^
     = note: `#[warn(clippy::shadow_unrelated)]` implied by `#[warn(clippy::pedantic)]`
note: initialization happens here
    --> src/commands/buffer.rs:1407:9
     |
1407 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
note: previous binding is here
    --> src/commands/buffer.rs:1406:33
     |
1406 |     pub fn write_geo(&mut self, val: &str) -> Result<usize> {
     |                                 ^^^
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `self.write_u8(0)?` is being shadowed
    --> src/commands/buffer.rs:1408:9
     |
1408 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
     |
note: initialization happens here
    --> src/commands/buffer.rs:1408:9
     |
1408 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
note: previous binding is here
    --> src/commands/buffer.rs:1407:9
     |
1407 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `self.write_u8(0)?` is being shadowed
    --> src/commands/buffer.rs:1409:9
     |
1409 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
     |
note: initialization happens here
    --> src/commands/buffer.rs:1409:9
     |
1409 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
note: previous binding is here
    --> src/commands/buffer.rs:1408:9
     |
1408 |         self.write_u8(0)?;
     |         ^^^^^^^^^^^^^^^^^
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: wildcard match will miss any future added variants
   --> src/commands/single_command.rs:103:17
    |
103 |                 _ => continue, // Node is currently inactive. Retry.
    |                 ^ help: try this: `std::prelude::v1::Err(..)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

warning: this could be a `const fn`
  --> src/commands/mod.rs:66:1
   |
66 | / pub fn keep_connection(err: &Error) -> bool {
67 | |     match *err {
68 | |         Error(ErrorKind::ServerError(result_code), _) => match result_code {
69 | |             ResultCode::KeyNotFoundError => true,
...  |
73 | |     }
74 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: match expression looks like `matches!` macro
  --> src/commands/mod.rs:68:58
   |
68 |           Error(ErrorKind::ServerError(result_code), _) => match result_code {
   |  __________________________________________________________^
69 | |             ResultCode::KeyNotFoundError => true,
70 | |             _ => false,
71 | |         },
   | |_________^ help: try this: `matches!(result_code, ResultCode::KeyNotFoundError)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: this could be a `const fn`
   --> src/expressions/lists.rs:690:1
    |
690 | / fn get_value_type(return_type: ListReturnType) -> ExpType {
691 | |     if (return_type as u8 & !(ListReturnType::Inverted as u8)) == ListReturnType::Values as u8 {
692 | |         ExpType::LIST
693 | |     } else {
694 | |         ExpType::INT
695 | |     }
696 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
   --> src/expressions/maps.rs:833:1
    |
833 | / fn get_value_type(return_type: MapReturnType) -> ExpType {
834 | |     let t = return_type as u8 & !(MapReturnType::Inverted as u8);
835 | |     if t == MapReturnType::Key as u8 || t == MapReturnType::Value as u8 {
836 | |         ExpType::LIST
...   |
841 | |     }
842 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: use Option::map_or instead of an if let/else
   --> src/expressions/mod.rs:129:9
    |
129 | /         if let Some(bin) = bin {
130 | |             FilterExpression {
131 | |                 cmd,
132 | |                 val,
...   |
148 | |             }
149 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
    |
129 |         bin.map_or(FilterExpression {
130 |                 cmd,
131 |                 val,
132 |                 bin: None,
133 |                 flags,
134 |                 module,
  ...

warning: parameter of type `HashMap` should be generalized over different hashers
   --> src/expressions/mod.rs:666:21
    |
666 | pub fn map_val(val: HashMap<Value, Value>) -> FilterExpression {
    |                     ^^^^^^^^^^^^^^^^^^^^^
    |
note: the lint level is defined here
   --> src/lib.rs:25:22
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |                      ^^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::implicit_hasher)]` implied by `#[warn(clippy::pedantic)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher
help: consider adding a type parameter
    |
666 | pub fn map_val<S: ::std::hash::BuildHasher>(val: HashMap<Value, Value, S>) -> FilterExpression {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      ^^^^^^^^^^^^^^^^^^^^^^^^

warning: this could be a `const fn`
   --> src/expressions/mod.rs:703:1
    |
703 | / pub fn and(exps: Vec<FilterExpression>) -> FilterExpression {
704 | |     FilterExpression {
705 | |         cmd: Some(ExpOp::And),
706 | |         val: None,
...   |
712 | |     }
713 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
   --> src/expressions/mod.rs:721:1
    |
721 | / pub fn or(exps: Vec<FilterExpression>) -> FilterExpression {
722 | |     FilterExpression {
723 | |         cmd: Some(ExpOp::Or),
724 | |         val: None,
...   |
730 | |     }
731 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
   --> src/msgpack/decoder.rs:222:1
    |
222 | / fn is_ext(byte: u8) -> bool {
223 | |     match byte {
224 | |         0xc7 | 0xc8 | 0xc9 | 0xd4 | 0xd5 | 0xd6 | 0xd7 | 0xd8 => true,
225 | |         _ => false,
226 | |     }
227 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: match expression looks like `matches!` macro
   --> src/msgpack/decoder.rs:223:5
    |
223 | /     match byte {
224 | |         0xc7 | 0xc8 | 0xc9 | 0xd4 | 0xd5 | 0xd6 | 0xd7 | 0xd8 => true,
225 | |         _ => false,
226 | |     }
    | |_____^ help: try this: `matches!(byte, 0xc7 | 0xc8 | 0xc9 | 0xd4 | 0xd5 | 0xd6 | 0xd7 | 0xd8)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

warning: `buf.write_u8(marker)?` is being shadowed
   --> src/msgpack/encoder.rs:227:9
    |
227 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:227:9
    |
227 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:225:61
    |
225 | pub fn pack_byte(buf: &mut Option<&mut Buffer>, marker: u8, val: u8) -> Result<usize> {
    |                                                             ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(MSGPACK_MARKER_BOOL_TRUE)?` is being shadowed
   --> src/msgpack/encoder.rs:245:13
    |
245 |             buf.write_u8(MSGPACK_MARKER_BOOL_TRUE)?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:245:13
    |
245 |             buf.write_u8(MSGPACK_MARKER_BOOL_TRUE)?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:242:49
    |
242 | pub fn pack_bool(buf: &mut Option<&mut Buffer>, val: bool) -> Result<usize> {
    |                                                 ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(MSGPACK_MARKER_BOOL_FALSE)?` is being shadowed
   --> src/msgpack/encoder.rs:247:13
    |
247 |             buf.write_u8(MSGPACK_MARKER_BOOL_FALSE)?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:247:13
    |
247 |             buf.write_u8(MSGPACK_MARKER_BOOL_FALSE)?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:245:13
    |
245 |             buf.write_u8(MSGPACK_MARKER_BOOL_TRUE)?;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: manual `Range::contains` implementation
   --> src/msgpack/encoder.rs:257:16
    |
257 |         val if val >= 16 && val < 2 ^ 16 => pack_i16(buf, 0xde, length as i16),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(16..2 ^ 16).contains(&val)`
    |
note: the lint level is defined here
   --> src/lib.rs:25:9
    |
25  | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
    |         ^^^^^^^^^^^
    = note: `#[warn(clippy::manual_range_contains)]` implied by `#[warn(clippy::all)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

warning: manual `Range::contains` implementation
   --> src/msgpack/encoder.rs:266:16
    |
266 |         val if val >= 16 && val < 2 ^ 16 => pack_i16(buf, 0xdc, length as i16),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(16..2 ^ 16).contains(&val)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

warning: `buf.write_u8(ParticleType::BLOB as u8)?` is being shadowed
   --> src/msgpack/encoder.rs:286:9
    |
286 |         buf.write_u8(ParticleType::BLOB as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:286:9
    |
286 |         buf.write_u8(ParticleType::BLOB as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:281:49
    |
281 | pub fn pack_blob(buf: &mut Option<&mut Buffer>, val: &[u8]) -> Result<usize> {
    |                                                 ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(ParticleType::STRING as u8)?` is being shadowed
   --> src/msgpack/encoder.rs:299:9
    |
299 |         buf.write_u8(ParticleType::STRING as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:299:9
    |
299 |         buf.write_u8(ParticleType::STRING as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:294:51
    |
294 | pub fn pack_string(buf: &mut Option<&mut Buffer>, val: &str) -> Result<usize> {
    |                                                   ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(ParticleType::GEOJSON as u8)?` is being shadowed
   --> src/msgpack/encoder.rs:324:9
    |
324 |         buf.write_u8(ParticleType::GEOJSON as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:324:9
    |
324 |         buf.write_u8(ParticleType::GEOJSON as u8)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:319:49
    |
319 | fn pack_geo_json(buf: &mut Option<&mut Buffer>, val: &str) -> Result<usize> {
    |                                                 ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: manual `Range::contains` implementation
   --> src/msgpack/encoder.rs:334:16
    |
334 |         val if val >= 0 && val < 2 ^ 7 => pack_half_byte(buf, val as u8),
    |                ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..2 ^ 7).contains(&val)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

warning: `buf.write_u8(marker)?` is being shadowed
   --> src/msgpack/encoder.rs:367:9
    |
367 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:367:9
    |
367 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:365:60
    |
365 | pub fn pack_i16(buf: &mut Option<&mut Buffer>, marker: u8, val: i16) -> Result<usize> {
    |                                                            ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(marker)?` is being shadowed
   --> src/msgpack/encoder.rs:376:9
    |
376 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:376:9
    |
376 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:374:60
    |
374 | pub fn pack_i32(buf: &mut Option<&mut Buffer>, marker: u8, val: i32) -> Result<usize> {
    |                                                            ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(marker)?` is being shadowed
   --> src/msgpack/encoder.rs:385:9
    |
385 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:385:9
    |
385 |         buf.write_u8(marker)?;
    |         ^^^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:383:60
    |
383 | pub fn pack_i64(buf: &mut Option<&mut Buffer>, marker: u8, val: i64) -> Result<usize> {
    |                                                            ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(0xcf)?` is being shadowed
   --> src/msgpack/encoder.rs:398:9
    |
398 |         buf.write_u8(0xcf)?;
    |         ^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:398:9
    |
398 |         buf.write_u8(0xcf)?;
    |         ^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:392:48
    |
392 | pub fn pack_u64(buf: &mut Option<&mut Buffer>, val: u64) -> Result<usize> {
    |                                                ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(0xca)?` is being shadowed
   --> src/msgpack/encoder.rs:407:9
    |
407 |         buf.write_u8(0xca)?;
    |         ^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:407:9
    |
407 |         buf.write_u8(0xca)?;
    |         ^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:405:48
    |
405 | pub fn pack_f32(buf: &mut Option<&mut Buffer>, val: f32) -> Result<usize> {
    |                                                ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: `buf.write_u8(0xcb)?` is being shadowed
   --> src/msgpack/encoder.rs:416:9
    |
416 |         buf.write_u8(0xcb)?;
    |         ^^^^^^^^^^^^^^^^^^^
    |
note: initialization happens here
   --> src/msgpack/encoder.rs:416:9
    |
416 |         buf.write_u8(0xcb)?;
    |         ^^^^^^^^^^^^^^^^^^^
note: previous binding is here
   --> src/msgpack/encoder.rs:414:48
    |
414 | pub fn pack_f64(buf: &mut Option<&mut Buffer>, val: f64) -> Result<usize> {
    |                                                ^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated

warning: use Option::map_or instead of an if let/else
   --> src/net/connection.rs:100:9
    |
100 | /         if let Some(idle_dl) = self.idle_deadline {
101 | |             Instant::now() >= idle_dl
102 | |         } else {
103 | |             false
104 | |         }
    | |_________^ help: try: `self.idle_deadline.map_or(false, |idle_dl| Instant::now() >= idle_dl)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else

warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
  --> src/net/connection_pool.rs:86:9
   |
86 | /         connection.set_timeout(timeout).or_else(|err| {
87 | |             internals.num_conns -= 1;
88 | |             Err(err)
89 | |         })?;
   | |__________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
help: try this
   |
86 |         connection.set_timeout(timeout).map_err(|err| {
87 |             internals.num_conns -= 1;
88 |             err
   |

warning: this could be a `const fn`
   --> src/operations/lists.rs:177:1
    |
177 | / pub fn list_order_flag(order: ListOrderType, pad: bool) -> u8 {
178 | |     if let ListOrderType::Ordered = order {
179 | |         return 0xc0;
180 | |     }
...   |
184 | |     0x40
185 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
   --> src/operations/maps.rs:195:1
    |
195 | / pub(crate) fn map_write_op(policy: &MapPolicy, multi: bool) -> CdtMapOpType {
196 | |     match policy.write_mode {
197 | |         MapWriteMode::Update => {
198 | |             if multi {
...   |
218 | |     }
219 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
   --> src/operations/maps.rs:221:1
    |
221 | / fn map_order_arg(policy: &MapPolicy) -> Option<CdtArgument> {
222 | |     match policy.write_mode {
223 | |         MapWriteMode::UpdateOnly => None,
224 | |         _ => Some(CdtArgument::Byte(policy.order as u8)),
225 | |     }
226 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
  --> src/operations/scalar.rs:43:1
   |
43 | / pub fn get_bin(bin_name: &str) -> Operation {
44 | |     Operation {
45 | |         op: OperationType::Read,
46 | |         ctx: DEFAULT_CTX,
...  |
49 | |     }
50 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
  --> src/operations/scalar.rs:53:1
   |
53 | / pub fn put<'a>(bin: &'a Bin) -> Operation<'a> {
54 | |     Operation {
55 | |         op: OperationType::Write,
56 | |         ctx: DEFAULT_CTX,
...  |
59 | |     }
60 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
  --> src/operations/scalar.rs:63:1
   |
63 | / pub fn append<'a>(bin: &'a Bin) -> Operation<'a> {
64 | |     Operation {
65 | |         op: OperationType::Append,
66 | |         ctx: DEFAULT_CTX,
...  |
69 | |     }
70 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
  --> src/operations/scalar.rs:73:1
   |
73 | / pub fn prepend<'a>(bin: &'a Bin) -> Operation<'a> {
74 | |     Operation {
75 | |         op: OperationType::Prepend,
76 | |         ctx: DEFAULT_CTX,
...  |
79 | |     }
80 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: this could be a `const fn`
  --> src/operations/scalar.rs:83:1
   |
83 | / pub fn add<'a>(bin: &'a Bin) -> Operation<'a> {
84 | |     Operation {
85 | |         op: OperationType::Incr,
86 | |         ctx: DEFAULT_CTX,
...  |
89 | |     }
90 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: field assignment outside of initializer for an instance created with Default::default()
  --> src/policy/write_policy.rs:75:9
   |
75 |         wp.generation = gen;
   |         ^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:25:9
   |
25 | #![warn(clippy::all, clippy::pedantic, clippy::nursery)]
   |         ^^^^^^^^^^^
   = note: `#[warn(clippy::field_reassign_with_default)]` implied by `#[warn(clippy::all)]`
note: consider initializing the variable with `policy::write_policy::WritePolicy { generation: gen, expiration: exp, ..Default::default() }` and removing relevant reassignments
  --> src/policy/write_policy.rs:74:9
   |
74 |         let mut wp = WritePolicy::default();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

warning: wildcard match will miss any future added variants
  --> src/record.rs:77:21
   |
77 |                     _ => Some(Duration::new(1u64, 0)),
   |                     ^ help: try this: `std::prelude::v1::Err(..)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

warning: this could be a `const fn`
   --> src/result_code.rs:216:5
    |
216 | /     pub fn from_u8(n: u8) -> ResultCode {
217 | |         match n {
218 | |             0 => ResultCode::Ok,
219 | |             1 => ResultCode::ServerError,
...   |
281 | |         }
282 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

warning: 76 warnings emitted
@kportertx
Copy link

right: 100: DEVICE SIZE Test Failed', tests/src/exp.rs:244:5

This particular test relies on there being storage backing for the namespace. I suspect the namespace you tested against was configured storage-engine memory instead of storage-engine device.

If so, the test should have checked the namespace's configuration and expected 0 instead.

jonas32 added a commit to is-it-fresh/aerospike-client-rust that referenced this issue Jan 25, 2021
jhecking pushed a commit that referenced this issue Jan 26, 2021
* Fixed device Size test for not in-memory namespaces (#91)

* Fixed HLL returns in tests

* Lowered ms on since_update to prevent failing
@jhecking
Copy link
Contributor

@brianbruggeman I believe the failing tests have been addressed in #93. I'm still waiting for the latest CI results, but I'm going to close this for now. The tests already pass on my local dev env. Please reopen the issue, if any tests are still failing for you.

@jonas32 also mentioned that he would be addressing the Clippy warnings in another PR.

@brianbruggeman
Copy link
Author

@jhecking @kportertx Where is a good space to discuss things?

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 27, 2021

I pulled the latest....

I'm still probably doing something wrong:

$ git log

commit cb1d022097947fd563ad6a1ae9cd4944275ebf60 (HEAD -> master, origin/master, origin/HEAD)
Author: Jonas Breuer <[email protected]>
Date:   Tue Jan 26 10:24:13 2021 +0100

    Fix for Expression Test (#93)

    * Fixed device Size test for not in-memory namespaces (#91)

    * Fixed HLL returns in tests

    * Lowered ms on since_update to prevent failing

$ docker run -v ${HOME}/.aerospike/data:/opt/aerospike/data -e "NAMESPACE=test" --rm -d -p 3000:3000 --name aerospike aerospike/aerospike-server
7dce897634c9ccbc06d9d46e24cadde54bc8f3fcae58ddf1ef33771422774a16
$ RUST_BACKTRACE=1 cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.11s
     Running target/debug/deps/aerospike-db0ed0baafe3e15b

running 20 tests
test bin::tests::into_bins ... ok
test net::host::tests::to_hosts ... ok
test net::parser::tests::read_addr_part ... ok
test net::parser::tests::read_addr_tuple ... ok
test query::filter::tests::geo_filter_macros ... ok
test net::parser::tests::read_hosts ... ok
test record::tests::ttl_expiration_future ... ok
test record::tests::ttl_expiration_past ... ok
test record::tests::ttl_never_expires ... ok
test result_code::tests::from_result_code ... ok
test key::tests::int_keys ... ok
test result_code::tests::from_unknown_result_code ... ok
test result_code::tests::into_string ... ok
test result_code::tests::unknown_into_string ... ok
test value::tests::as_geo ... ok
test value::tests::as_string ... ok
test key::tests::string_keys ... ok
test key::tests::blob_keys ... ok
test key::tests::unsupported_float_key ... ok
test key::tests::unsupported_u64_key ... ok

test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/client-0cb4beb2f607c922

running 5 tests
test nodes ... ok
test get_node ... ok
test node_names ... ok
test close ... ok
test cluster_name ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/lib-33687cbfd16d35e7

running 27 tests
test src::batch::batch_get ... ok
test src::cdt_bitwise::cdt_bitwise ... ok
test src::cdt_list::cdt_list ... ok
test src::cdt_map::map_operations ... ok
test src::exp::expression_commands ... ok
test src::exp_hll::expression_hll ... FAILED
test src::hll::hll ... ok
test src::exp::expression_condition ... ok
test src::kv::connect ... ok
test src::index::recreate_index ... ok
test src::query::query_multi_consumer ... ok
test src::exp::expression_rec_ops ... FAILED
test src::exp::expression_data_types ... ok
test src::query::query_nobins ... ok
test src::exp::expression_compare ... ok
test src::query::query_node ... ok
test src::query::query_single_consumer ... ok
test src::task::index_task_test ... ok
test src::truncate::truncate ... ok
test src::scan::scan_multi_consumer ... ok
test src::scan::scan_node ... ok
test src::udf::execute_udf ... ok
test src::scan::scan_single_consumer ... ok
test src::task::register_task_test ... ok
test src::exp_bitwise::expression_bitwise ... ok
test src::exp_list::expression_list ... ok
test src::exp_map::expression_map ... ok

failures:

---- src::exp_hll::expression_hll stdout ----
thread 'src::exp_hll::expression_hll' panicked at 'assertion failed: `(left == right)`
  left: `98`,
 right: `99`: HLL INIT Test Failed', tests/src/exp_hll.rs:86:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
   1: std::panicking::begin_panic_fmt
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:437:5
   2: lib::src::exp_hll::expression_hll
             at ./tests/src/exp_hll.rs:86:5
   3: lib::src::exp_hll::expression_hll::{{closure}}
             at ./tests/src/exp_hll.rs:67:1
   4: core::ops::function::FnOnce::call_once
             at /Users/brianbruggeman/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- src::exp::expression_rec_ops stdout ----
thread 'src::exp::expression_rec_ops' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `100`: VOID TIME Test Failed', tests/src/exp.rs:275:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
   1: std::panicking::begin_panic_fmt
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:437:5
   2: lib::src::exp::expression_rec_ops
             at ./tests/src/exp.rs:275:5
   3: lib::src::exp::expression_rec_ops::{{closure}}
             at ./tests/src/exp.rs:233:1
   4: core::ops::function::FnOnce::call_once
             at /Users/brianbruggeman/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    src::exp::expression_rec_ops
    src::exp_hll::expression_hll

test result: FAILED. 25 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

@jonas32
Copy link
Contributor

jonas32 commented Jan 27, 2021

@brianbruggeman what version is the Aerospike Server you used?
The msgpack bug you reported affects the hll module. That means it requires Server Version 5.4 to run the tests right now.
Please provide the namespace config for the one you are using and the exact Server Version.

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 27, 2021

@jonas32 I included the docker command I'm using above so there wasn't any confusion.

That said, it only pulled "latest" rather than an explicit version. And since it's hard to know what version aerospike is, I've removed that image and repulled as: aerospike-server:5.4.0.2 (which should be latest from dockerhub). Notably, latest appears to be newer than 5.4.0.2

The configuration template used can be found here in the github repo for aerospike's docker.. Note that these two links are specific to 5.4.0.2.

I ran the test on 5.4.0.2 (see below). I am not entirely sure what the configuration looks like in the docker container, but I'm assuming that whatever it is, there's nothing special that I need to do to run the tests.

RUST_BACKTRACE=1 cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.05s
     Running target/debug/deps/aerospike-db0ed0baafe3e15b

running 20 tests
test bin::tests::into_bins ... ok
test net::host::tests::to_hosts ... ok
test net::parser::tests::read_addr_part ... ok
test net::parser::tests::read_addr_tuple ... ok
test net::parser::tests::read_hosts ... ok
test key::tests::int_keys ... ok
test query::filter::tests::geo_filter_macros ... ok
test record::tests::ttl_expiration_future ... ok
test record::tests::ttl_expiration_past ... ok
test record::tests::ttl_never_expires ... ok
test result_code::tests::from_result_code ... ok
test result_code::tests::from_unknown_result_code ... ok
test result_code::tests::into_string ... ok
test result_code::tests::unknown_into_string ... ok
test value::tests::as_geo ... ok
test value::tests::as_string ... ok
test key::tests::blob_keys ... ok
test key::tests::string_keys ... ok
test key::tests::unsupported_float_key ... ok
test key::tests::unsupported_u64_key ... ok

test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/client-0cb4beb2f607c922

running 5 tests
test node_names ... ok
test nodes ... ok
test get_node ... ok
test close ... ok
test cluster_name ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/lib-33687cbfd16d35e7

running 27 tests
test src::batch::batch_get ... ok
test src::cdt_bitwise::cdt_bitwise ... ok
test src::cdt_list::cdt_list ... ok
test src::cdt_map::map_operations ... ok
test src::exp::expression_commands ... ok
test src::exp::expression_condition ... ok
test src::hll::hll ... ok
test src::exp::expression_data_types ... ok
test src::kv::connect ... ok
test src::exp::expression_compare ... ok
test src::exp::expression_rec_ops ... FAILED
test src::exp_hll::expression_hll ... ok
test src::index::recreate_index ... ok
test src::query::query_multi_consumer ... ok
test src::query::query_nobins ... ok
test src::query::query_node ... ok
test src::exp_bitwise::expression_bitwise ... ok
test src::task::index_task_test ... ok
test src::truncate::truncate ... ok
test src::query::query_single_consumer ... ok
test src::scan::scan_multi_consumer ... ok
test src::udf::execute_udf ... ok
test src::scan::scan_node ... ok
test src::scan::scan_single_consumer ... ok
test src::exp_list::expression_list ... ok
test src::exp_map::expression_map ... ok
test src::task::register_task_test ... ok

failures:

---- src::exp::expression_rec_ops stdout ----
thread 'src::exp::expression_rec_ops' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `100`: VOID TIME Test Failed', tests/src/exp.rs:275:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
   1: std::panicking::begin_panic_fmt
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:437:5
   2: lib::src::exp::expression_rec_ops
             at ./tests/src/exp.rs:275:5
   3: lib::src::exp::expression_rec_ops::{{closure}}
             at ./tests/src/exp.rs:233:1
   4: core::ops::function::FnOnce::call_once
             at /Users/brianbruggeman/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
   5: core::ops::function::FnOnce::call_once
             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    src::exp::expression_rec_ops

test result: FAILED. 26 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

And just for clarification:

$ docker run -v ${HOME}/.aerospike/data:/opt/aerospike/data -e "NAMESPACE=test" --rm -d -p 3000:3000 --name aerospike aerospike/aerospike-server:5.4.0.2
7f07b600ae2e6e302864fc0ff333ec0bef297a1a38615ccdcba68b5ae43bc47b

$ docker ps | grep -i aerospike
7f07b600ae2e   aerospike/aerospike-server:5.4.0.2   "/usr/bin/dumb-init …"   3 minutes ago   Up 3 minutes   0.0.0.0:3000->3000/tcp, 3001-3003/tcp   aerospike

$ docker image ls | grep aerospike-server
aerospike/aerospike-server                                                 5.4.0.2                                  3a3035b8d911   4 days ago     195MB

@jonas32
Copy link
Contributor

jonas32 commented Jan 27, 2021

I guess your namespace has expiration enabled. The test assumes its turned off.
https://github.com/aerospike/aerospike-client-rust/blob/master/.travis/aerospike.conf#L53

If your namespace does expiration, the test will fail because we are checking for 0 as expiration time.
The command you used looks like you use the default config. I think expiration of 30 days is default.
Expression tests are not very flexible, because we need to predict what a correct result will look like.
Thats nearly impossible with dynamic expiration.

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 27, 2021

Okay. Thank you for the explanation there.

It looks like I can modify my docker run invocation setting the TTL to 0 using an environment variable (DEFAULT_TTL):

$ docker run -v ${HOME}/.aerospike/data:/opt/aerospike/data \
    -e "NAMESPACE=test" \
    -e "DEFAULT_TTL=0" \
    --rm \
    -d \
    -p 3000:3000 \
    --name aerospike aerospike/aerospike-server:5.4.0.2

And of course now the standard tests pass as you have expected:

cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.05s
     Running target/debug/deps/aerospike-db0ed0baafe3e15b

running 20 tests
test bin::tests::into_bins ... ok
test key::tests::unsupported_u64_key ... ok
test net::host::tests::to_hosts ... ok
test key::tests::unsupported_float_key ... ok
test net::parser::tests::read_addr_part ... ok
test net::parser::tests::read_addr_tuple ... ok
test record::tests::ttl_expiration_future ... ok
test query::filter::tests::geo_filter_macros ... ok
test net::parser::tests::read_hosts ... ok
test record::tests::ttl_expiration_past ... ok
test record::tests::ttl_never_expires ... ok
test result_code::tests::from_result_code ... ok
test result_code::tests::from_unknown_result_code ... ok
test result_code::tests::into_string ... ok
test result_code::tests::unknown_into_string ... ok
test value::tests::as_geo ... ok
test value::tests::as_string ... ok
test key::tests::int_keys ... ok
test key::tests::blob_keys ... ok
test key::tests::string_keys ... ok

test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/client-0cb4beb2f607c922

running 5 tests
test cluster_name ... ok
test nodes ... ok
test get_node ... ok
test node_names ... ok
test close ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/lib-33687cbfd16d35e7

running 27 tests
test src::batch::batch_get ... ok
test src::cdt_bitwise::cdt_bitwise ... ok
test src::cdt_list::cdt_list ... ok
test src::cdt_map::map_operations ... ok
test src::exp::expression_commands ... ok
test src::exp::expression_condition ... ok
test src::hll::hll ... ok
test src::exp::expression_data_types ... ok
test src::kv::connect ... ok
test src::index::recreate_index ... ok
test src::exp::expression_compare ... ok
test src::exp_hll::expression_hll ... ok
test src::query::query_multi_consumer ... ok
test src::query::query_nobins ... ok
test src::query::query_node ... ok
test src::query::query_single_consumer ... ok
test src::scan::scan_multi_consumer ... ok
test src::task::index_task_test ... ok
test src::truncate::truncate ... ok
test src::exp::expression_rec_ops ... ok
test src::scan::scan_node ... ok
test src::scan::scan_single_consumer ... ok
test src::udf::execute_udf ... ok
test src::exp_bitwise::expression_bitwise ... ok
test src::task::register_task_test ... ok
test src::exp_list::expression_list ... ok
test src::exp_map::expression_map ... ok

test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

However, cargo test has now started to run on the doc-tests and they appear to also be failing. I assume that those are expected to pass as well?

I'll take a look at the travis CI configuration file here and see if I can duplicate everything within the docker image.

That said, from an outsider looking in, it appears that this crate has a very special non-standard configuration (a snowflake) that is required for testing. And that makes me feel uneasy when considering if I can rely on this crate in production.

@jonas32
Copy link
Contributor

jonas32 commented Jan 28, 2021

I fully understand that.
As far as i know the Rust client is still not an official Supported client but community driven.
Besides the TTL settings, everything should be default as far as i know.
Im not sure about the defaults of the docker container.
This special configuration for the Server is only required to run the clients module tests. You can use it on any configuration you want.

Can you please share more about the failing doc tests?
Please try to run it with AEROSPIKE_HOSTS=127.0.0.1:3000 cargo test -- --nocapture and replace the IP if needed.
I would like to see the output of that if anything else fails.

@jhecking
Copy link
Contributor

If your namespace does expiration, the test will fail because we are checking for 0 as expiration time.
The command you used looks like you use the default config. I think expiration of 30 days is default.
Expression tests are not very flexible, because we need to predict what a correct result will look like.
Thats nearly impossible with dynamic expiration.

One option would be to create the test records with a specific TTL, instead of relying on the default value. But even that might be problematic, because as of server version 4.9 record expirations are disabled on the server by default. That's also why the test config includes allow-ttl-without-nsup true. Without that setting, trying to set a record TTL will fail if expirations are disabled server-side.

Testing the ttl and void_time expressions without making any assumptions about the server setup is going to be tricky. Maybe there is some info command we can use to find out how the server is set up and then adjust the tests accordingly. I'll look into that. Maybe @kportertx has some ideas as well?

@jhecking
Copy link
Contributor

jhecking commented Jan 29, 2021

Testing the ttl and void_time expressions without making any assumptions about the server setup is going to be tricky. Maybe there is some info command we can use to find out how the server is set up and then adjust the tests accordingly. I'll look into that.

This is how I solved the problem in for the Aerospike Node.js client test suite: Before any of the tests run, the test suite fetches the server config for the test namespace. For the tests that use the ttl or void_time expressions, the test suite first checks if the nsup-period has a non-zero value or allow-ttl-without-nsup true is set. If not, the tests are skipped. The actual tests then create records with a specific ttl value, rather than relying on the namespace default, and check against that value.

This is all still a work-in-progress, but you can see the relevant changes here: aerospike/aerospike-client-nodejs@2cd6f86

@brianbruggeman
Copy link
Author

@jhecking does your CI then run tests on both modes?

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 29, 2021

@jonas32

Note: I'm using rustc 1.49.0 (e1884a8e3 2020-12-29) for the tests below.

Using your branch for PR #94, I ran with the docker command I had above. I did have an initial failure which was resolved when I reran:

test src::query::query_multi_consumer ... FAILED

failures:

---- src::query::query_multi_consumer stdout ----
thread '<unnamed>' panicked at 'Error(ServerError(IndexNotReadable), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', tests/src/query.rs:157:33
thread 'src::query::query_multi_consumer' panicked at 'Failed to join threads: Any', tests/src/query.rs:164:18


failures:
    src::query::query_multi_consumer

test result: FAILED. 26 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

Doc-tests:

   Doc-tests aerospike

running 80 tests
test src/client.rs - client::Client::new (line 91) ... FAILED
test src/client.rs - client::Client::create_index (line 808) ... FAILED
test src/client.rs - client::Client::delete (line 367) ... FAILED
test src/client.rs - client::Client::get (line 147) ... FAILED
test src/client.rs - client::Client::get (line 165) ... FAILED
test src/client.rs - client::Client::add (line 297) ... FAILED
test src/client.rs - client::Client::operate (line 428) ... FAILED
test src/client.rs - client::Client::batch_get (line 204) ... FAILED
test src/expressions/bitwise.rs - expressions::bitwise::count (line 463) ... ok
test src/client.rs - client::Client::touch (line 392) ... FAILED
test src/client.rs - client::Client::query (line 703) ... FAILED
test src/client.rs - client::Client::register_udf (line 459) ... FAILED
test src/client.rs - client::Client::put (line 244) ... FAILED
test src/client.rs - client::Client::put (line 259) ... FAILED
test src/errors.rs - errors (line 22) ... FAILED
test src/client.rs - client::Client::scan (line 615) ... FAILED
test src/expressions/bitwise.rs - expressions::bitwise::get (line 434) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::get_int (line 552) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::resize (line 49) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::lscan (line 490) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::rscan (line 521) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::remove (line 113) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::insert (line 81) ... ok
test src/expressions/bitwise.rs - expressions::bitwise::set (line 144) ... ok
test src/expressions/hll.rs - expressions::hll::add (line 38) ... ok
test src/expressions/hll.rs - expressions::hll::add_with_index (line 54) ... ok
test src/expressions/hll.rs - expressions::hll::describe (line 220) ... ok
test src/expressions/hll.rs - expressions::hll::add_with_index_and_min_hash (line 75) ... ok
test src/expressions/hll.rs - expressions::hll::get_intersect_count (line 175) ... ok
test src/expressions/hll.rs - expressions::hll::get_count (line 106) ... ok
test src/expressions/hll.rs - expressions::hll::get_similarity (line 199) ... ok
test src/expressions/hll.rs - expressions::hll::get_union (line 125) ... ok
test src/expressions/hll.rs - expressions::hll::get_union_count (line 150) ... ok
test src/expressions/lists.rs - expressions::lists::get_by_index (line 522) ... ok
test src/expressions/lists.rs - expressions::lists::get_by_rank (line 587) ... ok
test src/expressions/lists.rs - expressions::lists::get_by_value (line 381) ... ok
test src/expressions/hll.rs - expressions::hll::may_contain (line 241) ... ok
test src/expressions/lists.rs - expressions::lists::get_by_value_range (line 409) ... ok
test src/expressions/lists.rs - expressions::lists::size (line 364) ... ok
test src/expressions/maps.rs - expressions::maps::get_by_key (line 435) ... ok
test src/expressions/mod.rs - expressions::bin_exists (line 460) ... ok
test src/expressions/maps.rs - expressions::maps::get_by_value (line 564) ... ok
test src/expressions/mod.rs - expressions::and (line 688) ... ok
test src/expressions/maps.rs - expressions::maps::size (line 416) ... ok
test src/expressions/mod.rs - expressions::bin_type (line 470) ... ok
test src/expressions/mod.rs - expressions::blob_bin (line 342) ... ok
test src/expressions/mod.rs - expressions::device_size (line 499) ... ok
test src/expressions/mod.rs - expressions::digest_modulo (line 564) ... ok
test src/expressions/mod.rs - expressions::float_bin (line 360) ... ok
test src/expressions/mod.rs - expressions::eq (line 724) ... ok
test src/expressions/mod.rs - expressions::ge (line 778) ... ok
test src/expressions/mod.rs - expressions::geo_bin (line 377) ... ok
test src/expressions/mod.rs - expressions::geo_compare (line 600) ... ok
test src/expressions/mod.rs - expressions::gt (line 760) ... ok
test src/expressions/mod.rs - expressions::hll_bin (line 438) ... ok
test src/expressions/mod.rs - expressions::int_bin (line 308) ... ok
test src/expressions/mod.rs - expressions::last_update (line 510) ... ok
test src/expressions/mod.rs - expressions::key (line 280) ... ok
test src/expressions/mod.rs - expressions::key_exists (line 298) ... ok
test src/expressions/mod.rs - expressions::is_tombstone (line 555) ... ok
test src/expressions/mod.rs - expressions::le (line 814) ... ok
test src/expressions/mod.rs - expressions::list_bin (line 395) ... ok
test src/expressions/mod.rs - expressions::lt (line 796) ... ok
test src/expressions/mod.rs - expressions::map_bin (line 415) ... ok
test src/expressions/mod.rs - expressions::ne (line 742) ... ok
test src/expressions/mod.rs - expressions::regex_compare (line 581) ... ok
test src/expressions/mod.rs - expressions::not (line 670) ... ok
test src/expressions/mod.rs - expressions::or (line 706) ... ok
test src/expressions/mod.rs - expressions::set_name (line 488) ... ok
test src/expressions/mod.rs - expressions::since_update (line 522) ... ok
test src/expressions/mod.rs - expressions::string_bin (line 325) ... ok
test src/expressions/mod.rs - expressions::ttl (line 543) ... ok
test src/expressions/mod.rs - expressions::void_time (line 533) ... ok
test src/query/statement.rs - query::statement::Statement::add_filter (line 83) ... ok
test src/operations/bitwise.rs - operations::bitwise (line 22) ... ok
test src/query/statement.rs - query::statement::Statement::new (line 59) ... ok
test src/lib.rs - (line 65) ... ok
test src/value.rs - as_list (line 628) ... FAILED
test src/value.rs - as_values (line 659) ... ok
test src/value.rs - as_map (line 692) ... FAILED

failures:

---- src/client.rs - client::Client::new (line 91) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::create_index (line 808) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::delete (line 367) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::get (line 147) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::get (line 165) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::add (line 297) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::operate (line 428) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::batch_get (line 204) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::touch (line 392) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::query (line 703) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::register_udf (line 459) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::put (line 244) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::put (line 259) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/errors.rs - errors (line 22) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/errors.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/client.rs - client::Client::scan (line 615) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/client.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/value.rs - as_list (line 628) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/value.rs:11:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


---- src/value.rs - as_map (line 692) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', src/value.rs:10:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace



failures:
    src/client.rs - client::Client::add (line 297)
    src/client.rs - client::Client::batch_get (line 204)
    src/client.rs - client::Client::create_index (line 808)
    src/client.rs - client::Client::delete (line 367)
    src/client.rs - client::Client::get (line 147)
    src/client.rs - client::Client::get (line 165)
    src/client.rs - client::Client::new (line 91)
    src/client.rs - client::Client::operate (line 428)
    src/client.rs - client::Client::put (line 244)
    src/client.rs - client::Client::put (line 259)
    src/client.rs - client::Client::query (line 703)
    src/client.rs - client::Client::register_udf (line 459)
    src/client.rs - client::Client::scan (line 615)
    src/client.rs - client::Client::touch (line 392)
    src/errors.rs - errors (line 22)
    src/value.rs - as_list (line 628)
    src/value.rs - as_map (line 692)

test result: FAILED. 63 passed; 17 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--doc'

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 29, 2021

It looks like many of these are probably because of a missing environment variable.

Is there any opposition to adding dotenv to dev-dependencies and then using dotenv::dotenv().ok(); as well as providing a default for specific things... (e.g. hosts = 127.0.0.1:3000)?

For example:

    /// # dotenv::dotenv().ok();
    /// # let hosts = match std::env::var("AEROSPIKE_HOSTS") {
    /// #     Ok(h) => h,
    /// #     Err(_why) => "127.0.0.1:3000".to_string(),
    /// # }

@jonas32
Copy link
Contributor

jonas32 commented Jan 29, 2021

Why do you want to add dotenv? Its taking the vars from env with default fallback.

static ref AEROSPIKE_HOSTS: String =
        env::var("AEROSPIKE_HOSTS").unwrap_or_else(|_| String::from("127.0.0.1"));
static ref AEROSPIKE_NAMESPACE: String =
        env::var("AEROSPIKE_NAMESPACE").unwrap_or_else(|_| String::from("test"));

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 29, 2021

Because dotenv reads from a file and then populates environment variables. It makes these environment variables project specific and doesn't require that system polute the environment with project specific variables (which may be duplicated across projects and explicitly different).

@jonas32
Copy link
Contributor

jonas32 commented Jan 29, 2021

We are talking about 2 variables. Why do you want to set them that way? You dont have to set it globally. You dont even have to do it at all actually because the default value will take the place. And if you want to overwrite that, just execute it with
AEROSPIKE_HOSTS=127.0.0.1:3000 cargo test
I dont really see a point in adding dotenv here.
In addition, that is only required to run the tests and not to use it the normal way.

@brianbruggeman
Copy link
Author

brianbruggeman commented Jan 29, 2021

@kportertx suggested that this was an open community, but now I'm wondering if that's really true. I hate wasting time playing unnecessary politics on something that I'll end up just forking and then building out what I need so I can get something done.

While I already provided a decent explanation: You don't have to use it personally. As a developer who works on a bunch of different projects, I really appreciate having a local .env file which lets me forget about configuration when I bounce to the projects and lets me just focus on what I want to do with the code. It also codifies my configuration, which is actually a verifiable problem (see the comments above). Finally, it literally costs the project and its developers almost nothing to have it in there.

@jonas32
Copy link
Contributor

jonas32 commented Jan 29, 2021

This is indeed community driven. Im not related to Aerospike in any way...
That was just my opinion on it. I didnt reject it and im not in the position to do so.
If its a useful integration, that will be done.

@jhecking
Copy link
Contributor

jhecking commented Feb 2, 2021

I think optionally reading a .env file in the Makefile, like you did in #96, is a good way of solving this problem. I don't think it's necessary to add the dotenv package to the client itself.

@brianbruggeman
Copy link
Author

@jhecking the client technically did not include the package - only the dev-dependencies which are explicitly for testing and things like documentation. I think the makefile gets around the limitation, but if someone knew Rust and expected "cargo ..." to work, then it wouldn't without extra hassle (though obviously, make test is easy if you have CMake installed)... it would work on Windows, therefore, if we include dotenv.

@jhecking
Copy link
Contributor

jhecking commented Feb 2, 2021

Understood, and I would be open to using dotenv as a test dependency, though I'm not sure it's still needed since your Makefile covers that use-case quite well. I just don't think the client itself should have any dependency on dotenv since it will be up to the application, which is using the Aerospike client, to decide how to handle its configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants