一键导入
test-fixer
Guide for running, reviewing, and fixing test failures across grails-core modules using Gradle test reports
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for running, reviewing, and fixing test failures across grails-core modules using Gradle test reports
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Comprehensive guide for current Grails development, covering web applications, REST APIs, GORM, controllers, services, views, plugins, and testing with Spock and Geb
Expert guide for Groovy 5 development, covering concise syntax, closures, DSLs, metaprogramming, static compilation, and integration with Java 21 and Grails
Guide for developing on the Java 21 baseline, including modern features, best practices, and integration with Groovy/Grails projects
Guide for upgrading Grails applications from Grails 7.x to Grails 8, covering Java 21, Spring Boot 4.1, Spring Framework 7, dependency management, Micronaut, Jackson 3, Hibernate 7, TagLibs, testing, content negotiation, and validation behavior changes
Guide for working in the grails-data-hibernate7 module, especially Hibernate 7 domain binding, mapping migration, generators, and integration tests. Use this when changing code or tests under grails-data-hibernate7.
Guide for running, interpreting, and fixing code style and analysis violations in grails-core using GrailsCodeStylePlugin, GrailsCodeAnalysisPlugin, and GrailsViolationAggregationPlugin — covering CodeNarc, Checkstyle, PMD, SpotBugs, and JaCoCo
| name | test-fixer |
| description | Guide for running, reviewing, and fixing test failures across grails-core modules using Gradle test reports |
| license | Apache-2.0 |
Activate this skill when:
:grails-test-report.To save time, run only related tests:
./gradlew :grails-data-hibernate7-core:test --tests "grails.gorm.tests.BasicCollection*"
./gradlew test --continue
Use --continue when you need later modules to run after an earlier module fails.
The grails-test-report project owns repository test aggregation.
./gradlew :grails-test-report:check --continue
This generates:
grails-test-report/build/reports/tests/test/index.htmlgrails-test-report/build/reports/tests/test.mdgrails-test-report/build/reports/tests/integrationTest/index.htmlgrails-test-report/build/reports/tests/integrationTest.mdgrails-test-report/build/reports/tests/combined/index.htmlgrails-test-report/build/reports/tests/combined.mdThe aggregate report includes root subprojects that define matching test or integrationTest tasks.
The collected unit and integration Test tasks are finalized by their matching aggregate report tasks. Reports are attempted after failures and after targeted module test runs, but they summarize the XML results currently available on disk. Use --continue for full-suite runs so Gradle keeps scheduling later test tasks after an earlier failure; without it, reports can be partial. Run clean first when stale XML results should be excluded.
# All tests in a module
./gradlew :grails-data-hibernate7-dbmigration:test
# A specific spec
./gradlew :grails-data-hibernate7-dbmigration:test \
--tests "org.grails.plugins.databasemigration.command.DbmGenerateGormChangelogCommandSpec"
# A specific feature method
./gradlew :grails-data-hibernate7-core:test \
--tests "org.grails.orm.hibernate.FooSpec.my feature name"
# Force rerun even if Gradle thinks it is up-to-date
./gradlew :grails-data-hibernate7-core:test --rerun-tasks
| Source set | Directory | Task |
|---|---|---|
| Unit tests | src/test/groovy/ | test |
| Integration tests | src/integration-test/groovy/ | integrationTest |
Most specs in grails-core are unit tests (src/test/groovy/) run by the test task. A small number of modules use integrationTest for full Spring context tests.
Tests run in parallel (maxParallelForks defaults to 4 on CI and to availableProcessors * 3/4 otherwise; override with -PmaxTestParallel). This can cause:
@Shared field contamination: shared state not properly cleaned up between feature methods.To diagnose flaky failures, rerun with forced serial execution:
./gradlew :module:test -PmaxTestParallel=1 --rerun-tasks
| Property | Effect |
|---|---|
skipTests | Skips all Test tasks (build only) |
maxTestParallel=N | Override parallel fork count |
onlyFunctionalTests | Run only functional test suites |
skipHibernate7Tests | Skip H7-specific test suites |
onlyMongodbTests | Run only MongoDB test suites |
onlyCoreTests | Run only core module tests |
Gradle writes JUnit XML test results to:
<module>/build/test-results/
├── test/
│ └── TEST-org.grails.SomeSpec.xml
└── integrationTest/
└── TEST-org.grails.SomeIntegrationSpec.xml