• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tari-project / tari / 18097567115

29 Sep 2025 12:50PM UTC coverage: 58.554% (-2.3%) from 60.88%
18097567115

push

github

web-flow
chore(ci): switch rust toolchain to stable (#7524)

Description
switch rust toolchain to stable

Motivation and Context
use stable rust toolchain


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Standardized Rust toolchain on stable across CI workflows for more
predictable builds.
* Streamlined setup by removing unnecessary components and aligning
toolchain configuration with environment variables.
  * Enabled an environment flag to improve rustup behavior during CI.
* Improved coverage workflow consistency with dynamic toolchain
selection.

* **Tests**
* Removed nightly-only requirements, simplifying test commands and
improving compatibility.
* Expanded CI triggers to include ci-* branches for better pre-merge
validation.
* Maintained existing job logic while improving reliability and
maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

66336 of 113291 relevant lines covered (58.55%)

551641.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/infrastructure/test_utils/src/runtime.rs
1
// Copyright 2019, The Tari Project
2
//
3
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4
// following conditions are met:
5
//
6
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7
// disclaimer.
8
//
9
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
10
// following disclaimer in the documentation and/or other materials provided with the distribution.
11
//
12
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
13
// products derived from this software without specific prior written permission.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22

23
use std::{future::Future, pin::Pin};
24

25
use futures::{future, FutureExt};
26
use tari_shutdown::Shutdown;
27
use tokio::{runtime, runtime::Runtime, task, task::JoinError};
28

29
pub fn create_runtime() -> Runtime {
×
30
    tokio::runtime::Builder::new_multi_thread()
×
31
        .enable_all()
×
32
        .build()
×
33
        .expect("Could not create runtime")
×
34
}
×
35

36
pub fn spawn_until_shutdown<F>(fut: F) -> Shutdown
×
37
where F: Future<Output = ()> + Send + 'static {
×
38
    let shutdown = Shutdown::new();
×
39
    let signal = shutdown.to_signal();
×
40
    task::spawn(async move {
×
41
        futures::pin_mut!(fut);
×
42
        future::select(signal, fut).await;
×
43
    });
×
44
    shutdown
×
45
}
×
46

47
type BoxedJoinFuture = Pin<Box<dyn Future<Output = Result<(), JoinError>>>>;
48

49
pub struct TestRuntime {
50
    inner: Runtime,
51
    handles: Vec<BoxedJoinFuture>,
52
}
53

54
impl TestRuntime {
55
    pub fn block_on<F: Future>(&mut self, future: F) -> F::Output {
×
56
        self.inner.block_on(future)
×
57
    }
×
58

59
    pub fn spawn<F>(&mut self, future: F)
×
60
    where
×
61
        F: Future + Send + 'static,
×
62
        F::Output: Send + 'static,
×
63
    {
64
        let handle = self.inner.spawn(future);
×
65
        self.handles.push(
×
66
            handle
×
67
                .map(|result| match result {
×
68
                    Ok(_) => Ok(()),
×
69
                    Err(err) => Err(err),
×
70
                })
×
71
                .boxed(),
×
72
        );
73
    }
×
74

75
    pub fn spawn_unchecked<F>(&mut self, future: F) -> task::JoinHandle<F::Output>
×
76
    where
×
77
        F: Future + Send + 'static,
×
78
        F::Output: Send + 'static,
×
79
    {
80
        self.inner.spawn(future)
×
81
    }
×
82

83
    pub fn handle(&self) -> &runtime::Handle {
×
84
        self.inner.handle()
×
85
    }
×
86
}
87

88
impl From<Runtime> for TestRuntime {
89
    fn from(rt: Runtime) -> Self {
×
90
        Self {
×
91
            inner: rt,
×
92
            handles: Vec::new(),
×
93
        }
×
94
    }
×
95
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc