-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat: support for generating testcontainers-go tests for DB drivers #271
feat: support for generating testcontainers-go tests for DB drivers #271
Conversation
@mdelapenya Thanks for the PR, and sorry for the delay. We merged some other PRs first that included fixes and had priority. This is a very interesting one. I think it would be better if we include the DB tests in the core blueprint and bind them to the DB driver flag. It makes more sense to me. The advanced flag is for more niche features. DB integration tests belong in the core. The current workflow that you created is failing because in v.0.7.0, the core has a git flag that needs to be added: -g commit. After that, the workflow should pass. Earlier, I saw that linter passed, but now it fails. There was no big change, only a refactor, and git was added into the matrix. |
@Ujstor thanks for your feedback! Indeed, the linter passed before and I'm fixing it. We released I'm working on the fix right now. |
I protected the addition of the tests with the advanced flag in the case the team was not sure about bundling testcontainers into the projects as part of the core. I'm glad you see it adding them as part of the core as something positive. Thanks! |
@Ujstor PR is updated, including the tests in the core. I hope everything is correct. PLMK if anything needs to be changed, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two small things, and after that, we are ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
Testing is a mayor concern nowadays, so this PR extends the code generation tool to include integration tests for the DB layer.
It uses Testcontainers for Go (spoiler alert: core maintainer here 👋) to run the test. Given the project already uses Docker Compose for running the project in dev mode, I think it's a good idea to have real services backing the database layer at test time.
Sample ouput of the tests:
Description of Changes:
Checklist