SOULSEEK_E2E_MODE=daemon makes the existing e2e harness serve every session from a daemon instead of the command's own login, so the same 83 tests assert the same records and exit codes both ways. CI runs the suite twice. Two defects it found: serve judged whether anything was shared from this run's configuration rather than from the session, so routed to a daemon it would start with nothing to serve and report success. The TUI showed an empty conversation when attached, because the daemon's message history was never asked for. It is now a SessionApi method, empty locally, which puts the difference behind the seam. main.rs is now a thin entry point over the library rather than a second copy of every module, so the program compiles once instead of twice.
24 lines
624 B
Rust
24 lines
624 B
Rust
//! Entry point. Everything it does lives in the library crate, so the same
|
|
//! code is what integration tests drive.
|
|
|
|
use soulseek_rs_tui::output::{Exit, Out};
|
|
use soulseek_rs_tui::run;
|
|
use std::process::ExitCode;
|
|
|
|
fn main() -> ExitCode {
|
|
dotenv::dotenv().ok();
|
|
let _ = color_eyre::install();
|
|
|
|
let cli = <soulseek_rs_tui::cli::Cli as clap::Parser>::parse();
|
|
run::init_logging(&cli);
|
|
|
|
let out = Out::new(cli.json, cli.quiet);
|
|
match run::run(cli, &out) {
|
|
Ok(()) => Exit::Ok.into(),
|
|
Err(error) => {
|
|
out.error(&error.message);
|
|
error.exit.into()
|
|
}
|
|
}
|
|
}
|