feat: provide a tool to generate examples from code#603
Closed
mdelapenya wants to merge 43 commits intotestcontainers:mainfrom
Closed
feat: provide a tool to generate examples from code#603mdelapenya wants to merge 43 commits intotestcontainers:mainfrom
mdelapenya wants to merge 43 commits intotestcontainers:mainfrom
Conversation
Member
Author
|
Weird: the tests fail because of a difference of milliseconds in the create date: |
Merged
mdelapenya
commented
Nov 10, 2022
Comment on lines
+30
to
+32
| wait.ForHTTP("/admin/v2/clusters").WithPort("8080/tcp").WithResponseMatcher(matchAdminResponse).WithStartupTimeout(defaultTimeout), | ||
| wait.ForLog("Successfully updated the policies on namespace public/default").WithStartupTimeout(defaultTimeout), | ||
| ).WithStartupTimeout(defaultTimeout), |
Member
Author
There was a problem hiding this comment.
@clive-jevons please take a look at this startup timeout
mdelapenya
commented
Nov 10, 2022
| ) | ||
|
|
||
| func TestPulsar(t *testing.T) { | ||
| ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) |
Member
Author
|
Superseded by #618 |
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:
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.
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.