Skip to content

Commit 8be060f

Browse files
authored
chore: Update lock file (#1133)
* chore: Update lock file Signed-off-by: Lucio Franco <[email protected]> * Clean up warnings Signed-off-by: Lucio Franco <[email protected]> * Use elastic 0.20 Signed-off-by: Lucio Franco <[email protected]> * Remove usage of sync es client Signed-off-by: Lucio Franco <[email protected]> * Remove elastic in favor of elastic_response Signed-off-by: Lucio Franco <[email protected]> * Fix url for structure test Signed-off-by: Lucio Franco <[email protected]>
1 parent a0a5bee commit 8be060f

10 files changed

+880
-1380
lines changed

Cargo.lock

+851-1,349
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ reqwest = "0.9.5"
139139
tempfile = "3.0.6"
140140
libc = "0.2.43"
141141
walkdir = "2.2.7"
142-
elastic = { git = "https://github.com/elastic-rs/elastic" }
142+
elastic_responses = "0.20"
143143
matches = "0.1.8"
144144
pretty_assertions = "0.6.1"
145145
proptest = "0.9"

src/sinks/aws_kinesis_streams.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ mod integration_tests {
365365
let (mut input_lines, events) = random_lines_with_stream(100, 11);
366366

367367
let pump = sink.send_all(events);
368-
rt.block_on(pump).unwrap();
368+
let _ = rt.block_on(pump).unwrap();
369369

370370
std::thread::sleep(std::time::Duration::from_secs(1));
371371

src/sinks/aws_s3.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ mod integration_tests {
422422
let (lines, events) = random_lines_with_stream(100, 10);
423423

424424
let pump = sink.send_all(events);
425-
block_on(pump).unwrap();
425+
let _ = block_on(pump).unwrap();
426426

427427
let keys = get_keys(prefix.unwrap());
428428
assert_eq!(keys.len(), 1);
@@ -566,7 +566,7 @@ mod integration_tests {
566566
let (lines, events) = random_lines_with_stream(100, 500);
567567

568568
let pump = sink.send_all(events);
569-
block_on(pump).unwrap();
569+
let _ = block_on(pump).unwrap();
570570

571571
let keys = get_keys(prefix.unwrap());
572572
assert_eq!(keys.len(), 2);

src/sinks/blackhole.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ mod tests {
9898

9999
let (_input_lines, events) = random_events_with_stream(100, 10);
100100

101-
sink.send_all(events).wait().unwrap();
101+
let _ = sink.send_all(events).wait().unwrap();
102102
}
103103
}

src/sinks/elasticsearch.rs

+18-20
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ mod integration_tests {
448448
topology::config::SinkConfig,
449449
Event,
450450
};
451-
use elastic::client::SyncClientBuilder;
452451
use futures::{Future, Sink};
453452
use hyper::{Body, Request};
454453
use serde_json::{json, Value};
@@ -459,7 +458,7 @@ mod integration_tests {
459458
fn structures_events_correctly() {
460459
let index = gen_index();
461460
let config = ElasticSearchConfig {
462-
host: "http://localhost:9200/".into(),
461+
host: "http://localhost:9200".into(),
463462
index: Some(index.clone()),
464463
doc_type: Some("log_lines".into()),
465464
id_key: Some("my_id".into()),
@@ -484,20 +483,23 @@ mod integration_tests {
484483
// make sure writes all all visible
485484
block_on(flush(&config)).unwrap();
486485

487-
let client = SyncClientBuilder::new().build().unwrap();
488-
489-
let response = client
490-
.search::<Value>()
491-
.index(index)
492-
.body(json!({
486+
let response = reqwest::Client::new()
487+
.get(&format!("{}/{}/_search", config.host, index))
488+
.json(&json!({
493489
"query": { "query_string": { "query": "*" } }
494490
}))
495491
.send()
492+
.unwrap()
493+
.json::<elastic_responses::search::SearchResponse<Value>>()
496494
.unwrap();
495+
496+
println!("response {:?}", response);
497+
497498
assert_eq!(1, response.total());
498499

499500
let hit = response.into_hits().next().unwrap();
500-
assert_eq!("42", hit.id());
501+
let doc = hit.document().unwrap();
502+
assert_eq!(Some("42"), doc["my_id"].as_str());
501503

502504
let value = hit.into_document().unwrap();
503505
let expected = json!({
@@ -558,7 +560,7 @@ mod integration_tests {
558560
let (input, events) = random_events_with_stream(100, 100);
559561

560562
let pump = sink.send_all(events);
561-
block_on(pump).expect("Sending events failed");
563+
let _ = block_on(pump).expect("Sending events failed");
562564

563565
// make sure writes all all visible
564566
block_on(flush(&config)).expect("Flushing writes failed");
@@ -570,24 +572,20 @@ mod integration_tests {
570572
.unwrap();
571573
let test_ca = reqwest::Certificate::from_pem(&test_ca).unwrap();
572574

573-
let http_client = reqwest::Client::builder()
575+
let client = reqwest::Client::builder()
574576
.add_root_certificate(test_ca)
575577
.build()
576578
.expect("Could not build HTTP client");
577-
let client = SyncClientBuilder::new()
578-
.http_client(http_client)
579-
.static_node(config.host)
580-
.build()
581-
.expect("Building test client failed");
582579

583580
let response = client
584-
.search::<Value>()
585-
.index(index)
586-
.body(json!({
581+
.get(&format!("{}/{}/_search", config.host, index))
582+
.json(&json!({
587583
"query": { "query_string": { "query": "*" } }
588584
}))
589585
.send()
590-
.expect("Issuing test query failed");
586+
.unwrap()
587+
.json::<elastic_responses::search::SearchResponse<Value>>()
588+
.unwrap();
591589

592590
assert_eq!(input.len() as u64, response.total());
593591
let input = input

src/sinks/http.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ mod tests {
391391
let mut rt = Runtime::new().unwrap();
392392
rt.spawn(server);
393393

394-
rt.block_on(pump).unwrap();
394+
let _ = rt.block_on(pump).unwrap();
395395
drop(trigger);
396396

397397
let output_lines = rx
@@ -449,7 +449,7 @@ mod tests {
449449
let mut rt = Runtime::new().unwrap();
450450
rt.spawn(server);
451451

452-
rt.block_on(pump).unwrap();
452+
let _ = rt.block_on(pump).unwrap();
453453
drop(trigger);
454454

455455
let output_lines = rx
@@ -507,7 +507,7 @@ mod tests {
507507
let mut rt = Runtime::new().unwrap();
508508
rt.spawn(server);
509509

510-
rt.block_on(pump).unwrap();
510+
let _ = rt.block_on(pump).unwrap();
511511
drop(trigger);
512512

513513
let output_lines = rx

src/sinks/kafka.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ mod integration_test {
341341
let (input, events) = random_lines_with_stream(100, num_events);
342342

343343
let pump = sink.send_all(events);
344-
block_on(pump).unwrap();
344+
let _ = block_on(pump).unwrap();
345345

346346
// read back everything from the beginning
347347
let mut client_config = rdkafka::ClientConfig::new();

src/sinks/splunk_hec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ mod integration_tests {
333333

334334
let pump = sink.send_all(events);
335335

336-
rt.block_on(pump).unwrap();
336+
let _ = rt.block_on(pump).unwrap();
337337

338338
let mut found_all = false;
339339
for _ in 0..20 {

src/sinks/util/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ mod test {
230230

231231
rt.block_on(req).unwrap();
232232

233-
rt.shutdown_now();
233+
let _ = rt.shutdown_now();
234234

235235
let (body, _rest) = rx.into_future().wait().unwrap();
236236
assert_eq!(body.unwrap().unwrap(), "hello");

0 commit comments

Comments
 (0)