MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newMinioInstance

Function newMinioInstance

pkg/blobmanager/s3/backend_test.go:341–365  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

339}
340
341func newMinioInstance(t *testing.T) *minioInstance {
342 ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
343 defer cancel()
344
345 const port = "9000/tcp"
346
347 req := testcontainers.ContainerRequest{
348 Image: "minio/minio:RELEASE.2023-09-04T19-57-37Z",
349 ExposedPorts: []string{port},
350 Env: map[string]string{
351 "MINIO_ROOT_USER": "root",
352 "MINIO_ROOT_PASSWORD": "test-password",
353 },
354 Cmd: []string{"server", "/data"},
355 WaitingFor: wait.ForListeningPort(port).WithStartupTimeout(5 * time.Minute),
356 }
357
358 instance, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
359 ContainerRequest: req,
360 Started: true,
361 })
362 require.NoError(t, err)
363
364 return &minioInstance{instance}
365}
366
367func (c *minioInstance) ConnectionString(t *testing.T) string {
368 ctx, cancel := context.WithTimeout(context.Background(), time.Minute)

Callers 1

SetupTestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected