Skip to content

Commit

Permalink
Fix unit test (#4610)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Feb 20, 2024
1 parent 9bfbae2 commit 1891932
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions quickwit/quickwit-control-plane/src/control_plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,7 @@ fn apply_index_template_match(
mod tests {
use mockall::Sequence;
use quickwit_actors::{AskError, Observe, SupervisorMetrics};
use quickwit_config::{
IndexConfig, SourceParams, CLI_SOURCE_ID, INGEST_API_SOURCE_ID, INGEST_V2_SOURCE_ID,
};
use quickwit_config::{IndexConfig, SourceParams, CLI_SOURCE_ID, INGEST_V2_SOURCE_ID};
use quickwit_indexing::IndexingService;
use quickwit_metastore::{
CreateIndexRequestExt, IndexMetadata, ListIndexesMetadataResponseExt,
Expand Down Expand Up @@ -1718,10 +1716,10 @@ mod tests {
assert_eq!(index_config.index_uri, "ram:///indexes/test-index-foo");

let source_configs = request.deserialize_source_configs().unwrap();
assert_eq!(source_configs.len(), 3);
assert_eq!(source_configs[0].source_id, INGEST_API_SOURCE_ID);
assert_eq!(source_configs[1].source_id, INGEST_V2_SOURCE_ID);
assert_eq!(source_configs[2].source_id, CLI_SOURCE_ID);
assert_eq!(source_configs.len(), 2);
// assert_eq!(source_configs[0].source_id, INGEST_API_SOURCE_ID);
assert_eq!(source_configs[0].source_id, INGEST_V2_SOURCE_ID);
assert_eq!(source_configs[1].source_id, CLI_SOURCE_ID);

let index_uid = IndexUid::from_parts("test-index-foo", 0);
let mut index_metadata = IndexMetadata::new_with_index_uid(index_uid, index_config);
Expand Down
3 changes: 2 additions & 1 deletion quickwit/quickwit-ingest/src/ingest_v2/ingester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2572,10 +2572,11 @@ mod tests {
mock_control_plane
.expect_advise_reset_shards()
.once()
.returning(|request| {
.returning(|mut request| {
assert_eq!(request.shard_ids.len(), 1);
assert_eq!(request.shard_ids[0].index_uid(), &("test-index", 0));
assert_eq!(request.shard_ids[0].source_id, "test-source");
request.shard_ids[0].shard_ids.sort();
assert_eq!(
request.shard_ids[0].shard_ids,
[ShardId::from(1), ShardId::from(2)]
Expand Down

0 comments on commit 1891932

Please sign in to comment.