Skip to content

Commit

Permalink
Merge branch 'main' into windows-fixes
Browse files Browse the repository at this point in the history
* main:
  chore(deps): bump minimal Go version from 1.21 to 1.22 (testcontainers#2743)
  chore(deps): bump github/codeql-action from 3.24.9 to 3.25.15 (testcontainers#2677)
  fix: use of log.Fatal in main (testcontainers#2739)
  chore: prepare for next minor development cycle (0.34.0)
  chore: use new version (v0.33.0) in modules and examples
  • Loading branch information
mdelapenya committed Aug 26, 2024
2 parents 72f2420 + 3682745 commit 63722a8
Show file tree
Hide file tree
Showing 69 changed files with 162 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Go",
"image": "mcr.microsoft.com/devcontainers/go:1.21-bookworm",
"image": "mcr.microsoft.com/devcontainers/go:1.22-bookworm",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
platform: [ubuntu-latest, macos-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -44,7 +44,7 @@ jobs:
name: "Test with reaper off"
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: ${{ matrix.go-version }}
Expand All @@ -61,7 +61,7 @@ jobs:
name: "Test with Rootless Docker"
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
platform: [ubuntu-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -76,7 +76,7 @@ jobs:
test-module-generator:
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -92,7 +92,7 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.21.x, 1.x]
go-version: [1.22.x, 1.x]
platform: [ubuntu-latest]
module: [artemis, azurite, cassandra, chroma, clickhouse, cockroachdb, compose, consul, couchbase, dolt, elasticsearch, gcloud, grafana-lgtm, inbucket, influxdb, k3s, k6, kafka, localstack, mariadb, milvus, minio, mockserver, mongodb, mssql, mysql, nats, neo4j, ollama, openfga, openldap, opensearch, postgres, pulsar, qdrant, rabbitmq, redis, redpanda, registry, surrealdb, valkey, vault, vearch, weaviate]
uses: ./.github/workflows/ci-test-go.yml
Expand All @@ -112,7 +112,7 @@ jobs:
module: [nginx, toxiproxy]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: "1.21.x"
go-version: "1.22.x"
fail-fast: true
platform: 'ubuntu-latest'
project-directory: examples/${{ matrix.module }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -67,7 +67,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -80,6 +80,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ jobs:

# required for Code scanning alerts
- name: "Upload SARIF results to code scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
with:
sarif_file: results.sarif
21 changes: 5 additions & 16 deletions docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,14 +737,10 @@ func TestContainerCreationWaitsForLog(t *testing.T) {
}

func Test_BuildContainerFromDockerfileWithBuildArgs(t *testing.T) {
t.Log("getting ctx")
ctx := context.Background()

t.Log("got ctx, creating container request")

// fromDockerfileWithBuildArgs {
ba := "build args value"

req := ContainerRequest{
FromDockerfile: FromDockerfile{
Context: filepath.Join(".", "testdata"),
Expand All @@ -770,23 +766,16 @@ func Test_BuildContainerFromDockerfileWithBuildArgs(t *testing.T) {
terminateContainerOnEnd(t, ctx, c)

ep, err := c.Endpoint(ctx, "http")
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)

resp, err := http.Get(ep + "/env")
if err != nil {
t.Fatal(err)
}
require.NoError(t, err)
defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
}

assert.Equal(t, 200, resp.StatusCode)
assert.Equal(t, ba, string(body))
require.NoError(t, err)
require.Equal(t, http.StatusAccepted, resp.StatusCode)
require.Equal(t, ba, string(body))
}

func Test_BuildContainerFromDockerfileWithBuildLog(t *testing.T) {
Expand Down
18 changes: 9 additions & 9 deletions docs/modules/grafana-lgtm.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Grafana LGTM

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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

## Introduction

Expand All @@ -24,7 +24,7 @@ go get github.com/testcontainers/testcontainers-go/modules/grafanalgtm

### Run function

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.
Expand All @@ -50,7 +50,7 @@ E.g. `Run(context.Background(), "grafana/otel-lgtm:0.6.0")`.

#### Admin Credentials

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

If you need to set different admin credentials in the Grafana LGTM container, you can set them using the `WithAdminCredentials(user, password)` option.

Expand All @@ -65,37 +65,37 @@ The Grafana LGTM container exposes the following methods:

#### Grafana Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `HttpEndpoint(ctx)` method returns the HTTP endpoint to connect to Grafana, using the default `3000` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

#### Loki Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `LokiEndpoint(ctx)` method returns the HTTP endpoint to connect to Loki, using the default `3100` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

#### Tempo Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `TempoEndpoint(ctx)` method returns the HTTP endpoint to connect to Tempo, using the default `3200` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

#### Otel HTTP Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `OtelHTTPEndpoint(ctx)` method returns the endpoint to connect to Otel using HTTP, using the default `4318` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

#### Otel gRPC Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `OtelGRPCEndpoint(ctx)` method returns the endpoint to connect to Otel using gRPC, using the default `4317` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

#### Prometheus Endpoint

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

The `PrometheusHttpEndpoint(ctx)` method returns the endpoint to connect to Prometheus, using the default `9090` port. The same method with the `Must` prefix returns just the endpoing, and panics if an error occurs.

Expand Down
10 changes: 8 additions & 2 deletions docs/modules/valkey.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Valkey

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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

## Introduction

Expand All @@ -24,7 +24,7 @@ go get github.com/testcontainers/testcontainers-go/modules/valkey

### Run function

- 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.33.0"><span class="tc-version">:material-tag: v0.33.0</span></a>

!!!info
The `RunContainer(ctx, opts...)` function is deprecated and will be removed in the next major release of _Testcontainers for Go_.
Expand Down Expand Up @@ -52,10 +52,14 @@ E.g. `Run(context.Background(), "valkey/valkey:7.2.5")`.

#### Snapshotting

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

By default Valkey saves snapshots of the dataset on disk, in a binary file called dump.rdb. You can configure Valkey to have it save the dataset every `N` seconds if there are at least `M` changes in the dataset. E.g. `WithSnapshotting(10, 1)`.

#### Log Level

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

You can easily set the valkey logging level. E.g. `WithLogLevel(LogLevelDebug)`.

#### Valkey configuration
Expand All @@ -68,6 +72,8 @@ The Valkey container exposes the following methods:

#### ConnectionString

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

This method returns the connection string to connect to the Valkey container, using the default `6379` port.

<!--codeinclude-->
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/aws_codebuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version: 0.2
phases:
install:
runtime-versions:
golang: 1.21
golang: 1.22
build:
commands:
- go test ./...
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/concourse_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
start_docker
cd repo
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock golang:1.21 go test ./...
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock golang:1.22 go test ./...
```
Finally, you can use Concourse's [fly CLI](https://concourse-ci.org/fly.html) to set the pipeline and trigger the job:
Expand Down
4 changes: 2 additions & 2 deletions docs/system_requirements/ci/dind_patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ tree .
└── platform
└── integration_test.go

$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock golang:1.21 go test ./... -v
$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock golang:1.22 go test ./... -v
```

Where:
Expand All @@ -45,7 +45,7 @@ The same can be achieved with Docker Compose:

```yaml
tests:
image: golang:1.21
image: golang:1.22
stop_signal: SIGKILL
stdin_open: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/gitlab_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variables:
DOCKER_DRIVER: overlay2
test:
image: golang:1.21
image: golang:1.22
stage: test
script: go test ./... -v
```
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/tekton.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: source
steps:
- name: read
image: golang:1.21
image: golang:1.22
workingDir: $(workspaces.source.path)
script: go test ./... -v
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/travis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ is the minimal required config.
language: go
go:
- 1.x
- "1.21"
- "1.22"

services:
- docker
Expand Down
4 changes: 2 additions & 2 deletions examples/nginx/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/testcontainers/testcontainers-go/examples/nginx

go 1.21
go 1.22

require github.com/testcontainers/testcontainers-go v0.32.0
require github.com/testcontainers/testcontainers-go v0.33.0

replace github.com/testcontainers/testcontainers-go => ../..

Expand Down
4 changes: 2 additions & 2 deletions examples/toxiproxy/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/testcontainers/testcontainers-go/examples/toxiproxy

go 1.21
go 1.22

require (
github.com/Shopify/toxiproxy/v2 v2.8.0
github.com/go-redis/redis/v8 v8.11.5
github.com/google/uuid v1.6.0
github.com/testcontainers/testcontainers-go v0.32.0
github.com/testcontainers/testcontainers-go v0.33.0
)

require (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/testcontainers/testcontainers-go

go 1.21
go 1.22

require (
dario.cat/mergo v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package internal

// Version is the next development version of the application
const Version = "0.33.0"
const Version = "0.34.0"
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ nav:
- Getting help: getting_help.md
edit_uri: edit/main/docs/
extra:
latest_version: v0.32.0
latest_version: v0.33.0
Loading

0 comments on commit 63722a8

Please sign in to comment.