codeconsole commented on PR #16183:
URL: https://github.com/apache/grails-core/pull/16183#issuecomment-5363664604
Added `7cdb38535f` as a separate commit — a build fix that is independent of
the feature and easy to review or split out.
**The bug.** The five isolated `Test` tasks in `grails-test-suite-uber` were
registered without `testClassesDirs` or `classpath`. A manually registered
`Test` task inherits neither from the test source set, so each resolved no
candidate classes and reported `NO-SOURCE`. The main `test` task excludes
exactly those patterns, so the isolated classes ran **nowhere**:
`isolatedTestsOne`, `isolatedTestsTwo`, `isolatedRestRendererTests`,
`isolatedPersonTests`, `isolatedRestfulControllerTests`.
Wiring both properties to the test source set brings **40 tests back into
the build. 36 pass.**
**The other four, and a defect they expose.** They assert the
validation-error branch of a controller action — an invalid domain instance
should re-render the `create` or `edit` view. They fail because domain
validation is not enforced in this unit-test harness. A minimal probe:
```
PROBE blankValid=true nullValid=true okValid=true
PROBE constrainedProperties=[title]
```
against
```groovy
@Entity
class Probe {
String title
static constraints = { title blank: false }
}
```
The constraint is registered and `constrainedProperties` reports it, but
`validate()` returns `true` even for `title: null`, whose `nullable` constraint
defaults to `false`. So the "invalid" instance is valid, the action takes its
success path, and the error-view assertions never run.
That is pre-existing and unrelated to this PR — it was simply invisible
while the tasks reported `NO-SOURCE`. I have marked those four
`@PendingFeature` rather than adjust them to match the broken behaviour: the
annotation fails the build if validation is fixed and they start passing, so it
cannot outlive the bug. Happy to raise it as its own issue if that is preferred.
--
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]