Skip to content

Commit

Permalink
Merge branch 'main' into v1
Browse files Browse the repository at this point in the history
* main:
  fix: log output after context timeout (#2643)
  chore(deps): use "github.com/containerd/platforms" instead (#2638)
  chore(deps): bump google.golang.org/grpc to 1.64.1 (#2635)
  chore(deps): bump certifi from 2024.2.2 to 2024.7.4 (#2631)
  chore: prepare for next minor development cycle (0.33.0)
  chore: use new version (v0.32.0) in modules and examples
  feat: honour go toolchain's verbose flag to print out logs (#2624)
  Fix issues in BuildImage() (#2626)
  docs: indicate version for the Run function (#2627)
  chore: remove duplicated tests for config (#2628)
  Log retried errors (#2613)
  • Loading branch information
mdelapenya committed Jul 15, 2024
2 parents 628eb0c + eb22239 commit d492f55
Show file tree
Hide file tree
Showing 153 changed files with 1,816 additions and 1,729 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tidy-all:
$(MAKE) -C examples tidy-examples
$(MAKE) -C modules tidy-modules

## -------------------------------------
## --------------------------------------

TCENV=tcvenv
PYTHONBIN=./$(TCENV)/bin
Expand Down
7 changes: 4 additions & 3 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"

"github.com/cenkalti/backoff/v4"
"github.com/containerd/containerd/platforms"
"github.com/containerd/platforms"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
Expand Down
7 changes: 7 additions & 0 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,3 +786,10 @@ func (c *DockerContainer) terminatedHook(ctx context.Context) error {
return lifecycleHooks.PostTerminates
})
}

func tryClose(r io.Reader) {

Check failure on line 790 in docker.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest) / ./ubuntu-latest/1.21.x

func `tryClose` is unused (unused)

Check failure on line 790 in docker.go

View workflow job for this annotation

GitHub Actions / Test with reaper off (1.21.x) / ./ubuntu-latest/1.21.x

func `tryClose` is unused (unused)

Check failure on line 790 in docker.go

View workflow job for this annotation

GitHub Actions / Test with reaper off (1.x) / ./ubuntu-latest/1.x

func `tryClose` is unused (unused)

Check failure on line 790 in docker.go

View workflow job for this annotation

GitHub Actions / Test with Rootless Docker (1.21.x, ubuntu-latest) / ./ubuntu-latest/1.21.x

func `tryClose` is unused (unused)

Check failure on line 790 in docker.go

View workflow job for this annotation

GitHub Actions / Test with Rootless Docker (1.x, ubuntu-latest) / ./ubuntu-latest/1.x

func `tryClose` is unused (unused)
rc, ok := r.(io.Closer)
if ok {
_ = rc.Close()
}
}
9 changes: 8 additions & 1 deletion docs/modules/artemis.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ go get github.com/testcontainers/testcontainers-go/modules/artemis
[Connecting to an Artemis container](../../modules/artemis/examples_test.go) inside_block:connectToArtemisContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Artemis module exposes one entrypoint function to create the Artemis container, and this function receives three parameters:

Expand Down
17 changes: 12 additions & 5 deletions docs/modules/azurite.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Azurite

Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

## Introduction

Expand All @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/azurite
[Creating a Azurite container](../../modules/azurite/examples_test.go) inside_block:runAzuriteContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Azurite module exposes one entrypoint function to create the Azurite container, and this function receives three parameters:

Expand Down Expand Up @@ -53,7 +60,7 @@ E.g. `Run(context.Background(), "mcr.microsoft.com/azure-storage/azurite:3.28.0"

#### WithInMemoryPersistence

- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

If you want to use in-memory persistence, you can use `WithInMemoryPersistence(megabytes float64)`. E.g. `azurite.WithInMemoryPersistence(64.0)`.

Expand All @@ -68,13 +75,13 @@ The Azurite container exposes the following methods:

#### ServiceURL

- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

Returns the service URL to connect to the Azurite container and an error, passing the Go context and the service name as parameters.

#### MustServiceURL

- Not available until the next release of testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go"><span class="tc-version">:material-tag: main</span></a>
- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

Returns the service URL to connect to the Azurite container, passing the Go context and the service name as parameters. If an error occurs, it will panic.

Expand Down
9 changes: 8 additions & 1 deletion docs/modules/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/cassandra
[Creating a Cassandra container](../../modules/cassandra/examples_test.go) inside_block:runCassandraContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Cassandra module exposes one entrypoint function to create the Cassandra container, and this function receives three parameters:

Expand Down
9 changes: 8 additions & 1 deletion docs/modules/chroma.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ go get github.com/testcontainers/testcontainers-go/modules/chroma
[Creating a Chroma container](../../modules/chroma/examples_test.go) inside_block:runChromaContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Chroma module exposes one entrypoint function to create the Chroma container, and this function receives three parameters:

Expand Down
9 changes: 8 additions & 1 deletion docs/modules/clickhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/clickhouse
[Test for a ClickHouse container](../../modules/clickhouse/examples_test.go) inside_block:runClickHouseContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The ClickHouse module exposes one entrypoint function to create the ClickHouse container, and this function receives three parameters:

Expand Down
15 changes: 11 additions & 4 deletions docs/modules/cockroachdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/cockroachdb
[Creating a CockroachDB container](../../modules/cockroachdb/examples_test.go) inside_block:runCockroachDBContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The CockroachDB module exposes one entrypoint function to create the CockroachDB container, and this function receives three parameters:

Expand All @@ -32,9 +39,6 @@ func Run(ctx context.Context, img string, opts ...testcontainers.RequestCustomiz
- `string`, the Docker image to use.
- `testcontainers.RequestCustomizer`, a variadic argument for passing options.

!!!warning
When TLS is enabled there's a very small, unlikely chance that the underlying driver can panic when registering the driver as part of waiting for CockroachDB to be ready to accept connections. If this is repeatedly happening please open an issue.

### Container Options

When starting the CockroachDB container, you can pass options in a variadic way to configure it.
Expand Down Expand Up @@ -65,6 +69,9 @@ Internally CockroachDB requires a client certificate for the user to connect wit

A helper `cockroachdb.NewTLSConfig` exists to generate all of this for you.

!!!warning
When TLS is enabled there's a very small, unlikely chance that the underlying driver can panic when registering the driver as part of waiting for CockroachDB to be ready to accept connections. If this is repeatedly happening please open an issue.
### Container Methods
The CockroachDB container exposes the following methods:
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/consul.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/consul
[Creating a Consul container](../../modules/consul/examples_test.go) inside_block:runConsulContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Consul module exposes one entrypoint function to create the Consul container, and this function receives three parameters:

Expand Down
7 changes: 7 additions & 0 deletions docs/modules/couchbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ go get github.com/testcontainers/testcontainers-go/modules/couchbase

## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Couchbase module exposes one entrypoint function to create the Couchbase container, and this function receives three parameters:

```golang
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/dolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/dolt
[Creating a Dolt container](../../modules/dolt/examples_test.go) inside_block:runDoltContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Dolt module exposes one entrypoint function to create the Dolt container, and this function receives three parameters:

Expand Down
9 changes: 8 additions & 1 deletion docs/modules/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/elasticsearch
[Creating a Elasticsearch container](../../modules/elasticsearch/examples_test.go) inside_block:runElasticsearchContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Elasticsearch module exposes one entrypoint function to create the Elasticsearch container, and this function receives three parameters:

Expand Down
28 changes: 18 additions & 10 deletions docs/modules/gcloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ It's important to set the `option.WithEndpoint()` option using the container's U
[Obtaining a Firestore client](../../modules/gcloud/firestore_test.go) inside_block:firestoreClient
<!--/codeinclude-->

It's important to set the target string of the `grpc.Dial` method using the container's URI, as shown in the client example above.
It's important to set the target string of the `grpc.NewClient` method using the container's URI, as shown in the client example above.

### Pubsub

Expand All @@ -63,7 +63,7 @@ It's important to set the target string of the `grpc.Dial` method using the cont
[Obtaining a Pubsub client](../../modules/gcloud/pubsub_test.go) inside_block:pubsubClient
<!--/codeinclude-->

It's important to set the target string of the `grpc.Dial` method using the container's URI, as shown in the client example above.
It's important to set the target string of the `grpc.NewClient` method using the container's URI, as shown in the client example above.

### Spanner

Expand All @@ -75,20 +75,28 @@ It's important to set the target string of the `grpc.Dial` method using the cont

It's important to set the `option.WithEndpoint()` option using the container's URI, as shown in the Admin client example above.

## Module reference
## Module Reference

The GCloud module exposes one entrypoint function to create the different GCloud emulators, and each function receives two parameters:
### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunXXXContainer(ctx, opts...)` functions are deprecated and will be removed in the next major release of _Testcontainers for Go_.

The GCloud module exposes one entrypoint function to create the different GCloud emulators, and each function receives three parameters:

```golang
func RunBigQueryContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*BigQueryContainer, error)
func RunBigTableContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*BigTableContainer, error)
func RunDatastoreContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*DatastoreContainer, error)
func RunFirestoreContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*FirestoreContainer, error)
func RunPubsubContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*PubsubContainer, error)
func RunSpannerContainer(ctx context.Context, opts ...testcontainers.RequestCustomizer) (*SpannerContainer, error)
func RunBigQuery(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*BigQueryContainer, error)
func RunBigTable(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*BigTableContainer, error)
func RunDatastore(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*DatastoreContainer, error)
func RunFirestore(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*FirestoreContainer, error)
func RunPubsub(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*PubsubContainer, error)
func RunSpanner(ctx context.Context, img string, opts ...testcontainers.RequestCustomizer) (*SpannerContainer, error)
```

- `context.Context`, the Go context.
- `string`, the Docker image to use.
- `testcontainers.RequestCustomizer`, a variadic argument for passing options.

### Container Options
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/inbucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/inbucket
[Creating a Inbucket container](../../modules/inbucket/examples_test.go) inside_block:runInbucketContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Inbucket module exposes one entrypoint function to create the Inbucket container, and this function receives three parameters:

Expand Down
7 changes: 7 additions & 0 deletions docs/modules/influxdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ go get github.com/testcontainers/testcontainers-go/modules/influxdb

## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The InfluxDB module exposes one entrypoint function to create the container, and this function receives three parameters:

```golang
Expand Down
10 changes: 8 additions & 2 deletions docs/modules/k3s.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/k3s
[Test for a K3s container](../../modules/k3s/k3s_test.go) inside_block:runK3sContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The K3s module exposes one entrypoint function to create the K3s container, and this function receives three parameters:

Expand All @@ -32,7 +39,6 @@ func Run(ctx context.Context, img string, opts ...testcontainers.RequestCustomiz
- `string`, the Docker image to use.
- `testcontainers.RequestCustomizer`, a variadic argument for passing options.


### Container Ports
These are the ports used by the K3s container:
<!--codeinclude-->
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/k6.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ go get github.com/testcontainers/testcontainers-go/modules/k6
[Creating a K6 container](../../modules/k6/examples_test.go) inside_block:runK6Container
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The K6 module exposes one entrypoint function to run the K6 container, and this function receives three parameters:

Expand Down
9 changes: 8 additions & 1 deletion docs/modules/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ go get github.com/testcontainers/testcontainers-go/modules/kafka
[Creating a Kafka container](../../modules/kafka/examples_test.go) inside_block:runKafkaContainer
<!--/codeinclude-->

## Module reference
## Module Reference

### Run function

- Since testcontainers-go <a href="https://github.com/testcontainers/testcontainers-go/releases/tag/v0.32.0"><span class="tc-version">:material-tag: v0.32.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.

The Kafka module exposes one entrypoint function to create the Kafka container, and this function receives three parameters:

Expand Down
Loading

0 comments on commit d492f55

Please sign in to comment.