chore: always generate the examples including a explicit image#1611
Merged
mdelapenya merged 1 commit intotestcontainers:mainfrom Sep 12, 2023
Merged
chore: always generate the examples including a explicit image#1611mdelapenya merged 1 commit intotestcontainers:mainfrom
mdelapenya merged 1 commit intotestcontainers:mainfrom
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Member
Author
|
Specially for the interest of @eddumelendez 😉 |
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Sep 12, 2023
* main: chore: always generate the examples including a explicit image (testcontainers#1611) chore: support linting all modules locally (testcontainers#1609)
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Sep 12, 2023
* main: chore: always generate the examples including a explicit image (testcontainers#1611)
mdelapenya
added a commit
that referenced
this pull request
Sep 12, 2023
…containerd-1.7.5 * main: chore: always generate the examples including a explicit image (#1611) chore: support linting all modules locally (#1609) ci(sonarcloud): run only when not root-less (#1608) remove extra equal in sonar.organization (#1607) chore(ci): enable code coverage on Sonarcloud (#1518) docs: use Go testable examples in modules (#1603)
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Sep 12, 2023
* main: chore: always generate the examples including a explicit image (testcontainers#1611) chore: support linting all modules locally (testcontainers#1609) ci(sonarcloud): run only when not root-less (testcontainers#1608) remove extra equal in sonar.organization (testcontainers#1607) chore(ci): enable code coverage on Sonarcloud (testcontainers#1518) docs: use Go testable examples in modules (testcontainers#1603) ci(lint): enable errorlint linter (testcontainers#1604) ci(lint): enable gocritic linter (testcontainers#1605) chore(deps): bump github.com/hashicorp/vault-client-go in /modules/vault (testcontainers#1566) ci(security): setup codeql scan (testcontainers#1606) chore(deps): bump github.com/cyphar/filepath-securejoin (testcontainers#1601) chore: generate Go examples for new modules (testcontainers#1600) chore: generate Go examples for new modules (testcontainers#1600)
mmorel-35
reviewed
Sep 18, 2023
| "fmt" | ||
|
|
||
| "github.com/testcontainers/testcontainers-go" | ||
| "github.com/testcontainers/testcontainers-go/modules/{{ $lower }}" |
Contributor
There was a problem hiding this comment.
Hi @mdelapenya,
This is breaking go mod tidy when applied on an example.
go run . new example --name questdb --image "questdb/questdb:latest" --title QuestDB
Error: >> error synchronizing the dependencies: exit status 1
When you then try in examples/questdb
go mod tidy
go: finding module for package github.com/testcontainers/testcontainers-go/modules/questdb
github.com/testcontainers/testcontainers-go/examples/questdb tested by
github.com/testcontainers/testcontainers-go/examples/questdb.test imports
github.com/testcontainers/testcontainers-go/modules/questdb: module github.com/testcontainers/testcontainers-go@latest found (v0.23.0, replaced by ../..), but does not contain package github.com/testcon
tainers/testcontainers-go/modules/questdb
Member
Author
There was a problem hiding this comment.
Oh you're right, the modules keyword must be taken from the struct's parentDir 🤦
Will submit a fix ASAP, thanks for reporting it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR updates the module templates to always include the default image for the new module. It applies to:
Therefore, the all
RunContainercalls in the examples will include thetestcontainers.WithImage("foo:bar")functional option.Why is it important?
Users copy&pasting our code examples will receive a code snippet including the image, which is important for awareness of what version of the technology they are using.