feat(GODT-2255): Randomize the focus service port.

This commit is contained in:
Romain Le Jeune
2023-02-08 10:06:53 +00:00
parent c4ef1a24c0
commit 1c88ce3cc0
18 changed files with 226 additions and 76 deletions

View File

@ -251,7 +251,7 @@ func newBridge(
return nil, fmt.Errorf("failed to create IMAP server: %w", err)
}
focusService, err := focus.NewService(curVersion)
focusService, err := focus.NewService(locator, curVersion)
if err != nil {
return nil, fmt.Errorf("failed to create focus service: %w", err)
}

View File

@ -123,8 +123,11 @@ func TestBridge_Focus(t *testing.T) {
raiseCh, done := bridge.GetEvents(events.Raise{})
defer done()
settingsFolder, err := locator.ProvideSettingsPath()
require.NoError(t, err)
// Simulate a focus event.
focus.TryRaise()
focus.TryRaise(settingsFolder)
// Wait for the event.
require.IsType(t, events.Raise{}, <-raiseCh)