1
0

fix: do not print output on error if real-time output is enabled

This commit is contained in:
dump_stack() 2024-10-09 09:10:19 +00:00
parent c53e0cc99b
commit 27abdc3687
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
2 changed files with 12 additions and 4 deletions

View File

@ -338,7 +338,11 @@ func (ka Artifact) Process(slog zerolog.Logger, ki distro.KernelInfo,
slog.Debug().Str("duration", time.Since(start).String()).
Msg("build done")
if err != nil {
slog.Error().Err(err).Msgf("build failure\n%v\n", result.Build.Output)
if !realtimeOutput {
slog.Error().Err(err).Msgf("build failure\n%v\n", result.Build.Output)
} else {
slog.Error().Err(err).Msg("build failure")
}
return
} else {
if outputOnSuccess && !realtimeOutput {
@ -423,10 +427,10 @@ func (ka Artifact) Process(slog zerolog.Logger, ki distro.KernelInfo,
slog.Debug().Str("duration", time.Since(start).String()).
Msgf("test completed (success: %v)", result.Test.Ok)
if result.Build.Ok {
if result.Build.Ok && !realtimeOutput {
if !result.Run.Ok || !result.Test.Ok {
slog.Error().Msgf("qemu output\n%v\n", qemuTestOutput)
} else if outputOnSuccess && !realtimeOutput {
} else if outputOnSuccess {
slog.Info().Msgf("qemu output\n%v\n", qemuTestOutput)
}
}

View File

@ -352,7 +352,11 @@ func copyArtifactAndTest(slog zerolog.Logger, q *qemu.System, ka Artifact,
}
if err != nil || !res.Test.Ok {
slog.Error().Err(err).Msgf("test error\n%v\n", res.Test.Output)
if !realtimeOutput {
slog.Error().Err(err).Msgf("test failure\n%v\n", res.Test.Output)
} else {
slog.Error().Err(err).Msg("test failure")
}
return
}