-
-
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
[Enhancement]: incomplete documentation for postgres example #1362
Comments
Hi @ChristianSch , thanks for the issue report. We are using a plugin to extract the test code from test files and put it into the markdown files, which is optimal to sync code and documentation. The downside of this is that the test code, as you pointed out, could have references to testing structures (in this case a table, or even the testing library). We have this issue open: #611, and/but I'd like to also have Go examples, that end up in the pkg.dev documentation site. Given we want to prioritise code snippets that don't get outdated, and are executed as real tests, I think it would be hard at the moment to unlink those code snippets from the test files. |
I think for documentation exports, you might consider testable Examples (https://go.dev/blog/examples) At some point, I was going to give up using the postgres module and go with generic container API. |
Exactly, it's in our plans: #1362 (comment)
Regarding your frustration on finding accurate docs
I'm really sorry about that, hopefully I can dedicate a full time-slot for fixing all code snippets from the docs, also improving the module generator code to force an module_example.go test file for the Go Examples. |
@mdelapenya thanks! sorry I missed that line above. |
@sanan-go @ChristianSch we have added #1600, which will force new modules to include testable examples. Once merged, I'm going to do round of reviews to all modules migrating them to examples. I'll close this issue once everything is migrated. Thanks for your support! |
Proposal
Hi there,
As the postgres docs are based on the https://github.com/testcontainers/testcontainers-go/blob/7ae3f5ae950813ea3fe1b071f7a17012d222f2dd/modules/postgres/postgres_test.go, it produces code which is unusable. It is not clear what
tt
is from the context. You can't really know it, as it's rest related. Any change this could get fixed up?It should really be something along the lines of:
Instead of:
In theory I'm up for submitting a patch, but I really don't want to meddle with tests and doc generation processes.
The text was updated successfully, but these errors were encountered: