MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / run_scheduler_test

Function run_scheduler_test

chirpstack/src/test/class_b_test.rs:485–522  ·  view source on GitHub ↗
(t: &DownlinkTest)

Source from the content-addressed store, hash-verified

483}
484
485async fn run_scheduler_test(t: &DownlinkTest) {
486 println!("> {}", t.name);
487
488 reset_redis().await.unwrap();
489
490 integration::set_mock().await;
491 gateway_backend::set_backend("eu868", Box::new(gateway_backend::mock::Backend {})).await;
492
493 integration::mock::reset().await;
494 gateway_backend::mock::reset().await;
495 device_queue::flush_for_dev_eui(&t.dev_eui).await.unwrap();
496 device::partial_update(
497 t.dev_eui,
498 &device::DeviceChangeset {
499 device_session: Some(
500 t.device_session
501 .as_ref()
502 .map(fields::DeviceSession::from)
503 .clone(),
504 ),
505 ..Default::default()
506 },
507 )
508 .await
509 .unwrap();
510
511 for qi in &t.device_queue_items {
512 let _ = device_queue::enqueue_item(qi.clone()).await.unwrap();
513 }
514
515 downlink::scheduler::schedule_device_queue_batch(1)
516 .await
517 .unwrap();
518
519 for assert in &t.assert {
520 assert().await;
521 }
522}

Callers 1

test_downlink_schedulerFunction · 0.70

Calls 10

reset_redisFunction · 0.85
set_mockFunction · 0.85
set_backendFunction · 0.85
flush_for_dev_euiFunction · 0.85
enqueue_itemFunction · 0.85
unwrapMethod · 0.80
as_refMethod · 0.80
resetFunction · 0.50
partial_updateFunction · 0.50

Tested by

no test coverage detected