-
-
Notifications
You must be signed in to change notification settings - Fork 510
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: support databend module #2779
feat: support databend module #2779
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hantmac thanks for adding this new module, much appreciated! The go code looks good, although we need to add all the metadata for the module to be included in the CI and in the docs.
Could you please run the module generator code for it? https://golang.testcontainers.org/modules/#creating-a-new-module
Thanks!
@hantmac I went ahead and added the scaffolding. Could you please enrich the docs with the new functional options so that users find them in our docs site 🙏 ? Thanks in advance |
HI @mdelapenya , would you like to explain what is new functional options or where should I found it? |
@mdelapenya HI bro, I saw you have add the docs and some CI workflow information, thanks very much! Is there some other things I need to do? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, a few bugs to fix and a few questions, where I'd like some clarification.
Co-authored-by: Steven Hartland <[email protected]>
497371c
to
1a09c9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are close 😊 Just a few comments from my side plus Steven's.
Thanks for your patience during the review 🙏
modules/databend/databend.go
Outdated
} | ||
|
||
// WithDatabase sets the name of the database to use. | ||
func WithDatabase(database string) DatabendOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user pass this option, where does the Run function applies it to the container? See https://github.com/testcontainers/testcontainers-go/pull/2779/files#diff-05e51be59eadcbdc57a90dccc140946369a930b7bec7e9e987096ebed8beb9beR78 where the default db name is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to add it to the docs site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The db name will add to DSN when call ConnectionString
, so that user can use the db.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm my understanding QUERY_DEFAULT_USER
and QUERY_DEFAULT_PASSWORD
configure the container at startup, which are then also used along side the database setting to allow ConnectionString
to return the details for the client to connect to. There is no needed for default DB because the container doesn't need one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container doesn't need default DB ENV, but the connection dsn need a default one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that mean a hardcoded DB is always created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the default
dababase exists when Databend
start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think the WithDatabase function maybe not suitable for Databend?
@hantmac then, I'd remove the withDatabase support and add it in a follow up: adding the option and creating the new database using the commands you posted above, as part of the container lifecycle hooks (postStarts) in order to create that database. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdelapenya I agree with you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hantmac perfect then. Let's remove it to make progress and merge this new module 🚀 , and postpone the work for the database support on a new iteration.
Thank you for all this hard work during the review 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need the imports fixing into the correct blocks as identified by the linter
Thanks! @stevenh , fixed the ci lint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hantmac let's remove all references to the WithDatabase
, and once there. I think we are good to go.
…tcontainers-go into feat/support-databend-module
@mdelapenya Have removed the references to the |
…tcontainers-go into feat/support-databend-module
We'll tackle that in a separate PR
@mdelapenya It's strange the mssql CI test failed. q.q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your hard work adding this new module. Very useful!
The MSSQL failures have been resolved in #2786 |
* main: feat: support databend module (testcontainers#2779) chore: golangci-lint 1.61.0 (testcontainers#2787)
@mdelapenya Thanks for your help! BTW, I add the testcontainer-rs module in this pr testcontainers/testcontainers-rs-modules-community#207, is there anybody who can help to review it? |
@hantmac could you please add this module to the modules catalog? https://testcontainers.com/modules/?language=go There are instructions in this repo to elaborate the PR. Regarding the Rust module, let me ping the community team on Slack |
@mdelapenya Of course, I will add it. That's greate! Thank you! |
* main: feat: support databend module (#2779) chore: golangci-lint 1.61.0 (#2787) fix(mssql): bump Docker image version (#2786) fix: handle 127 error code for podman compatibility (#2778) fix: do not override ImageBuildOptions.Labels when building from a Dockerfile (#2775) feat(mongodb): Wait for mongodb module with a replicaset to finish (#2777) fix(postgres): Apply default snapshot name if no name specified (#2783)
@mdelapenya Hi bro, I add the module to the modules catalog in this pr testcontainers/community-module-registry#75 |
* main: chore: use a much smaller image for testing (testcontainers#2795) fix: parallel containers clean race (testcontainers#2790) fix(registry): wait for (testcontainers#2793) fix: container timeout test (testcontainers#2792) docs: document redpanda options (testcontainers#2789) feat: support databend module (testcontainers#2779) chore: golangci-lint 1.61.0 (testcontainers#2787) fix(mssql): bump Docker image version (testcontainers#2786) fix: handle 127 error code for podman compatibility (testcontainers#2778) fix: do not override ImageBuildOptions.Labels when building from a Dockerfile (testcontainers#2775) feat(mongodb): Wait for mongodb module with a replicaset to finish (testcontainers#2777) fix(postgres): Apply default snapshot name if no name specified (testcontainers#2783) fix: resource clean up for tests and examples (testcontainers#2738) ci: add generate for mocks (testcontainers#2774) fix: docker config error handling when config file does not exist (testcontainers#2772)
* main: chore: use a much smaller image for testing (testcontainers#2795) fix: parallel containers clean race (testcontainers#2790) fix(registry): wait for (testcontainers#2793) fix: container timeout test (testcontainers#2792) docs: document redpanda options (testcontainers#2789) feat: support databend module (testcontainers#2779) chore: golangci-lint 1.61.0 (testcontainers#2787) fix(mssql): bump Docker image version (testcontainers#2786) fix: handle 127 error code for podman compatibility (testcontainers#2778) fix: do not override ImageBuildOptions.Labels when building from a Dockerfile (testcontainers#2775) feat(mongodb): Wait for mongodb module with a replicaset to finish (testcontainers#2777) fix(postgres): Apply default snapshot name if no name specified (testcontainers#2783) fix: resource clean up for tests and examples (testcontainers#2738)
* main: (29 commits) fix: template for code generation (#2800) fix: update module path (#2797) fix: container logging deadlocks (#2791) chore: use a much smaller image for testing (#2795) fix: parallel containers clean race (#2790) fix(registry): wait for (#2793) fix: container timeout test (#2792) docs: document redpanda options (#2789) feat: support databend module (#2779) chore: golangci-lint 1.61.0 (#2787) fix(mssql): bump Docker image version (#2786) fix: handle 127 error code for podman compatibility (#2778) fix: do not override ImageBuildOptions.Labels when building from a Dockerfile (#2775) feat(mongodb): Wait for mongodb module with a replicaset to finish (#2777) fix(postgres): Apply default snapshot name if no name specified (#2783) fix: resource clean up for tests and examples (#2738) ci: add generate for mocks (#2774) fix: docker config error handling when config file does not exist (#2772) docs: refine heading badges in README (#2770) feat(wait): for file (#2731) ...
What does this PR do?
Support new module: databend