Skip to content

Commit 5846520

Browse files
show post-start tip for azure emulator and clarify license-not-covered comment
1 parent 4b3d44a commit 5846520

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

internal/container/start.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ func tipsForType(t config.EmulatorType) []string {
267267
"> Tip: View emulator logs: lstk logs --follow",
268268
"> Tip: Check emulator status: lstk status",
269269
}
270+
case config.EmulatorAzure:
271+
return []string{
272+
"> Tip: View emulator logs: lstk logs --follow",
273+
"> Tip: Check emulator status: lstk status",
274+
}
270275
}
271276
return nil
272277
}
@@ -610,7 +615,7 @@ func validateLicense(ctx context.Context, sink output.Sink, opts StartOptions, c
610615
}
611616

612617
// licenseNotCoveredError is returned by awaitStartup when the container exits
613-
// because it does not include (snowflake) emulator.
618+
// because the license does not include the emulator (Snowflake or Azure).
614619
type licenseNotCoveredError struct{}
615620

616621
func (e *licenseNotCoveredError) Error() string {

internal/container/start_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,20 @@ func TestSelectContainersToStart_ErrorsOnEmulatorTypeMismatch(t *testing.T) {
263263
assert.Contains(t, got, "docker stop localstack-aws")
264264
}
265265

266+
func TestEmitPostStartPointers_Azure(t *testing.T) {
267+
var out bytes.Buffer
268+
sink := output.NewPlainSink(&out)
269+
270+
emitPostStartPointers(sink, config.EmulatorAzure, "localhost.localstack.cloud:4566", "https://app.localstack.cloud/", false)
271+
272+
got := out.String()
273+
assert.Contains(t, got, "• Endpoint: localhost.localstack.cloud:4566\n")
274+
assert.Contains(t, got, "• Web app: https://app.localstack.cloud\n")
275+
assert.Contains(t, got, "> Tip:")
276+
assert.NotContains(t, got, "• Snowflake endpoint:",
277+
"Azure must not show the snowflake-prefixed endpoint")
278+
}
279+
266280
func TestEmitPostStartPointers_UnknownEmulator_NoTip(t *testing.T) {
267281
var out bytes.Buffer
268282
sink := output.NewPlainSink(&out)

test/integration/start_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func TestStartCommandSucceedsForAzure(t *testing.T) {
706706
configFile := writeAzureConfig(t, hostPort)
707707

708708
ctx := testContext(t)
709-
_, stderr, err := runLstk(t, ctx, "", env.With(env.APIEndpoint, mockServer.URL), "--config", configFile, "start")
709+
stdout, stderr, err := runLstk(t, ctx, "", env.With(env.APIEndpoint, mockServer.URL), "--config", configFile, "start")
710710
require.NoError(t, err, "lstk start failed: %s", stderr)
711711
requireExitCode(t, 0, err)
712712

@@ -720,4 +720,7 @@ func TestStartCommandSucceedsForAzure(t *testing.T) {
720720
require.NoError(t, err)
721721
t.Cleanup(func() { _ = resp.Body.Close() })
722722
assert.Equal(t, http.StatusOK, resp.StatusCode)
723+
724+
assert.Contains(t, stdout, "> Tip:",
725+
"azure start should print a tip line like AWS does")
723726
}

0 commit comments

Comments
 (0)