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

Function assertContainerResources

integration/docker_test.go:933–944  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, name string, expectedCPUs, expectedMemory int64)

Source from the content-addressed store, hash-verified

931}
932
933func assertContainerResources(t *testing.T, ctx context.Context, name string, expectedCPUs, expectedMemory int64) {
934 t.Helper()
935 c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
936 require.NoError(t, err)
937 defer c.Close()
938
939 info, err := c.ContainerInspect(ctx, name)
940 require.NoError(t, err)
941
942 assert.Equal(t, expectedCPUs, info.HostConfig.NanoCPUs)
943 assert.Equal(t, expectedMemory, info.HostConfig.Memory)
944}
945
946func assertContainerLogConfig(t *testing.T, ctx context.Context, name string) {
947 t.Helper()

Callers 2

TestDeployWithSettingsFunction · 0.85
TestContainerResourcesFunction · 0.85

Calls 3

EqualMethod · 0.80
ContainerInspectMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…