Skip to content

Commit a6cfc17

Browse files
committed
Remove option from update prompt
1 parent 8972259 commit a6cfc17

2 files changed

Lines changed: 2 additions & 40 deletions

File tree

test/integration/start_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func TestStartCommandSetsUpContainerCorrectly(t *testing.T) {
207207
t.Run("http health endpoint", func(t *testing.T) {
208208
resp, err := http.Get("http://localhost.localstack.cloud:4566/_localstack/health")
209209
require.NoError(t, err)
210-
defer resp.Body.Close()
210+
defer func() { require.NoError(t, resp.Body.Close()) }()
211211
assert.Equal(t, http.StatusOK, resp.StatusCode)
212212
})
213213

@@ -221,7 +221,7 @@ func TestStartCommandSetsUpContainerCorrectly(t *testing.T) {
221221
}
222222
resp, err := client.Get("https://localhost.localstack.cloud/_localstack/health")
223223
require.NoError(t, err)
224-
defer resp.Body.Close()
224+
defer func() { require.NoError(t, resp.Body.Close()) }()
225225
assert.Equal(t, http.StatusOK, resp.StatusCode)
226226
})
227227
}

test/integration/update_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -310,44 +310,6 @@ func TestUpdateNotification(t *testing.T) {
310310
assert.Contains(t, output.String(), "New lstk version available")
311311
})
312312

313-
t.Run("never", func(t *testing.T) {
314-
configFile := filepath.Join(t.TempDir(), "config.toml")
315-
require.NoError(t, os.WriteFile(configFile, []byte("[cli]\nupdate_prompt = true\n"), 0o644))
316-
317-
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
318-
defer cancel()
319-
320-
cmd := exec.CommandContext(ctx, tmpBinary, "--config", configFile)
321-
cmd.Env = env.Without(env.AuthToken).With(env.AuthToken, "fake-token").With(env.APIEndpoint, mockServer.URL)
322-
323-
ptmx, err := pty.Start(cmd)
324-
require.NoError(t, err, "failed to start command in PTY")
325-
defer func() { _ = ptmx.Close() }()
326-
327-
output := &syncBuffer{}
328-
outputCh := make(chan struct{})
329-
go func() {
330-
_, _ = io.Copy(output, ptmx)
331-
close(outputCh)
332-
}()
333-
334-
require.Eventually(t, func() bool {
335-
return bytes.Contains(output.Bytes(), []byte("New lstk version available"))
336-
}, 10*time.Second, 100*time.Millisecond, "update notification prompt should appear")
337-
338-
_, err = ptmx.Write([]byte("n"))
339-
require.NoError(t, err)
340-
341-
_ = cmd.Wait()
342-
<-outputCh
343-
344-
assert.Contains(t, output.String(), "New lstk version available")
345-
346-
// Verify config was updated to disable future prompts
347-
configData, err := os.ReadFile(configFile)
348-
require.NoError(t, err)
349-
assert.Contains(t, string(configData), "update_prompt = false")
350-
})
351313

352314
t.Run("update", func(t *testing.T) {
353315
// Copy binary since it will be replaced during the update

0 commit comments

Comments
 (0)