Skip to content

Commit e9f76a2

Browse files
committed
Merge branch 'main' into jmaguire/add-reuse-and-container-name-options
* main: feat(postgres): add WithOrderedInitScripts for Postgres testcontainers (testcontainers#3121) feat(redis): add TLS support (testcontainers#3115) feat: add Docker Model Runner module (testcontainers#3106) feat: add toxiproxy module (testcontainers#3092) chore(ci): run core tests on Testcontainers Cloud (testcontainers#3117) deps(aerospike): replace core module in go.mod (testcontainers#3116) chore(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in /modules and /examples (testcontainers#3114) chore(ci): revert codeql improvements for CI resiliency (testcontainers#3112) docs(socat): add missing version marker for new options (testcontainers#3111)
2 parents 37e1d08 + 66401ba commit e9f76a2

161 files changed

Lines changed: 3258 additions & 646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ updates:
1414
directories:
1515
- /
1616
- /examples/nginx
17-
- /examples/toxiproxy
1817
- /modulegen
1918
- /modules/aerospike
2019
- /modules/arangodb
@@ -30,6 +29,7 @@ updates:
3029
- /modules/couchbase
3130
- /modules/databend
3231
- /modules/dind
32+
- /modules/dockermodelrunner
3333
- /modules/dolt
3434
- /modules/dynamodb
3535
- /modules/elasticsearch
@@ -67,6 +67,7 @@ updates:
6767
- /modules/scylladb
6868
- /modules/socat
6969
- /modules/surrealdb
70+
- /modules/toxiproxy
7071
- /modules/valkey
7172
- /modules/vault
7273
- /modules/vearch

.github/workflows/ci-lint-go.yml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,49 +51,3 @@ jobs:
5151
run: |
5252
make tidy
5353
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
54-
55-
# For most projects, this workflow file will not need changing; you simply need
56-
# to commit it to your repository.
57-
#
58-
# You may wish to alter this file to override the set of languages analyzed,
59-
# or to provide custom queries or build logic.
60-
#
61-
# ******** NOTE ********
62-
# We have attempted to detect the languages in your repository. Please check
63-
# the `language` matrix defined below to confirm you have the correct set of
64-
# supported CodeQL languages.
65-
#
66-
# Initializes the CodeQL tools for scanning.
67-
- name: Initialize CodeQL
68-
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
69-
with:
70-
languages: go
71-
# If you wish to specify custom queries, you can do so here or in a config file.
72-
# By default, queries listed here will override any specified in a config file.
73-
# Prefix the list here with "+" to use these queries and those in the config file.
74-
75-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
76-
# queries: security-extended,security-and-quality
77-
78-
79-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
80-
# If this step fails, then you should remove it and run the build manually (see below)
81-
- name: Autobuild
82-
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
83-
with:
84-
working-directory: "${{ inputs.project-directory }}"
85-
86-
# ℹ️ Command-line programs to run using the OS shell.
87-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
88-
89-
# If the Autobuild fails above, remove it and uncomment the following three lines.
90-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
91-
92-
# - run: |
93-
# echo "Run, Build Application using script"
94-
# ./location_of_script_within_repo/buildscript.sh
95-
96-
- name: Perform CodeQL Analysis
97-
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
98-
with:
99-
category: "/language:go"

.github/workflows/ci-test-go.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
type: string
1919
default: "."
2020
description: "The directory where the Go project is located."
21+
testcontainers-cloud:
22+
required: false
23+
type: boolean
24+
default: false
25+
description: "Run the tests on Testcontainers Cloud"
2126
rootless-docker:
2227
required: false
2328
type: boolean
@@ -81,6 +86,13 @@ jobs:
8186
echo "No dependencies script found at $SCRIPT_PATH - skipping installation"
8287
fi
8388
89+
# Setup Testcontainers Cloud Client right before your Testcontainers tests
90+
- name: Setup Testcontainers Cloud Client
91+
if: ${{ inputs.testcontainers-cloud }}
92+
uses: atomicjar/testcontainers-cloud-setup-action@c335bdbb570ec7c48f72c7d450c077f0a002293e # v1.3
93+
with:
94+
token: ${{ secrets.TCC_TOKEN }}
95+
8496
- name: go test
8597
working-directory: ./${{ inputs.project-directory }}
8698
timeout-minutes: 30
@@ -90,6 +102,13 @@ jobs:
90102
run: |
91103
./scripts/check_environment.sh
92104
105+
# (Optionally) When you don't need Testcontainers Cloud anymore, you could terminate sessions eagerly
106+
- name: Terminate Testcontainers Cloud Client active sessions
107+
if: ${{ inputs.testcontainers-cloud }}
108+
uses: atomicjar/testcontainers-cloud-setup-action@c335bdbb570ec7c48f72c7d450c077f0a002293e # v1.3
109+
with:
110+
action: terminate
111+
93112
- name: Test Summary
94113
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
95114
with:

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,31 @@ jobs:
7171
go-version: ${{ matrix.go-version }}
7272
platforms: ${{ matrix.module == 'modulegen' && '["ubuntu-latest", "macos-latest", "windows-latest"]' || '["ubuntu-latest"]' }}
7373
project-directory: "${{ matrix.module }}"
74+
testcontainers-cloud: false
7475
rootless-docker: false
7576
ryuk-disabled: false
7677
secrets: inherit
7778

79+
# The job below is a copy of the job above, but using Docker Cloud.
80+
test-testcontainers-cloud:
81+
# the core module is identified by the empty string (the root path)
82+
if: ${{ contains(fromJSON(needs.detect-modules.outputs.modules), '') }}
83+
needs:
84+
- detect-modules
85+
- lint
86+
name: "Test using Testcontainers Cloud"
87+
strategy:
88+
matrix:
89+
go-version: [1.23.x, 1.24.x]
90+
uses: ./.github/workflows/ci-test-go.yml
91+
with:
92+
go-version: ${{ matrix.go-version }}
93+
platforms: '["ubuntu-latest"]'
94+
project-directory: "."
95+
testcontainers-cloud: true
96+
rootless-docker: false
97+
ryuk-disabled: false
98+
7899
# The job below is a copy of the job above, but with ryuk disabled.
79100
# It's executed in the first stage to avoid concurrency issues.
80101
test-reaper-off:
@@ -92,6 +113,7 @@ jobs:
92113
go-version: ${{ matrix.go-version }}
93114
platforms: '["ubuntu-latest"]'
94115
project-directory: "."
116+
testcontainers-cloud: false
95117
rootless-docker: false
96118
ryuk-disabled: true
97119

@@ -112,6 +134,7 @@ jobs:
112134
go-version: ${{ matrix.go-version }}
113135
platforms: '["ubuntu-latest"]'
114136
project-directory: "."
137+
testcontainers-cloud: false
115138
rootless-docker: true
116139
ryuk-disabled: false
117140

.github/workflows/codeql.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '40 6 * * 5'
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
# Runner size impacts CodeQL analysis time. To learn more, please see:
30+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
31+
# - https://gh.io/supported-runners-and-hardware-resources
32+
# - https://gh.io/using-larger-runners
33+
# Consider using larger runners for possible analysis time improvements.
34+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
35+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
36+
permissions:
37+
actions: read
38+
contents: read
39+
security-events: write
40+
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
language: [ 'go' ]
45+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
46+
# Use only 'java' to analyze code written in Java, Kotlin or both
47+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
48+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
54+
# Initializes the CodeQL tools for scanning.
55+
- name: Initialize CodeQL
56+
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
57+
with:
58+
languages: ${{ matrix.language }}
59+
# If you wish to specify custom queries, you can do so here or in a config file.
60+
# By default, queries listed here will override any specified in a config file.
61+
# Prefix the list here with "+" to use these queries and those in the config file.
62+
63+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
64+
# queries: security-extended,security-and-quality
65+
66+
67+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
68+
# If this step fails, then you should remove it and run the build manually (see below)
69+
- name: Autobuild
70+
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
71+
72+
# ℹ️ Command-line programs to run using the OS shell.
73+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
74+
75+
# If the Autobuild fails above, remove it and uncomment the following three lines.
76+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
77+
78+
# - run: |
79+
# echo "Run, Build Application using script"
80+
# ./location_of_script_within_repo/buildscript.sh
81+
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
84+
with:
85+
category: "/language:${{matrix.language}}"

.vscode/.testcontainers-go.code-workspace

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"path": "../examples/nginx"
1111
},
1212
{
13-
"name": "example / toxiproxy",
14-
"path": "../examples/toxiproxy"
13+
"name": "module / aerospike",
14+
"path": "../modules/aerospike"
1515
},
1616
{
1717
"name": "module / arangodb",
@@ -65,6 +65,10 @@
6565
"name": "module / dind",
6666
"path": "../modules/dind"
6767
},
68+
{
69+
"name": "module / dockermodelrunner",
70+
"path": "../modules/dockermodelrunner"
71+
},
6872
{
6973
"name": "module / dolt",
7074
"path": "../modules/dolt"
@@ -213,6 +217,10 @@
213217
"name": "module / surrealdb",
214218
"path": "../modules/surrealdb"
215219
},
220+
{
221+
"name": "module / toxiproxy",
222+
"path": "../modules/toxiproxy"
223+
},
216224
{
217225
"name": "module / valkey",
218226
"path": "../modules/valkey"

docs/examples/toxiproxy.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)