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

gripmock / grpctestify-rust / 24849353019

23 Apr 2026 05:30PM UTC coverage: 77.721% (+0.8%) from 76.897%
24849353019

Pull #42

github

web-flow
Merge 43a0b7af9 into 59e77d08a
Pull Request #42: bump rustc & command grpcurl (exp)

1068 of 1260 new or added lines in 25 files covered. (84.76%)

95 existing lines in 7 files now uncovered.

18862 of 24269 relevant lines covered (77.72%)

40957.95 hits per line

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

75.0
/src/polyfill/runtime.rs
1
pub trait Clock {
2
    fn timestamp() -> i64;
3
    fn rfc3339() -> String;
4
    fn unix_millis() -> u128;
5
}
6

7
pub struct SystemClock;
8

9
impl Clock for SystemClock {
10
    fn timestamp() -> i64 {
40,622✔
11
        std::cfg_select! {
12
            miri => 0,
13
            _ => chrono::Utc::now().timestamp(),
40,622✔
14
        }
15
    }
40,622✔
16

17
    fn rfc3339() -> String {
×
18
        std::cfg_select! {
19
            miri => "1970-01-01T00:00:00+00:00".to_string(),
NEW
20
            _ => chrono::Utc::now().to_rfc3339(),
×
21
        }
22
    }
×
23

24
    fn unix_millis() -> u128 {
8✔
25
        std::cfg_select! {
26
            miri => 0,
27
            _ => {
28
                std::time::SystemTime::now()
8✔
29
                    .duration_since(std::time::UNIX_EPOCH)
8✔
30
                    .unwrap_or_default()
8✔
31
                    .as_millis()
8✔
32
            },
33
        }
34
    }
8✔
35
}
36

37
pub fn now_timestamp() -> i64 {
40,622✔
38
    SystemClock::timestamp()
40,622✔
39
}
40,622✔
40

41
pub fn now_rfc3339() -> String {
×
42
    SystemClock::rfc3339()
×
43
}
×
44

45
pub fn now_unix_millis() -> u128 {
8✔
46
    SystemClock::unix_millis()
8✔
47
}
8✔
48

49
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
50
pub enum Capability {
51
    ProcessSpawn,
52
    RealtimeClock,
53
    IsolatedFsIo,
54
}
55

56
pub const fn supports(_capability: Capability) -> bool {
27✔
57
    std::cfg_select! {
58
        miri => false,
59
        _ => true,
27✔
60
    }
61
}
27✔
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