Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/modules/compose/all-fb…
Browse files Browse the repository at this point in the history
…0eb3ffe7
  • Loading branch information
mdelapenya committed Aug 14, 2023
2 parents c32b05d + e39e2a0 commit 3866c86
Show file tree
Hide file tree
Showing 43 changed files with 200 additions and 62 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:0-1.19-bullseye",
"image": "mcr.microsoft.com/devcontainers/go:0-1.20-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.x
go-version-file: go.mod
id: go

- name: modVerify
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -38,7 +38,7 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: ${{ matrix.go-version }}
Expand All @@ -55,7 +55,7 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -69,7 +69,7 @@ jobs:
test-module-generator:
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
Expand All @@ -84,12 +84,9 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
module: [artemis, clickhouse, compose, couchbase, k3s, localstack, mongodb, mysql, neo4j, postgres, pulsar, redis, redpanda, vault]
exclude:
- module: compose
go-version: 1.19.x
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: ${{ matrix.go-version }}
Expand All @@ -103,7 +100,7 @@ jobs:
needs: test-modules
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
module: [bigtable, cockroachdb, consul, datastore, firestore, nats, nginx, pubsub, spanner, toxiproxy]
uses: ./.github/workflows/ci-test-go.yml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/checkout@v3
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.50
version: v1.54.1

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ linters-settings:
- prefix(github.com/testcontainters)

run:
timeout: 3m
timeout: 5m
2 changes: 1 addition & 1 deletion docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ func terminateContainerOnEnd(tb testing.TB, ctx context.Context, ctr Container)
}

func randomString() string {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))
chars := []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
"abcdefghijklmnopqrstuvwxyz" +
"0123456789")
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/bitbucket_pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In some cases the memory available to Docker needs to be increased.
Here is a sample Bitbucket Pipeline configuration that does a checkout of a project and runs Go tests:

```yml
image: golang:1.19
image: golang:1.x

pipelines:
default:
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/circle_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
machine: true
image: ubuntu-2204:2023.04.2
steps:
# install Go 1.19
# install Go 1.x
# checkout the project
- run: 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.19 go test ./...
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock golang:1.20 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.19 go test ./... -v
$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock golang:1.20 go test ./... -v
```

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

```yaml
tests:
image: golang:1.19
image: golang:1.20
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.19
image: golang:1.20
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.19
image: golang:1.20
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.19"
- "1.20"

services:
- docker
Expand Down
15 changes: 15 additions & 0 deletions docs/system_requirements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ From the [Go Release Policy](https://go.dev/doc/devel/release#policy):
> Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. We fix critical problems, including critical security problems, in supported releases as needed by issuing minor revisions (for example, Go 1.6.1, Go 1.6.2, and so on).
_Testcontainers for Go_ is tested against those two latest Go releases, therefore we recommend using any of them. You could check what versions are actually supported by looking at the [GitHub Action](https://github.com/testcontainers/testcontainers-go/blob/main/.github/workflows/ci.yml) configuration, under the `test.strategy.matrix.go-version` key.

## Updating the Go version

The project has a script to update the Go version used in the project. To update the Go version across all files, please run the following command:

```bash
DRY_RUN=false ./scripts/bump-go.sh 1.21
```

It will update:
- all `go.mod` files.
- all Github Actions workflows, and their matrices using the `go-version` strategy.
- the templates for the module generator.
- the Devcontainer configuration.
- the tag of the Go Docker image in the markdown documentation.
2 changes: 1 addition & 1 deletion examples/bigtable/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/testcontainers/testcontainers-go/examples/bigtable

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

require github.com/testcontainers/testcontainers-go v0.22.0

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

go 1.19
go 1.20

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

go 1.19
go 1.20

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

go 1.19
go 1.20

require (
github.com/Shopify/toxiproxy/v2 v2.5.0
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.19
go 1.20

require (
dario.cat/mergo v1.0.0
Expand Down
21 changes: 12 additions & 9 deletions modulegen/_template/ci.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: {{ "${{ matrix.go-version }}" }}
platform: {{ "${{ matrix.platform }}" }}
project-directory: "."
rootless-docker: false
run-tests: {{ "${{ matrix.platform == 'ubuntu-latest' }}" }}
ryuk-disabled: false

# The job below is a copy of the job above, but with ryuk disabled.
Expand All @@ -37,13 +38,14 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: {{ "${{ matrix.go-version }}" }}
platform: "ubuntu-latest"
project-directory: "."
rootless-docker: false
run-tests: true
ryuk-disabled: true

# The job below is a copy of the job above, but with Docker rootless.
Expand All @@ -53,52 +55,52 @@ jobs:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: {{ "${{ matrix.go-version }}" }}
platform: "ubuntu-latest"
project-directory: "."
rootless-docker: true
run-tests: true
ryuk-disabled: false

test-module-generator:
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: {{ "${{ matrix.go-version }}" }}
platform: {{ "${{ matrix.platform }}" }}
project-directory: "modulegen"
rootless-docker: false
run-tests: true
ryuk-disabled: false

test-modules:
needs: test
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
module: [{{ .Modules }}]
exclude:
- module: compose
go-version: 1.19.x
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: {{ "${{ matrix.go-version }}" }}
platform: {{ "${{ matrix.platform }}" }}
project-directory: {{ "modules/${{ matrix.module }}" }}
rootless-docker: false
run-tests: {{ "${{ matrix.platform == 'ubuntu-latest' }}" }}
ryuk-disabled: false

test-examples:
needs: test-modules
strategy:
matrix:
go-version: [1.19.x, 1.x]
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
module: [{{ .Examples }}]
uses: ./.github/workflows/ci-test-go.yml
Expand All @@ -107,4 +109,5 @@ jobs:
platform: {{ "${{ matrix.platform }}" }}
project-directory: {{ "examples/${{ matrix.module }}" }}
rootless-docker: false
run-tests: {{ "${{ matrix.platform == 'ubuntu-latest' }}" }}
ryuk-disabled: false
2 changes: 1 addition & 1 deletion modulegen/_template/go.mod.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $lower := ToLower }}module github.com/testcontainers/testcontainers-go/{{ ParentDir }}/{{ $lower }}

go 1.19
go 1.20

require (
github.com/testcontainers/testcontainers-go {{ .TCVersion }}
Expand Down

0 comments on commit 3866c86

Please sign in to comment.