-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
docs: Use the testcontainers_test
package for root tests to improve documentation
#2202
Draft
Minivera
wants to merge
8
commits into
testcontainers:main
Choose a base branch
from
Minivera:gui/test-packages-for-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…mports As discussed in testcontainers#2180, the imported examples from tests for the docs from lack the package prefix before the imports, which leads to the example not being directly copy/paste-able. To solve the issue it was suggested to create a `testcontainers_test` package for the example tests and to convert everything. I did my best to convert all the tests in a way that makes sense, and I extracted any test that would import very internal things that we should not export. Some of the tests had to be slightly rewritten (the lifecycle tests in particular), but they should stay pretty much the same. Test by running all the root unit tests, they should all work as expected. The examples in the docs should all have the packages as prefixes now.
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Minivera
changed the title
Introduce a
docs: Use the Feb 14, 2024
testcontainers_test
package to solve some of the docs importstestcontainers_test
package for root tests to improve documentation
Minivera
added a commit
to Minivera/testcontainers-go
that referenced
this pull request
Feb 16, 2024
This work has been extracted from testcontainers#2202 and is related to testcontainers#2180. See the original PR for the full context and reasoning.
Minivera
added a commit
to Minivera/testcontainers-go
that referenced
this pull request
Feb 22, 2024
This work has been extracted from testcontainers#2202 and is related to testcontainers#2180. See the original PR for the full context and reasoning. This will help with the documentation, since all examples will now have the module prefixes.
Minivera
added a commit
to Minivera/testcontainers-go
that referenced
this pull request
Feb 28, 2024
This work has been extracted from testcontainers#2202 and is related to testcontainers#2180. See the original PR for the full context and reasoning. This will help with the documentation, since all examples will now have the module prefixes.
Minivera
added a commit
to Minivera/testcontainers-go
that referenced
this pull request
Feb 28, 2024
This work has been extracted from testcontainers#2202 and is related to testcontainers#2180. See the original PR for the full context and reasoning. This will help with the documentation, since all examples will now have the module prefixes.
Minivera
added a commit
to Minivera/testcontainers-go
that referenced
this pull request
Mar 18, 2024
This work has been extracted from testcontainers#2202 and is related to testcontainers#2180. See the original PR for the full context and reasoning. This PR in particular moves all the simpler tests in one go, or adds a comment to any remaining tests that would not make sense to move (or could not be moved without exposing a lot of variables). This will help with the documentation, since all examples will now have the module prefixes.
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?
As discussed in #2180, the imported examples from tests for the docs from lack the package prefix before the imports, which leads to the example not being directly copy/paste-able. To solve the issue it was suggested to create a
testcontainers_test
package for the example tests and to convert everything.I did my best to convert all the tests in a way that makes sense, and I extracted any test that would import very internal things that we should not export. Some of the tests had to be slightly rewritten (the lifecycle tests in particular), but they should stay pretty much the same.
Why is it important?
The docs don't always include all of the packages prefixes when using code examples from the tests, which makes it so users have to add them themselves, and know where each import comes from. This can cause confusion and some frustration.
Related issues
How to test this PR
Test by running all the root unit tests, they should all work as expected. The examples in the docs should all have the packages as prefixes now.