|
5 | 5 | "context" |
6 | 6 | "errors" |
7 | 7 | "io" |
8 | | - "strings" |
9 | 8 | "testing" |
10 | 9 |
|
11 | 10 | "github.com/localstack/lstk/internal/log" |
@@ -54,37 +53,3 @@ func TestEmitPostStartPointers_WithoutWebApp(t *testing.T) { |
54 | 53 | assert.Contains(t, got, "> Tip:") |
55 | 54 | } |
56 | 55 |
|
57 | | -func TestServicePortRange_ReturnsExpectedPorts(t *testing.T) { |
58 | | - ports := servicePortRange() |
59 | | - |
60 | | - require.Len(t, ports, 51) |
61 | | - assert.Equal(t, "443", ports[0].ContainerPort) |
62 | | - assert.Equal(t, "443", ports[0].HostPort) |
63 | | - assert.Equal(t, "4510", ports[1].ContainerPort) |
64 | | - assert.Equal(t, "4510", ports[1].HostPort) |
65 | | - assert.Equal(t, "4559", ports[50].ContainerPort) |
66 | | - assert.Equal(t, "4559", ports[50].HostPort) |
67 | | -} |
68 | | - |
69 | | -func TestFilterHostEnv(t *testing.T) { |
70 | | - tests := []struct { |
71 | | - name string |
72 | | - env string |
73 | | - expected bool |
74 | | - }{ |
75 | | - {"CI is included", "CI=true", true}, |
76 | | - {"LOCALSTACK_DISABLE_EVENTS is included", "LOCALSTACK_DISABLE_EVENTS=1", true}, |
77 | | - {"LOCALSTACK_HOST is included", "LOCALSTACK_HOST=0.0.0.0", true}, |
78 | | - {"LOCALSTACK_AUTH_TOKEN is excluded", "LOCALSTACK_AUTH_TOKEN=secret", false}, |
79 | | - {"PATH is excluded", "PATH=/usr/bin", false}, |
80 | | - {"HOME is excluded", "HOME=/root", false}, |
81 | | - {"LOCALSTACK_BUILD_VERSION is included", "LOCALSTACK_BUILD_VERSION=3.0.0", true}, |
82 | | - } |
83 | | - |
84 | | - for _, tt := range tests { |
85 | | - t.Run(tt.name, func(t *testing.T) { |
86 | | - got := strings.HasPrefix(tt.env, "CI=") || (strings.HasPrefix(tt.env, "LOCALSTACK_") && !strings.HasPrefix(tt.env, "LOCALSTACK_AUTH_TOKEN=")) |
87 | | - assert.Equal(t, tt.expected, got) |
88 | | - }) |
89 | | - } |
90 | | -} |
0 commit comments