Skip to content

Add test coverage for grails-datamapping-async and type decorator closures - #16193

Open
borinquenkid wants to merge 2 commits into
8.1.xfrom
chore/clean-grails-datamapping-async
Open

Add test coverage for grails-datamapping-async and type decorator closures#16193
borinquenkid wants to merge 2 commits into
8.1.xfrom
chore/clean-grails-datamapping-async

Conversation

@borinquenkid

Copy link
Copy Markdown
Member

Summary

  • grails-datamapping-async had no test infrastructure at all (no src/test, no Spock dependency). Added testImplementation 'org.spockframework:spock-core' and testRuntimeOnly 'org.slf4j:slf4j-nop'.
  • Added GormAsyncStaticApiSpec and AsyncQuerySpec, covering task()/list()/count() delegation through the @DelegateAsync-generated methods and the getDecorators() new-session wrapping. AsyncQuery was previously untested anywhere in the repo (its only sibling, GormAsyncStaticApi, was exercised indirectly via a TCK spec in a different module, grails-datamapping-core-test).
  • Gave both classes' PromiseDecorator closures explicit parameter types (Closure<?> callable, Object[] args) instead of relying on implicit inference, fixing an IDE "cannot infer argument types" inspection on the generic SAM coercion. No behavior change.

Test plan

  • ./gradlew :grails-datamapping-async:test - all 8 specs pass
  • ./gradlew :grails-datamapping-async:codeStyle - clean

🤖 Generated with Claude Code

…sures

The module had no test infrastructure at all, so add the Spock dependency
and specs for GormAsyncStaticApi and AsyncQuery covering task()/list()/
count() delegation and the new-session decorator wrapping. AsyncQuery was
previously untested anywhere in the repo.

Also give both classes' promise decorator closures explicit parameter
types (Closure<?> callable, Object[] args) instead of relying on implicit
inference, fixing an IDE "cannot infer argument types" inspection on the
generic PromiseDecorator SAM coercion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 21, 2026 22:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@borinquenkid
borinquenkid requested a review from matrei August 21, 2026 22:31
@borinquenkid borinquenkid moved this to In Progress in Apache Grails Aug 21, 2026
@borinquenkid borinquenkid added this to the grails:8.1.0-M1 milestone Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.4331%. Comparing base (75cd618) to head (3e29c85).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.1.x     #16193        +/-   ##
==================================================
+ Coverage     53.4149%   53.4331%   +0.0182%     
- Complexity      19459      19467         +8     
==================================================
  Files            2081       2081                
  Lines           98993      98993                
  Branches        17361      17361                
==================================================
+ Hits            52877      52895        +18     
+ Misses          38566      38550        -16     
+ Partials         7550       7548         -2     
Files with missing lines Coverage Δ
.../org/grails/datastore/gorm/async/AsyncQuery.groovy 100.0000% <100.0000%> (+100.0000%) ⬆️
...ils/datastore/gorm/async/GormAsyncStaticApi.groovy 100.0000% <100.0000%> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The trait's static getAsync() had no direct test and is excluded from
JaCoCo (its @generated annotation skips instrumentation), so nothing
flagged it as untested. Verify it wraps the entity's own registered
GormStaticApi in a GormAsyncStaticApi and that task() runs through
that API's session, not some other entity's.
@testlens-app

testlens-app Bot commented Aug 22, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 3e29c85
▶️ Tests: 63688 executed
⚪️ Checks: 80/80 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants