mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-31 23:19:40 +02:00
Include demos when running integration tests on CI (#3640)
- **PR Description** This includes the demos when using `make integration-test-all`, and speeds them up a little bit when run in this way by disabling Wait calls when running in headless mode. This will guard against demos breaking when we make behavior changes, as happened several times in the past (most recently in #3636.
This commit is contained in:
commit
eef70dbdf6
@ -21,6 +21,7 @@ type GuiDriver struct {
|
|||||||
gui *Gui
|
gui *Gui
|
||||||
isIdleChan chan struct{}
|
isIdleChan chan struct{}
|
||||||
toastChan chan string
|
toastChan chan string
|
||||||
|
headless bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ integrationTypes.GuiDriver = &GuiDriver{}
|
var _ integrationTypes.GuiDriver = &GuiDriver{}
|
||||||
@ -161,3 +162,7 @@ func (self *GuiDriver) NextToast() *string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (self *GuiDriver) Headless() bool {
|
||||||
|
return self.headless
|
||||||
|
}
|
||||||
|
@ -38,7 +38,7 @@ func (gui *Gui) handleTestMode() {
|
|||||||
gui.PopupHandler.(*popup.PopupHandler).SetToastFunc(
|
gui.PopupHandler.(*popup.PopupHandler).SetToastFunc(
|
||||||
func(message string, kind types.ToastKind) { toastChan <- message })
|
func(message string, kind types.ToastKind) { toastChan <- message })
|
||||||
|
|
||||||
test.Run(&GuiDriver{gui: gui, isIdleChan: isIdleChan, toastChan: toastChan})
|
test.Run(&GuiDriver{gui: gui, isIdleChan: isIdleChan, toastChan: toastChan, headless: Headless()})
|
||||||
|
|
||||||
gui.g.Update(func(*gocui.Gui) error {
|
gui.g.Update(func(*gocui.Gui) error {
|
||||||
return gocui.ErrQuit
|
return gocui.ErrQuit
|
||||||
|
@ -45,12 +45,6 @@ func TestIntegration(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// not running demoes right now. Arguably we should, but we'd need to
|
|
||||||
// strip away any artificial lag they use.
|
|
||||||
if test.IsDemo() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Run(test.Name(), func(t *testing.T) {
|
t.Run(test.Name(), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
err := f()
|
err := f()
|
||||||
|
@ -84,6 +84,8 @@ func (self *fakeGuiDriver) NextToast() *string {
|
|||||||
|
|
||||||
func (self *fakeGuiDriver) CheckAllToastsAcknowledged() {}
|
func (self *fakeGuiDriver) CheckAllToastsAcknowledged() {}
|
||||||
|
|
||||||
|
func (self *fakeGuiDriver) Headless() bool { return false }
|
||||||
|
|
||||||
func TestManualFailure(t *testing.T) {
|
func TestManualFailure(t *testing.T) {
|
||||||
test := NewIntegrationTest(NewIntegrationTestArgs{
|
test := NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Description: unitTestDescription,
|
Description: unitTestDescription,
|
||||||
|
@ -601,7 +601,9 @@ func (self *ViewDriver) SetCaptionPrefix(prefix string) *ViewDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *ViewDriver) Wait(milliseconds int) *ViewDriver {
|
func (self *ViewDriver) Wait(milliseconds int) *ViewDriver {
|
||||||
self.t.Wait(milliseconds)
|
if !self.t.gui.Headless() {
|
||||||
|
self.t.Wait(milliseconds)
|
||||||
|
}
|
||||||
|
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
@ -46,4 +46,5 @@ type GuiDriver interface {
|
|||||||
// Pop the next toast that was displayed; returns nil if there was none
|
// Pop the next toast that was displayed; returns nil if there was none
|
||||||
NextToast() *string
|
NextToast() *string
|
||||||
CheckAllToastsAcknowledged()
|
CheckAllToastsAcknowledged()
|
||||||
|
Headless() bool
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user