fix(cli): report multi-target failures and return nonzero
Consume structured per-target outcomes in the streaming CLI and TUI so mixed failures remain visible while successful targets still produce output. Return a failure status when every target fails, and keep interruption behavior distinct. Add strict-timeout integration coverage for mixed continuous completion and all-open-failure exit status, plus focused TUI outcome-state tests.
This commit is contained in:
5 files changed
+428
-18
No files matched your search
@@ -211,6 +211,13 @@ pub struct ManagedTargetOutcome {
|
||||
pub warning_events: u64,
|
||||
}
|
||||
|
||||
impl ManagedTargetOutcome {
|
||||
/// Return whether this target completed successfully.
|
||||
pub fn is_success(&self) -> bool {
|
||||
self.end_reason.is_success()
|
||||
}
|
||||
}
|
||||
|
||||
/// Reason an individual target stopped.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum ManagedTargetEndReason {
|
||||
@@ -290,6 +297,19 @@ pub enum ManagedTargetFailureKind {
|
||||
InternalWorker,
|
||||
}
|
||||
|
||||
impl fmt::Display for ManagedTargetFailureKind {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(match self {
|
||||
Self::OpeningTimeout => "opening timeout",
|
||||
Self::OpeningProtocol => "opening protocol/authentication/negotiation",
|
||||
Self::Socket => "socket",
|
||||
Self::RuntimeProtocol => "runtime protocol",
|
||||
Self::InvalidConfiguration => "invalid configuration",
|
||||
Self::InternalWorker => "internal worker",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fn classify_target_failure(error: &ClientError, opening: bool) -> ManagedTargetFailureKind {
|
||||
match error {
|
||||
ClientError::OpenTimeout => ManagedTargetFailureKind::OpeningTimeout,
|
||||
|
||||
Reference in new issue
Block a user