Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MustConn): Add MustConnectionString on (some) dbs #2343

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

bearrito
Copy link
Contributor

@bearrito bearrito commented Mar 12, 2024

What does this PR do?

Adds MustConnectionString on a variety of DB containers. I skipped MSSQL because that was failing to run tests for me locally.

There are probably more I can add them. Should I just add them to all containers with a ConnectionString method?

Why is it important?

Not sure again, just looking at good first issue tags.
#2134

How to test this PR

Run the unit tests.

One point about the unit tests, I could not figure out a way to get a panic out of the ConnectionString methods. I looked for ways to corrupt/mutate the exposed_ports and host, but could not figure out an entrypoint. So there is no test that it actually panics if unable to provide the connstring.

@bearrito bearrito requested a review from a team as a code owner March 12, 2024 14:17
Copy link

netlify bot commented Mar 12, 2024

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit e332b55
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/65f1231995b63c0008884d0d
😎 Deploy Preview https://deploy-preview-2343--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.

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

One point about the unit tests, I could not figure out a way to get a panic out of the ConnectionString methods.

It's fine, I would not worry to get 100% coverage meanwhile it's clear, which this PR is.

Other than that, LGTM, thank you!

modules/mysql/mysql_test.go Outdated Show resolved Hide resolved
modules/nats/nats_test.go Outdated Show resolved Hide resolved
@mdelapenya mdelapenya self-assigned this Mar 12, 2024
@mdelapenya mdelapenya added the enhancement New feature or request label Mar 12, 2024
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for implementing this 👏

@mdelapenya mdelapenya merged commit 9f1d656 into testcontainers:main Mar 18, 2024
98 checks passed
mdelapenya added a commit to stevenh/testcontainers-go that referenced this pull request Apr 3, 2024
* main: (21 commits)
  feat: optimizes file copies to and from containers (testcontainers#2450)
  fix(exec): updates the `Multiplexed` opt to combine stdout and stderr (testcontainers#2452)
  Upgrade neo4j module to use features from v0.29.1 of testcontainers-go (testcontainers#2463)
  bug:Fix AMQPS url (testcontainers#2462)
  chore: more compose updates in comments
  chore: use "docker compose" (v2) instead of "docker-compose" (v1) (testcontainers#2464)
  chore(deps): bump github/codeql-action from 2.22.12 to 3.24.9 (testcontainers#2459)
  refactor: Add Weaviate modules tests (testcontainers#2447)
  feat(exitcode): Add exit code sugar method (testcontainers#2342)
  feat: add module to support InfluxDB v1.x (testcontainers#1703)
  feat: authenticate docker on PullImage (testcontainers#2446)
  feat: add distribution-registry module (testcontainers#2341)
  chore(deps): Bumping ChromaGo client version (testcontainers#2402)
  chore(deps): bump github.com/docker/docker from 25.0.3+incompatible to 25.0.5+incompatible (testcontainers#2444)
  feat: support passing io.Reader as ContainerFile (testcontainers#2401)
  chore: bump ryuk to latest (testcontainers#2395)
  feat(MustConn): Add MustConnectionString on (some) dbs (testcontainers#2343)
  fix: typo in ci-test-go.yml (testcontainers#2394)
  feat: support for waiting for response headers (testcontainers#2349)
  chore(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (testcontainers#2392)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants