Skip to content

Commit 60503f4

Browse files
committed
Address suggestions
1 parent b89d369 commit 60503f4

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/snapshot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Cloud destinations are not yet supported.`,
5656
return fmt.Errorf("failed to get config: %w", err)
5757
}
5858

59-
awsContainer := config.ContainerConfig{Type: config.EmulatorAWS, Port: config.DefaultAWSPort}
59+
var awsContainer config.ContainerConfig
6060
var found bool
6161
for _, c := range appConfig.Containers {
6262
if c.Type == config.EmulatorAWS {

test/integration/snapshot_save_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestSnapshotSaveDefaultDestination(t *testing.T) {
5555
dir := t.TempDir()
5656

5757
stdout, stderr, err := runLstk(t, ctx, dir,
58-
env.With(env.LocalStackHost, lsHost(srv)),
58+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
5959
"--non-interactive", "snapshot", "save",
6060
)
6161
require.NoError(t, err, "lstk snapshot save failed: %s", stderr)
@@ -85,7 +85,7 @@ func TestSnapshotSaveCustomPath(t *testing.T) {
8585
outPath := filepath.Join(dir, "my-snap.zip")
8686

8787
stdout, stderr, err := runLstk(t, ctx, dir,
88-
env.With(env.LocalStackHost, lsHost(srv)),
88+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
8989
"--non-interactive", "snapshot", "save", outPath,
9090
)
9191
require.NoError(t, err, "lstk snapshot save failed: %s", stderr)
@@ -112,7 +112,7 @@ func TestSnapshotSaveRelativePath(t *testing.T) {
112112
dir := t.TempDir()
113113

114114
stdout, stderr, err := runLstk(t, ctx, dir,
115-
env.With(env.LocalStackHost, lsHost(srv)),
115+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
116116
"--non-interactive", "snapshot", "save", "./my-state",
117117
)
118118
require.NoError(t, err, "lstk snapshot save failed: %s", stderr)
@@ -135,7 +135,7 @@ func TestSnapshotSaveOverwritesExistingFile(t *testing.T) {
135135
require.NoError(t, os.WriteFile(outPath, []byte("OLD"), 0600))
136136

137137
_, stderr, err := runLstk(t, ctx, dir,
138-
env.With(env.LocalStackHost, lsHost(srv)),
138+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
139139
"--non-interactive", "snapshot", "save", outPath,
140140
)
141141
require.NoError(t, err, "lstk snapshot save should overwrite: %s", stderr)
@@ -188,7 +188,7 @@ func TestSnapshotSaveInvalidParentDir(t *testing.T) {
188188
srv := mockStateServer(t)
189189

190190
_, stderr, err := runLstk(t, ctx, t.TempDir(),
191-
env.With(env.LocalStackHost, lsHost(srv)),
191+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
192192
"--non-interactive", "snapshot", "save", "/no/such/dir/state",
193193
)
194194
requireExitCode(t, 1, err)
@@ -206,7 +206,7 @@ func TestSnapshotSaveTelemetryEmitted(t *testing.T) {
206206

207207
analyticsSrv, events := mockAnalyticsServer(t)
208208
_, stderr, err := runLstk(t, ctx, t.TempDir(),
209-
env.With(env.LocalStackHost, lsHost(srv)).With(env.AnalyticsEndpoint, analyticsSrv.URL),
209+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)).With(env.AnalyticsEndpoint, analyticsSrv.URL),
210210
"--non-interactive", "snapshot", "save",
211211
)
212212
require.NoError(t, err, "lstk snapshot save failed: %s", stderr)
@@ -223,7 +223,7 @@ func TestSnapshotSaveTelemetryOnFailure(t *testing.T) {
223223

224224
analyticsSrv, events := mockAnalyticsServer(t)
225225
_, _, err := runLstk(t, ctx, t.TempDir(),
226-
env.With(env.AnalyticsEndpoint, analyticsSrv.URL),
226+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.AnalyticsEndpoint, analyticsSrv.URL),
227227
"--non-interactive", "snapshot", "save",
228228
)
229229
requireExitCode(t, 1, err)
@@ -241,7 +241,7 @@ func TestSnapshotSaveInteractive(t *testing.T) {
241241
dir := t.TempDir()
242242

243243
out, err := runLstkInPTY(t, ctx,
244-
env.With(env.LocalStackHost, lsHost(srv)),
244+
env.Environ(testEnvWithHome(t.TempDir(), "")).With(env.LocalStackHost, lsHost(srv)),
245245
"snapshot", "save", filepath.Join(dir, "snap"),
246246
)
247247
require.NoError(t, err, "interactive lstk snapshot save failed")

0 commit comments

Comments
 (0)