Skip to content

Commit 8b5c20d

Browse files
authored
test: All tests working except GORM Inheritance (#589)
- Make all tests work with Grails 7 (except for the failures caused by the GORM Inheritance issue) - Enable tests in ci
1 parent 1fd1813 commit 8b5c20d

File tree

21 files changed

+971
-432
lines changed

21 files changed

+971
-432
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
3232
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
3333
with:
34-
arguments: check -Dgeb.env=chromeHeadless -x test -x integrationTest
34+
arguments: check -Dgeb.env=chromeHeadless
3535

3636
build_project:
3737
runs-on: ubuntu-latest
@@ -48,7 +48,7 @@ jobs:
4848
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
4949
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
5050
with:
51-
arguments: build -Dgeb.env=chromeHeadless -x test -x integrationTest
51+
arguments: build -Dgeb.env=chromeHeadless
5252

5353
- name: Publish Snapshot artifacts to Artifactory (repo.grails.org)
5454
if: success()

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ allprojects {
4646

4747
version = rootProject.version
4848
repositories {
49-
mavenLocal() // Used by Groovy Joint workflow github action after building Groovy
5049
mavenCentral()
5150
maven { url = 'https://repo.grails.org/grails/core' }
51+
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
5252
if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) {
5353
maven {
5454
name = 'JFrog Groovy snapshot repo'

examples/functional-tests-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id 'java-library'
33
id 'org.grails.grails-plugin'
4-
//id 'org.grails.plugins.views-json'
4+
id 'org.grails.plugins.views-json'
55
}
66

77
group = 'functional.tests.plugin'

examples/functional-tests/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ group = 'functional.tests'
1010

1111
dependencies {
1212

13-
1413
implementation project(':examples-functional-tests-plugin')
1514
implementation project(':views-json')
1615
implementation project(':views-markup')
1716

18-
runtimeOnly project(':views-json-templates')
19-
20-
testImplementation project(':views-json-testing-support')
21-
2217
implementation 'org.grails:grails-core'
2318
implementation 'org.grails:grails-logging'
2419
implementation 'org.grails:grails-web-boot'
@@ -38,14 +33,20 @@ dependencies {
3833
implementation 'org.springframework.boot:spring-boot-autoconfigure'
3934
implementation 'org.springframework.boot:spring-boot-starter-logging'
4035
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
41-
implementation libs.jakarta.servlet.api
4236

37+
compileOnly libs.jakarta.servlet.api // Provided by Tomcat
38+
39+
runtimeOnly project(':views-json-templates')
4340
runtimeOnly 'com.h2database:h2'
4441
runtimeOnly 'org.apache.tomcat:tomcat-jdbc'
4542
runtimeOnly libs.assetpipeline
4643

44+
testImplementation project(':views-json-testing-support')
4745
testImplementation libs.grails.testing.support.core
48-
testImplementation libs.micronaut.http.client
46+
47+
integrationTestImplementation libs.jackson.databind
48+
integrationTestImplementation libs.micronaut.http.client
49+
integrationTestImplementation libs.micronaut.jackson.databind
4950
}
5051

5152
assets {

examples/functional-tests/grails-app/controllers/functional/tests/BookController.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class BookController extends RestfulController<Book> {
1616
[books: listAllResources(params)]
1717
}
1818

19-
2019
def listExcludesRespond() {
2120
respond([books: listAllResources(params)])
2221
}
@@ -34,7 +33,7 @@ class BookController extends RestfulController<Book> {
3433
}
3534

3635
def nonStandardTemplate() {
37-
respond([book: new Book(title: 'template found'), custom: new CustomClass(name: "Sally")], view:'/non-standard/template')
36+
respond([book: new Book(title: 'template found'), custom: new CustomClass(name: 'Sally')], view:'/non-standard/template')
3837
}
3938

4039
def showWithParams() {

examples/functional-tests/grails-app/domain/functional/tests/Garage.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class Garage {
44

55
String owner
66

7-
static hasMany = [vehicles: Vehicle]
7+
// GORM Inheritance not working in Groovy 4
8+
//static hasMany = [vehicles: Vehicle]
89

910
}

examples/functional-tests/grails-app/init/BootStrap.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ class BootStrap {
3636

3737
new Proxy(name: "Sally").save(flush: true, failOnError: true)
3838

39+
// GORM inheritance not working in Groovy 4
40+
// See https://issues.apache.org/jira/browse/GROOVY-5106,
41+
// https://github.com/grails/grails-views/pull/589
42+
/*
3943
new Garage(owner: "Jay Leno")
4044
.addToVehicles(new Bus(maxPassengers: 30, route: "around town"))
4145
.addToVehicles(new Car(maxPassengers: 4, make: "Subaru", model: "WRX", year: 2016))
4246
.save(flush: true, failOnError: true)
47+
*/
4348

4449
new Customer(name: "Nokia")
4550
.addToSites(new Site(name: "Salo"))

0 commit comments

Comments
 (0)