Support MongoDB Testing in Forge#15339
Conversation
c889d31 to
250b9b3
Compare
jdaugherty
left a comment
There was a problem hiding this comment.
@sanjana2505006 please test changes locally before opening PRs
| [source,groovy,subs="attributes"] | ||
| testCompile "org.apache.grails:grails-testing-support-datamapping" | ||
| testCompile "org.apache.grails:grails-testing-support-web" | ||
| testCompile "org.apache.grails:grails-testing-support-mongodb" |
There was a problem hiding this comment.
This should not be a default recommendation. Not everyone uses mongodb. I also dont' think this is the right scope since the class will be needed at runtime of the test as well as compile.
| @@ -0,0 +1,34 @@ | |||
| # Unit Testing GORM for MongoDB | |||
There was a problem hiding this comment.
This library is not just for unit testing. it's for integration testing as well.
| String driver = "org.testcontainers.jdbc.ContainerDatabaseDriver"; | ||
| if (driverFeature instanceof SQLServer) { | ||
| generatorContext.addTemplate("sqlserverEula", new StringTemplate("src/test/resources/container-license-acceptance.txt", "mcr.microsoft.com/mssql/server:2019-CU4-ubuntu-16.04")); | ||
| generatorContext.addTemplate("sqlserverEula", |
There was a problem hiding this comment.
Please do not reformat these files unless it's across different commits.
| || generatorContext.isFeaturePresent(MongoGorm.class)) { | ||
| generatorContext.addDependency(Dependency.builder() | ||
| .groupId("org.apache.grails") | ||
| .artifactId("grails-testing-support-mongodb") |
There was a problem hiding this comment.
This is the wrong group id
250b9b3 to
3b6a04d
Compare
|
@jdaugherty Thank you for the detailed feedback! I have updated the PR to address all the points: For the docs, I added a specific page for pure MongoDB testing (covering both unit/integration) as requested. Verified everything locally by running the Forge tests and building the docs. It's all squashed into one clean commit now. Let me know if it looks good! |
|
@jdaugherty Whenever you get a chance, please review and let me know if any changes are needed |
Fixed an issue where the
grails-testing-support-mongodbdependency wasn't included when generating projects with MongoDB and TestContainers. Also added a new guide to the docs explaining how to unit test with MongoDB.Fixes #15007