Skip to content

Conversation

@mdelapenya
Copy link
Member

  • chore: initial toxiproxy module
  • chore: add examples and tests for toxiproxy
  • docs: update container types in code examples
  • docs: add examples
  • docs: document exposed variables

What does this PR do?

This PR converts the existing example into a tc-go module.

It adds a functional option to modify the number of exposed ports in the range used by toxiproxy to add proxies.

This PR, intentionally, does not couple the implementation of the module with any toxiproxy Go client. On the other hand,
it uses github.com/Shopify/toxiproxy/v2 for the tests and examples.

Finally, it removes the existing example module, converting that code into the testable examples of the new module.

Why is it important?

More modules!

@mdelapenya mdelapenya requested a review from a team as a code owner April 8, 2025 14:50
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Apr 8, 2025
@mdelapenya mdelapenya self-assigned this Apr 8, 2025
@netlify
Copy link

netlify bot commented Apr 8, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 32fce99
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6808ceaddd702700088f83c0
😎 Deploy Preview https://deploy-preview-3092--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya requested a review from eddumelendez April 10, 2025 16:03
@mdelapenya
Copy link
Member Author

@eddumelendez I added the ability to add proxies and generate the config on the fly. Could you PTAL?

* main:
  security(compose): upgrade github.com/docker/compose/v2 to fix security vulnerability (testcontainers#3095)
  feat: add more functional options to the modules API (testcontainers#3070)
* main:
  chore(deps): bump golang.org/x/crypto in /modules/aerospike (testcontainers#3105)
  chore(ci): run codeql on the modified modules (testcontainers#3103)
  docs: fix reference to container types in Run function (testcontainers#3102)
  chore(deps): bump github.com/golang-jwt/jwt/v5 in /modules/pulsar (testcontainers#3101)
  chore(pulsar): bump github.com/apache/pulsar-client-go from 0.10.0 to 0.14.0 (testcontainers#3100)
  chore(clickhouse): bump github.com/ClickHouse/clickhouse-go/v2 from 2.20.0 to 2.34.0 in /modules/clickhouse (testcontainers#3099)
  chore(deps): bump github/codeql-action from 3.28.13 to 3.28.15 (testcontainers#3097)
  chore(deps): bump golang.org/x/crypto from 0.31.0 to 0.37.0 (testcontainers#3098)
  feat(aerospike): add Aerospike module (testcontainers#3094)
@mdelapenya mdelapenya requested a review from eddumelendez April 15, 2025 11:26
eddumelendez
eddumelendez previously approved these changes Apr 17, 2025
Copy link
Contributor

@stevenh stevenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick pass with some idiomatic go suggestions.

@mdelapenya
Copy link
Member Author

@stevenh comments addressed. Thank you for your thorough review 🙇

* main:
  chore(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in /modules and /examples (testcontainers#3114)
@mdelapenya
Copy link
Member Author

I'm merging this. Let's open an issue if we have last minute questions on it, thanks!

@mdelapenya mdelapenya merged commit 6a4ef08 into testcontainers:main Apr 23, 2025
16 checks passed
@mdelapenya mdelapenya deleted the toxyproxy-module branch April 23, 2025 12:04
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Apr 23, 2025
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Apr 23, 2025
* main:
  feat: add toxiproxy module (testcontainers#3092)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Apr 23, 2025
* main:
  feat: add toxiproxy module (testcontainers#3092)
  chore(ci): run core tests on Testcontainers Cloud (testcontainers#3117)
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Apr 24, 2025
* main:
  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)
mdelapenya added a commit to xBlaz3kx/testcontainers-go that referenced this pull request Apr 24, 2025
* 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)
  deps: use pinned dependencies on GH actions (testcontainers#3110)
  chore(deps): bump jinja2 from 3.1.5 to 3.1.6 (testcontainers#3109)
  chore(ci): reduce GH runners usage by calling codeql in the lint stage (testcontainers#3108)
  deps(ci): use python 3.13 on Netlify deployments (testcontainers#3107)
mdelapenya added a commit to jm96441n/testcontainers-go that referenced this pull request Apr 24, 2025
* 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)
mdelapenya added a commit to georgespalding/testcontainers-go that referenced this pull request Apr 25, 2025
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality or new behaviors on the existing one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants