From 3bde9da8d42219592e923fef3e6e97bdcb89d3c5 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Wed, 30 Oct 2024 13:34:39 -0400 Subject: [PATCH] Grails 7 test fixes --- .github/renovate.json | 6 ---- .sdkmanrc | 1 + app1/build.gradle | 2 -- .../InjectingDataSourceServiceSpec.groovy | 1 - app2/build.gradle | 2 -- app3/build.gradle | 2 -- build.gradle | 6 ++++ datasources/build.gradle | 3 +- gorm/build.gradle | 2 -- gorm/grails-app/domain/gorm/ChildA.groovy | 4 +-- gorm/grails-app/domain/gorm/ChildB.groovy | 3 +- .../groovy/gorm/AbstractParentSpec.groovy | 1 - gradle.properties | 11 ++----- gradle/geb.gradle | 2 +- hyphenated/build.gradle | 2 -- issue-11102/build.gradle | 2 -- issue-698-domain-save-npe/build.gradle | 2 -- micronaut/build.gradle | 31 ++----------------- namespaces/build.gradle | 2 -- 19 files changed, 17 insertions(+), 68 deletions(-) create mode 100644 .sdkmanrc diff --git a/.github/renovate.json b/.github/renovate.json index cfa7ed91..d00a6ddf 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -14,12 +14,6 @@ ], "groupName": "groovy monorepo" }, - { - "matchPackagePatterns": [ - "^org\\.seleniumhq\\.selenium" - ], - "groupName": "selenium monorepo" - }, { "matchPackageNames": [ "org.grails.plugins:views-json", diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 00000000..cb8d5cb2 --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1 @@ +java=17.0.12-librca \ No newline at end of file diff --git a/app1/build.gradle b/app1/build.gradle index f0d1ad40..f4fac59e 100644 --- a/app1/build.gradle +++ b/app1/build.gradle @@ -6,7 +6,6 @@ buildscript { dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -17,7 +16,6 @@ apply plugin: "war" apply plugin: "asset-pipeline" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" assets { minifyJs = true diff --git a/app1/src/integration-test/groovy/functionaltests/InjectingDataSourceServiceSpec.groovy b/app1/src/integration-test/groovy/functionaltests/InjectingDataSourceServiceSpec.groovy index bdebd7da..4404b3b5 100644 --- a/app1/src/integration-test/groovy/functionaltests/InjectingDataSourceServiceSpec.groovy +++ b/app1/src/integration-test/groovy/functionaltests/InjectingDataSourceServiceSpec.groovy @@ -1,7 +1,6 @@ package functionaltests import grails.testing.mixin.integration.Integration -import spock.lang.PendingFeature import spock.lang.Specification @Integration(applicationClass = Application) diff --git a/app2/build.gradle b/app2/build.gradle index 1ec99467..de82e95d 100644 --- a/app2/build.gradle +++ b/app2/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "app2" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports { diff --git a/app3/build.gradle b/app3/build.gradle index 0b447002..1e8aa26d 100755 --- a/app3/build.gradle +++ b/app3/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "app3" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports { diff --git a/build.gradle b/build.gradle index fff57af3..71015fa4 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,12 @@ subprojects { repositories { maven { url "https://repo.grails.org/grails/core" } mavenCentral() + if(groovyVersion.endsWith('-SNAPSHOT')) { + maven { + name = 'ASF Snapshot repo' + url = 'https://repository.apache.org/content/repositories/snapshots' + } + } } tasks.withType(Test) { diff --git a/datasources/build.gradle b/datasources/build.gradle index a0fe3812..e07245b6 100644 --- a/datasources/build.gradle +++ b/datasources/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,7 @@ group "datasources" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" + dependencyManagement { imports { diff --git a/gorm/build.gradle b/gorm/build.gradle index 715678df..d77af93a 100644 --- a/gorm/build.gradle +++ b/gorm/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "gorm" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports { diff --git a/gorm/grails-app/domain/gorm/ChildA.groovy b/gorm/grails-app/domain/gorm/ChildA.groovy index 35f2992b..611c8aa1 100644 --- a/gorm/grails-app/domain/gorm/ChildA.groovy +++ b/gorm/grails-app/domain/gorm/ChildA.groovy @@ -1,6 +1,6 @@ package gorm -// waiting on workaround for https://issues.apache.org/jira/browse/GROOVY-5106 -class ChildA /*extends AbstractParent*/ { + +class ChildA extends AbstractParent { int ageA diff --git a/gorm/grails-app/domain/gorm/ChildB.groovy b/gorm/grails-app/domain/gorm/ChildB.groovy index 571519a7..acadb04c 100644 --- a/gorm/grails-app/domain/gorm/ChildB.groovy +++ b/gorm/grails-app/domain/gorm/ChildB.groovy @@ -1,7 +1,6 @@ package gorm -// waiting on workaround for https://issues.apache.org/jira/browse/GROOVY-5106 -class ChildB /*extends AbstractParent*/ { +class ChildB extends AbstractParent { int ageB static constraints = { diff --git a/gorm/src/integration-test/groovy/gorm/AbstractParentSpec.groovy b/gorm/src/integration-test/groovy/gorm/AbstractParentSpec.groovy index 71664787..16624f8e 100644 --- a/gorm/src/integration-test/groovy/gorm/AbstractParentSpec.groovy +++ b/gorm/src/integration-test/groovy/gorm/AbstractParentSpec.groovy @@ -8,7 +8,6 @@ import spock.lang.* @Rollback class AbstractParentSpec extends Specification { - @PendingFeature(reason = 'count not equal to 2') void "Test that persisting a domain class with an abstract parent works"() { when:"An entity with an abstract parent is persisted" new ChildA(name:"A", ageA:10).save(flush:true) diff --git a/gradle.properties b/gradle.properties index ac978f86..ec1c393d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,26 +1,19 @@ assetPipelineVersion=5.0.1 -gebVersion=7.0 # used to pull latest -SNAPSHOT version grailsCoreBranch=7.0.x grailsGradlePluginVersion=7.0.0-SNAPSHOT grailsSitemesh3Version=7.0.0-SNAPSHOT # used by grails-gradle-plugin to force the groovy version -groovyVersion=4.0.23 +groovyVersion=4.0.24-SNAPSHOT jakartaXmlBindVersion=4.0.2 # no longer comes from grails-bom micronautVersion=4.6.5 micronautSerdeJacksonVersion=2.11.0 - -seleniumVersion=4.25.0 +gebPluginVersion=5.0.0-SNAPSHOT servletApiVersion=6.0.0 springSecurityCoreVersion=7.0.0-SNAPSHOT # required for org.grails.plugins:views-gradle version viewsVersion=4.0.0-SNAPSHOT -webdriverBinariesVersion=3.2 -chromeDriverVersion=126.0.6478.126 -geckodriverVersion=0.32.2 -seleniumSafariDriverVersion=4.25.0 - org.gradle.caching=true diff --git a/gradle/geb.gradle b/gradle/geb.gradle index ec96c8ec..6a9f5ed5 100644 --- a/gradle/geb.gradle +++ b/gradle/geb.gradle @@ -1,3 +1,3 @@ dependencies { - integrationTestImplementation testFixtures('org.grails.plugins:geb:5.0.0-SNAPSHOT') + integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion") } \ No newline at end of file diff --git a/hyphenated/build.gradle b/hyphenated/build.gradle index 7b42f625..004a4f65 100644 --- a/hyphenated/build.gradle +++ b/hyphenated/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "hyphenated" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports { diff --git a/issue-11102/build.gradle b/issue-11102/build.gradle index e6b4323d..95d744aa 100644 --- a/issue-11102/build.gradle +++ b/issue-11102/build.gradle @@ -5,7 +5,6 @@ buildscript { dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -16,7 +15,6 @@ apply plugin: "war" apply plugin: "asset-pipeline" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" assets { minifyJs = true diff --git a/issue-698-domain-save-npe/build.gradle b/issue-698-domain-save-npe/build.gradle index 216c82bc..3354856e 100644 --- a/issue-698-domain-save-npe/build.gradle +++ b/issue-698-domain-save-npe/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "grails301.domain.save.npe" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports { diff --git a/micronaut/build.gradle b/micronaut/build.gradle index 243431bb..1485b5f2 100644 --- a/micronaut/build.gradle +++ b/micronaut/build.gradle @@ -5,7 +5,6 @@ buildscript { dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" classpath "org.grails.plugins:hibernate5" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion" } } @@ -17,7 +16,6 @@ apply plugin:"eclipse" apply plugin:"idea" apply plugin:"war" apply plugin:"org.grails.grails-web" -apply plugin:"com.github.erdi.webdriver-binaries" apply plugin:"org.grails.grails-gsp" apply plugin:"com.bertramlabs.asset-pipeline" @@ -63,12 +61,6 @@ dependencies { testImplementation "org.grails:grails-gorm-testing-support" testImplementation "org.mockito:mockito-core" testImplementation "org.grails:grails-web-testing-support" - testImplementation "org.grails.plugins:geb" - testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" - testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" } bootRun { @@ -82,26 +74,9 @@ bootRun { systemProperty springProfilesActive, System.getProperty(springProfilesActive) } -webdriverBinaries { - if (!System.getenv().containsKey('CI')) { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" - } -} - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") - if (!System.getenv().containsKey('CI')) { - systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver') - systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver') - } else { - systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver" - systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver" - } -} - assets { minifyJs = true minifyCss = true -} \ No newline at end of file +} + +apply from: "${rootProject.projectDir}/gradle/geb.gradle" \ No newline at end of file diff --git a/namespaces/build.gradle b/namespaces/build.gradle index 8a6eeacb..16378c03 100644 --- a/namespaces/build.gradle +++ b/namespaces/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "com.github.erdi:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion" } } @@ -13,7 +12,6 @@ group "namespaces" apply plugin: "org.grails.grails-web" apply plugin: "org.grails.grails-gsp" -apply plugin: "com.github.erdi.webdriver-binaries" dependencyManagement { imports {