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

Function run_test

chirpstack/src/test/class_a_test.rs:5738–5792  ·  view source on GitHub ↗
(t: &Test)

Source from the content-addressed store, hash-verified

5736}
5737
5738async fn run_test(t: &Test) {
5739 println!("> {}", t.name);
5740 reset_redis().await.unwrap();
5741
5742 integration::set_mock().await;
5743 gateway_backend::set_backend("eu868", Box::new(gateway_backend::mock::Backend {})).await;
5744
5745 integration::mock::reset().await;
5746 gateway_backend::mock::reset().await;
5747
5748 device_queue::flush_for_dev_eui(&t.dev_eui).await.unwrap();
5749 device::partial_update(
5750 t.dev_eui,
5751 &device::DeviceChangeset {
5752 device_session: Some(
5753 t.device_session
5754 .as_ref()
5755 .map(fields::DeviceSession::from)
5756 .clone(),
5757 ),
5758 ..Default::default()
5759 },
5760 )
5761 .await
5762 .unwrap();
5763
5764 if let Some(f) = &t.before_func {
5765 f().await;
5766 }
5767
5768 for qi in &t.device_queue_items {
5769 let _ = device_queue::enqueue_item(qi.clone()).await.unwrap();
5770 }
5771
5772 uplink::handle_uplink(
5773 CommonName::EU868,
5774 "eu868",
5775 Uuid::new_v4(),
5776 gw::UplinkFrameSet {
5777 phy_payload: t.phy_payload.to_vec().unwrap(),
5778 tx_info: Some(t.tx_info.clone()),
5779 rx_info: vec![t.rx_info.clone()],
5780 },
5781 )
5782 .await
5783 .unwrap();
5784
5785 for assert in &t.assert {
5786 assert().await;
5787 }
5788
5789 if let Some(f) = &t.after_func {
5790 f().await;
5791 }
5792}

Calls 11

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
handle_uplinkFunction · 0.50
to_vecMethod · 0.45

Tested by

no test coverage detected