feat: provide a tool to generate examples from code#618
Merged
mdelapenya merged 49 commits intotestcontainers:mainfrom Nov 23, 2022
Merged
feat: provide a tool to generate examples from code#618mdelapenya merged 49 commits intotestcontainers:mainfrom
mdelapenya merged 49 commits intotestcontainers:mainfrom
Conversation
Not adding value to the example
mdelapenya
commented
Nov 17, 2022
.github/workflows/ci.yml
Outdated
| if: ${{ matrix.platform == 'ubuntu-latest' }} | ||
| run: make test-e2e | ||
|
|
||
| - name: Run Example tests |
Member
Author
There was a problem hiding this comment.
I'm tempted to have a dedicated pipeline for each example, instead of adding build time to the main one. Wdyt? If that's the case, should the checks be mandatory for the review?
Closed
This was referenced Nov 23, 2022
Closed
Closed
Closed
Closed
Closed
Member
Author
|
@eddumelendez and I had a chat on this PR, and we are going to merge as is, creating follow-up PRs adding more examples. |
mdelapenya
referenced
this pull request
in mdelapenya/testcontainers-go
Nov 29, 2022
* main: Add toxiproxy example (#643) Add spanner example (#642) chore: sync governance files (#641) Add pubsub example (#640) chore: adjust generator for the docs site (#639) Add datastore example (#638) Add firestore example (#637) fix: avoid panics when checking container state and container.raw is nil (#635) feat: provide a tool to generate examples from code (#618) chore: bump version in mkdocs (#630) docs: remove code snippets from main README (#631) docs: document replace directive for Docker Compose (#632)
48 tasks
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?
It moves the existing examples' code (cockroachDB, nginx, pulsar and redis) to separate example Go modules that will be automatically included into the docs site.
Besides, we have provided a command line tool to generate the scaffolding for the code of a new example. This tool will generate:
gotestsum) used to build/run the example.This tool is not doing the following:
You have to manually add the markdown entry in the docs to theImplemented in this PR 🚀mkdocs.ymlfile in the root directory of the project. It will generate the navigation menu for the docs website.In this PR we are adding a Make goal to run all the examples' tests, in order to check if they are still valid and not outdated. The make goal, which calls each example's Makefile, is used in the CI pipeline for each example.
Why is it important?
Examples embedded into the docs could get outdated and they could not even compile. With this approach, the tests will be part of the test suite.
We expect the code generation tool will simplify how to start an example, creating the scaffolding for it.
Related issues
Follow-up questions