Skip to content

Commit d9d9d64

Browse files
committed
Run the isolated tests in the web suite
Same defect as the uber suite, and the same fifty tests' worth of consequence. execIsolatedTests is registered rather than being the task the java plugin creates, so it had neither testClassesDirs nor classpath and was NO-SOURCE: success, having run nothing. `test` excludes those same classes, so they ran nowhere. There is a third reason here, on top of the two the uber suite had. Nothing declared this task as work: `build` runs `check`, `check` ran `test`, and execIsolatedTests was reachable only by naming it. The shard plugin collects it through tasks.withType(Test), which is why the joint workflow reached it at all and gradle.yml never did. `check` now depends on it. All fifty pass. JSONBindingTests and AutoParams*MarshallingTests are dropped from the list. 1e38f1b deleted all three of those classes in June 2013 and added nothing: the feature went, so the tests went with it, and naming them here selects nothing and excludes nothing. Every other entry that matches no class in this project is left alone, because those tests were moved rather than deleted -- GSPResponseWriterSpec and pages/ext/jsp to grails-gsp, GroovyPageAttributesTests to grails-taglib -- and whether their successors still need isolating is a question about those projects, not this list.
1 parent 1d843ec commit d9d9d64

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

grails-test-report/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def isolatedUnitTestPhases = [
3535
'isolatedRestRendererTests',
3636
'isolatedPersonTests',
3737
'isolatedRestfulControllerTests',
38+
'execIsolatedTests',
3839
]
3940

4041
def reportVariants = [

grails-test-suite-web/build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ def defaultTestConfig = {
6060

6161
def isolatedTests = [
6262
'**/ContentFormatControllerTests.class',
63-
'**/JSONBindingTests.class',
64-
'**/AutoParams*MarshallingTests.class',
6563
'**/JSONBindingToNullTests.class',
6664
'**/ControllerWithXmlConvertersTests.class',
6765
'**/GroovyPageAttributesTests.class',
@@ -77,6 +75,11 @@ def isolatedTests = [
7775

7876
tasks.register('execIsolatedTests', Test).configure { Test it ->
7977
it.configure(defaultTestConfig)
78+
// A Test task registered rather than the one the java plugin creates has neither of these,
79+
// which makes it NO-SOURCE: it reports success having run nothing. These classes are excluded
80+
// from `test` below, so without this they run in no task at all.
81+
it.testClassesDirs = sourceSets.test.output.classesDirs
82+
it.classpath = sourceSets.test.runtimeClasspath
8083
it.forkEvery = 1
8184
it.includes.addAll(isolatedTests)
8285
}
@@ -95,6 +98,12 @@ tasks.named('test', Test).configure { Test it ->
9598
it.excludes.addAll(isolatedTests)
9699
}
97100

101+
// Nothing else asked for this task, so `build` ran `test` and stopped. The shard plugin picks it
102+
// up through tasks.withType(Test), which is why the joint workflow reached it and gradle.yml did not.
103+
tasks.named('check') {
104+
dependsOn('execIsolatedTests')
105+
}
106+
98107
tasks.withType(Groovydoc).configureEach {
99108
// tests do not have groovydoc
100109
enabled = false

0 commit comments

Comments
 (0)