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

payjoin / rust-payjoin / 13203244614

07 Feb 2025 03:48PM UTC coverage: 79.009% (-0.07%) from 79.08%
13203244614

push

github

web-flow
Fix payjoin-cli v1 coverage (#532)

Fix #499 

This required a few changes:

- Add an explicit `llvm-cov` command for running the payjoin-cli v1 e2e
test, as it is not currently covered by `--all-features`.
- Add graceful SIGINT handling to payjoin-cli v1.
- Modify the `sigint` test function to wait until the child process
completely exits, so that the interrupt handlers can actually print to
stdout without panicking (`failed printing to stdout: Broken pipe (os
error 32)`). This issue also affected the payjoin-cli v2 test, so this
fix reduces the noise there as well (see
https://github.com/payjoin/rust-payjoin/issues/499#issuecomment-2613238131).
- Remove unnecessary `tokio::spawn`s in tests which moved `cli.stdout`
out of the main loop, also causing panics like the former in interrupt
handlers.
- The last commit only refactors and extracts shared e2e testing code.

14 of 15 new or added lines in 2 files covered. (93.33%)

6 existing lines in 3 files now uncovered.

4020 of 5088 relevant lines covered (79.01%)

904.07 hits per line

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

0.0
/payjoin-cli/src/db/error.rs
1
use std::fmt;
2

3
#[cfg(feature = "v2")]
4
use bitcoincore_rpc::jsonrpc::serde_json;
5
use sled::Error as SledError;
6

7
pub(crate) type Result<T> = std::result::Result<T, Error>;
8

9
#[derive(Debug)]
10
pub(crate) enum Error {
11
    Sled(SledError),
12
    #[cfg(feature = "v2")]
13
    Serialize(serde_json::Error),
14
    #[cfg(feature = "v2")]
15
    Deserialize(serde_json::Error),
16
}
17

18
impl fmt::Display for Error {
19
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
×
20
        match self {
×
21
            Error::Sled(e) => write!(f, "Database operation failed: {}", e),
×
UNCOV
22
            #[cfg(feature = "v2")]
×
23
            Error::Serialize(e) => write!(f, "Serialization failed: {}", e),
×
UNCOV
24
            #[cfg(feature = "v2")]
×
25
            Error::Deserialize(e) => write!(f, "Deserialization failed: {}", e),
×
UNCOV
26
        }
×
27
    }
×
28
}
29

30
impl std::error::Error for Error {}
31

32
impl From<SledError> for Error {
33
    fn from(error: SledError) -> Self { Error::Sled(error) }
×
34
}
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