Skip to content

Commit

Permalink
increase test
Browse files Browse the repository at this point in the history
  • Loading branch information
hermeGarcia committed Nov 27, 2023
1 parent e0e6221 commit e2f6db2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nucliadb_vectors/src/data_types/key_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,15 @@ mod tests {
(greater_than_2, v2_store.as_slice()),
];
merge::<(GreaterThan, TElem), std::fs::File>(&mut file, elems.as_slice()).unwrap();
let expected: Vec<u32> = vec![3, 4, 5, 6, 7, 8];
let merge_store = unsafe { memmap2::Mmap::map(&file).unwrap() };
let number_of_elements = elements_in_total(&merge_store);
let values: Vec<u32> = (0..number_of_elements)
.map(|i| get_value(TElem, &merge_store, i))
.map(|s| u32::from_be_bytes(s.try_into().unwrap()))
.collect();
assert_eq!(number_of_elements, 6);
assert_eq!(values, expected);

let elems = vec![
// cero and one will be removed
Expand All @@ -481,8 +487,14 @@ mod tests {
(greater_than_10, v2_store.as_slice()),
];
merge::<(GreaterThan, TElem), std::fs::File>(&mut file, elems.as_slice()).unwrap();
let expected: Vec<u32> = vec![3, 4, 5];
let merge_store = unsafe { memmap2::Mmap::map(&file).unwrap() };
let number_of_elements = elements_in_total(&merge_store);
let values: Vec<u32> = (0..number_of_elements)
.map(|i| get_value(TElem, &merge_store, i))
.map(|s| u32::from_be_bytes(s.try_into().unwrap()))
.collect();
assert_eq!(number_of_elements, 3);
assert_eq!(values, expected);
}
}

1 comment on commit e2f6db2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: e2f6db2 Previous: 6a3e3cd Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 13044.529004259115 iter/sec (stddev: 3.7283171903208023e-7) 6621.622688322887 iter/sec (stddev: 0.000003234538187648496) 0.51

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.