jamesfredley commented on PR #15587:
URL: https://github.com/apache/grails-core/pull/15587#issuecomment-4321136322
Pushed `9d7d4943d5` which folds the five demo apps into the monorepo
functional-test layout (the follow-up I'd promised in the previous comment).
## What moved
Everything under `grails-data-graphql/examples/` is now under
`grails-test-examples/graphql/` and wired into the root `settings.gradle`:
| New gradle path | Source
location |
| ------------------------------------------------------------ |
------------------------------------------------------- |
| `:grails-test-examples-graphql-grails-test-app` |
`grails-test-examples/graphql/grails-test-app` |
| `:grails-test-examples-graphql-grails-docs-app` |
`grails-test-examples/graphql/grails-docs-app` |
| `:grails-test-examples-graphql-grails-tenant-app` |
`grails-test-examples/graphql/grails-tenant-app` |
| `:grails-test-examples-graphql-grails-multi-datastore-app` |
`grails-test-examples/graphql/grails-multi-datastore-app` |
| `:grails-test-examples-graphql-spring-boot-app` |
`grails-test-examples/graphql/spring-boot-app` |
The four Grails apps use `org.apache.grails.gradle.grails-web` +
`grails-gson` + `grails-bom` (mirroring
`grails-test-examples/issue-views-182`). The Spring Boot app uses
`org.springframework.boot` + `:grails-data-hibernate5-spring-boot` for
`HibernateDatastore` autoconfig.
## CI fix included
The `Build Grails-Core` jobs were red on `:grails-data-graphql:groovydoc`
because the Groovydoc task implicitly consumed `build/gson-classes/main`
without declaring the dependency. Added an explicit `tasks.named('groovydoc') {
dependsOn tasks.named('compileGsonViews') }` in
`grails-data-graphql/plugin/build.gradle`.
## Other build/test fixes required by integration
- `grails-data-graphql-core` no longer has an `api` dep on
`grails-views-gson` (it was unused and was pulling `grails-controllers` onto
the spring-boot-app classpath, which crashed Spring Boot startup with a
`dispatcherServlet` `BeanDefinitionOverrideException`).
- spring-boot-app `Author.groovy` switched from `@grails.persistence.Entity`
(which requires `grails-core` AST and brings in conflicting auto-config) to
plain `@jakarta.persistence.Entity` + `@Id` / `@GeneratedValue` / `@Version`.
Still implements `GormEntity`, so the demo's intent is preserved.
- `AuthorIntegrationTests` doesn't use `@SpringBootTest` + `@Autowired`
(`spock-spring` isn't activating cleanly in this monorepo's test classpath) -
it spins up `SpringApplication.run(...)` itself in `setupSpec` with `@Shared` /
`@AutoCleanup` and uses a plain `RestTemplate`. Same coverage, deterministic.
- All four Grails apps depend on
`io.micronaut.serde:micronaut-serde-jackson` so the Micronaut HTTP client used
by `GraphQLSpec` finds a `JsonMapper`.
- Both `grails-test-app` and `grails-tenant-app` map their `User` domain
class to `app_user` because the unquoted name `user` is reserved in modern H2.
## Pre-existing test rot also fixed in this commit
Once `integrationTest` actually runs in the integrated build, a handful of
legacy tests fail. None of these failures are caused by the integration; they
were latent in the standalone PR too. Fixed in-place rather than skipping:
- `CommentIntegrationSpec` / `UserRoleIntegrationSpec` - regex assertions on
Hibernate-generated SQL hard-coded a specific column ordering. Loosened to
assert structurally; tests now survive Hibernate column reorderings.
- `PostIntegrationSpec` - `SimpleDateFormat` pattern updated from
`yyyy-MM-dd'T'HH:mm:ssX` to `yyyy-MM-dd'T'HH:mm:ss.SSSX` so ISO-8601 timestamps
with millisecond precision parse correctly.
- `PostIntegrationSpec.cleanupSpec` / `TagIntegrationSpec.cleanupSpec` -
made best-effort (delete what's there, no strict count/foreign-key assertions).
Integration tests share one H2 instance across specs, so strict counts depended
on execution order.
## Verified locally
```
./gradlew :grails-test-examples-graphql-grails-test-app:test
:grails-test-examples-graphql-grails-docs-app:test
:grails-test-examples-graphql-grails-tenant-app:test
:grails-test-examples-graphql-grails-multi-datastore-app:test
:grails-test-examples-graphql-spring-boot-app:test
# BUILD SUCCESSFUL
./gradlew :grails-test-examples-graphql-grails-test-app:integrationTest
:grails-test-examples-graphql-grails-docs-app:integrationTest
:grails-test-examples-graphql-grails-tenant-app:integrationTest
:grails-test-examples-graphql-grails-multi-datastore-app:integrationTest
# BUILD SUCCESSFUL
./gradlew :grails-data-graphql:groovydoc
# BUILD SUCCESSFUL (CI fix verified)
./gradlew :grails-data-graphql-core:codeStyle :grails-data-graphql:codeStyle
# BUILD SUCCESSFUL
```
The `Build Grails-Core` and `Functional Tests` jobs should now go green -
holler if anything else needs attention.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]