mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-27 22:01:46 +02:00
Show unacknowledged toast message upon integration test failure
Often if a test fails and there's an unaknowledged toast message, that message will explain why the test failed. Given that we don't display toast messages in integration tests when they run (for reasons I can't recall right now), we need to log it as part of the error message.
This commit is contained in:
parent
1ea0c270df
commit
ab3004bcd5
@ -88,10 +88,18 @@ func (self *GuiDriver) ContextForView(viewName string) types.Context {
|
||||
|
||||
func (self *GuiDriver) Fail(message string) {
|
||||
currentView := self.gui.g.CurrentView()
|
||||
|
||||
// Check for unacknowledged toast: it may give us a hint as to why the test failed
|
||||
toastMessage := ""
|
||||
if t := self.NextToast(); t != nil {
|
||||
toastMessage = fmt.Sprintf("Unacknowledged toast message: %s\n", *t)
|
||||
}
|
||||
|
||||
fullMessage := fmt.Sprintf(
|
||||
"%s\nFinal Lazygit state:\n%s\nUpon failure, focused view was '%s'.\nLog:\n%s", message,
|
||||
"%s\nFinal Lazygit state:\n%s\nUpon failure, focused view was '%s'.\n%sLog:\n%s", message,
|
||||
self.gui.g.Snapshot(),
|
||||
currentView.Name(),
|
||||
toastMessage,
|
||||
strings.Join(self.gui.GuiLog, "\n"),
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user