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

Function run_scheduler_test

chirpstack/src/test/class_c_test.rs:293–330  ·  view source on GitHub ↗
(t: &DownlinkTest)

Source from the content-addressed store, hash-verified

291}
292
293async fn run_scheduler_test(t: &DownlinkTest) {
294 println!("> {}", t.name);
295
296 reset_redis().await.unwrap();
297
298 integration::set_mock().await;
299 gateway_backend::set_backend("eu868", Box::new(gateway_backend::mock::Backend {})).await;
300
301 integration::mock::reset().await;
302 gateway_backend::mock::reset().await;
303 device_queue::flush_for_dev_eui(&t.dev_eui).await.unwrap();
304 device::partial_update(
305 t.dev_eui,
306 &device::DeviceChangeset {
307 device_session: Some(
308 t.device_session
309 .as_ref()
310 .map(fields::DeviceSession::from)
311 .clone(),
312 ),
313 ..Default::default()
314 },
315 )
316 .await
317 .unwrap();
318
319 for qi in &t.device_queue_items {
320 let _ = device_queue::enqueue_item(qi.clone()).await.unwrap();
321 }
322
323 downlink::scheduler::schedule_device_queue_batch(1)
324 .await
325 .unwrap();
326
327 for assert in &t.assert {
328 assert().await;
329 }
330}

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