MCPcopy
hub / github.com/basecamp/once / TestLongAppName

Function TestLongAppName

integration/docker_test.go:248–275  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

246}
247
248func TestLongAppName(t *testing.T) {
249 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
250 defer cancel()
251
252 // Container names can be very long since we use container IDs for proxy targeting.
253 // This test verifies that long app names work correctly.
254 longName := strings.Repeat("x", 200)
255
256 ns, err := docker.NewNamespace("once-long-name-test")
257 require.NoError(t, err)
258 defer ns.Teardown(ctx, true)
259
260 require.NoError(t, ns.EnsureNetwork(ctx))
261 require.NoError(t, ns.Proxy().Boot(ctx, getProxyPorts(t)))
262
263 deployApp(t, ctx, ns, docker.ApplicationSettings{
264 Name: longName,
265 Image: "ghcr.io/basecamp/once-campfire:main",
266 Host: "longname.localhost",
267 })
268
269 ns2, err := docker.RestoreNamespace(ctx, "once-long-name-test")
270 require.NoError(t, err)
271
272 restoredApp := ns2.Application(longName)
273 require.NotNil(t, restoredApp)
274 assert.Equal(t, longName, restoredApp.Settings.Name)
275}
276
277func TestContainerLogConfig(t *testing.T) {
278 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)

Callers

nothing calls this directly

Calls 10

TeardownMethod · 0.95
EnsureNetworkMethod · 0.95
ProxyMethod · 0.95
NewNamespaceFunction · 0.92
RestoreNamespaceFunction · 0.92
getProxyPortsFunction · 0.85
deployAppFunction · 0.85
BootMethod · 0.80
ApplicationMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…