Add grails-spock-test-tour v8 guide#499
Merged
jamesfredley merged 1 commit intomasterfrom May 3, 2026
Merged
Conversation
Working examples of every Spock test layer Grails 8 supports. Greenfield - new grails-guides/grails-spock-test-tour repo created public on the grails8 default branch. The 13 chapters demonstrate one canonical example per layer: - Getting Started (whatYouWillBuild, requirements, howto) - Five Test Layers (the speed/cost/coverage matrix) - DomainUnitTest for Constraints (BookSpec with @unroll where: table for pageCount) - ServiceUnitTest + DataTest for Queries (BookServiceSpec, in-memory GORM, dynamic-finder testing) - ControllerUnitTest for Routing (BookControllerSpec, response status + request.json shape) - @Integration With @Rollback (BookIntegrationSpec, real Spring context, real datasource, transaction-isolated specs) - Geb Functional Tests (Testcontainers Postgres, browser session reuse, cross-references the CI/CD guide for staging) - Parameterised where: Data Tables (block discipline, mock-call-count assertions) - useJUnitPlatform and JaCoCo Coverage (the wiring most teams get wrong) Verified locally: ./gradlew validateGuides -PvalidationMode=both [validateGuides] mode=both: 86 guide(s) parsed, 0 SKIP-warned, 0 errors ./gradlew renderGuide_grails_spock_test_tour_8 --rerun-tasks --no-configuration-cache Renders all 13 chapter HTML pages, no Unresolved directive errors. Assisted-by: claude-code:claude-opus-4-7
This file contains hidden or 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
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.
Summary
Adds the A Spock Test Tour for Grails 8 guide as the seventh Grails 8 sample-app-flavour guide. Following PRs #479, #493, #494, #495, #496, #497, #498.
Working examples of every Spock test layer Grails 8 supports, framed by which test type catches which class of bug. Replaces the oldest testing content on the portal (
grails-controller-testing,grails-mock-basics,grails-test-domain-class-constraints, all from 2017).Greenfield - no upstream rename
The new
grails-guides/grails-spock-test-tourrepository was created public withgrails8as its default branch. The four legacy single-topic test guides (grails-controller-testing,grails-mock-basics,grails-test-domain-class-constraints,grails-test-security) are intentionally left alone - they continue to resolve.What's in the PR
conf/guides.yml- newgrails-spock-test-tourregistry entry, alphabetical insertion betweengrails-soapandgrails-spring-security-core-plugin-custom-authentication.guides/grails-spock-test-tour/v8/guide/*.adoc- 13 chapters, one per test layer plus framing material.guides/grails-spock-test-tour/v8/snippets/- vendored Book domain, BookService data service, BookController, plus four spec files (BookSpec,BookServiceSpec,BookControllerSpec,BookIntegrationSpec).Test layers covered
DomainUnitTest<Book>BookSpec@Unrollwhere:tableServiceUnitTest+DataTestBookServiceSpecControllerUnitTestBookControllerSpec@Integration+@RollbackBookIntegrationSpecUpstream sample app
grails-guides/grails-spock-test-touron thegrails8branch.Verification
./gradlew validateGuides -PvalidationMode=bothreturns 86 guides, 0 errors../gradlew renderGuide_grails_spock_test_tour_8 --rerun-tasks --no-configuration-cacherenders all 13 chapter HTML pages, no Unresolved directive errors.Notes for reviewers
where:data-table chapter forward-references themock-call-countandblock-disciplinepatterns rather than dedicating a chapter to each - they are mentioned briefly enough to stay actionable without ballooning the chapter count.