The GitHub Actions job "CI" on 
grails-core.git/test/abstract-datastore-initializer has succeeded.
Run started by GitHub user borinquenkid (triggered by borinquenkid).

Head commit for run:
5e6cc3b2d3935449f71af14c3a34f940122a45fe / Walter Duque de Estrada 
<[email protected]>
Address PR review feedback: flaky test risk and coverage gaps

Fixes a real flakiness risk Copilot flagged: two applyDatabaseNameFallback
unit tests relied on the default StandardEnvironment not already
containing grails.mongodb.databaseName, but StandardEnvironment reads
system properties and environment variables, so an externally-set value
could make either test fail unpredictably. Strips those property sources
before asserting.

Closes the coverage gaps Codecov flagged on this PR's diff:
- Adds a PlainPropertyResolver test double (neither ConfigurableEnvironment
  nor Map) to cover applyDatabaseNameFallback's fallthrough branch, which
  was previously only exercised on the true side.
- Adds a direct test for GrailsBeanBuilderInit.registerBeans(), the
  Groovy-BeanBuilder-based fallback path in AbstractDatastoreInitializer
  that was completely untested (GroovyBeanReaderInit always wins in this
  environment since spring-beans is always present, so this path is only
  reachable by calling it directly, as this test now does - the same
  pattern already used for GroovyBeanReaderInit.registerBeans()).

The remaining uncovered lines (the catch(ignored){return false} branches
in both GroovyBeanReaderInit.isAvailable() and GrailsBeanBuilderInit.
isAvailable()) are left as acknowledged gaps: both guarded classes are
always present in this test environment, so triggering the
ClassNotFoundException path would require classloader-hiding tricks with
more fragility than the coverage is worth.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/31766960999

With regards,
GitHub Actions via GitBox

Reply via email to