This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch wrapper-profiles-merge in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 9b8fa17d407da8109a829a582f6d0a670dfe6da3 Author: James Daugherty <[email protected]> AuthorDate: Wed Apr 30 20:01:49 2025 -0400 remove profile tests until they can be reworked as part of the test run --- grails-profiles/plugin-test/.travis.yml | 15 -- grails-profiles/plugin-test/README.md | 1 - grails-profiles/plugin-test/build.gradle | 180 ------------------- .../plugin-test/functional-tests/build.gradle | 41 ----- .../src/test/groovy/example/grails/HomePage.groovy | 10 -- .../src/test/groovy/example/grails/HomeSpec.groovy | 19 -- .../src/test/resources/GebConfig.groovy | 43 ----- grails-profiles/plugin-test/plugin.sh | 120 ------------- grails-profiles/plugin-test/profiles-install.sh | 44 ----- grails-profiles/plugin-test/runtests.sh | 33 ---- grails-profiles/rest-api-plugin-test/.travis.yml | 15 -- grails-profiles/rest-api-plugin-test/README.md | 1 - grails-profiles/rest-api-plugin-test/build.gradle | 191 --------------------- .../functional-tests/build.gradle | 41 ----- .../src/test/groovy/example/grails/HomePage.groovy | 10 -- .../src/test/groovy/example/grails/HomeSpec.groovy | 19 -- .../src/test/resources/GebConfig.groovy | 43 ----- .../rest-api-plugin-test/profiles-install.sh | 44 ----- .../rest-api-plugin-test/rest-api-plugin.sh | 176 ------------------- grails-profiles/rest-api-plugin-test/runtests.sh | 33 ---- grails-profiles/rest-api-test/.travis.yml | 15 -- grails-profiles/rest-api-test/README.md | 1 - grails-profiles/rest-api-test/build.gradle | 180 ------------------- .../rest-api-test/functional-tests/build.gradle | 25 --- .../src/test/groovy/example/grails/HomeSpec.groovy | 21 --- grails-profiles/rest-api-test/profiles-install.sh | 44 ----- grails-profiles/rest-api-test/rest-api.sh | 186 -------------------- grails-profiles/rest-api-test/runtests.sh | 27 --- grails-profiles/web-plugin-test/.travis.yml | 15 -- grails-profiles/web-plugin-test/README.md | 1 - grails-profiles/web-plugin-test/build.gradle | 191 --------------------- .../web-plugin-test/functional-tests/build.gradle | 41 ----- .../src/test/groovy/example/grails/HomePage.groovy | 10 -- .../src/test/groovy/example/grails/HomeSpec.groovy | 19 -- .../src/test/resources/GebConfig.groovy | 43 ----- .../web-plugin-test/profiles-install.sh | 46 ----- grails-profiles/web-plugin-test/runtests.sh | 33 ---- grails-profiles/web-plugin-test/web-plugin.sh | 152 ---------------- .../web-test/.github/workflows/gradle.yml | 44 ----- grails-profiles/web-test/.travis.yml | 19 -- grails-profiles/web-test/README.md | 1 - grails-profiles/web-test/build.gradle | 180 ------------------- .../web-test/functional-tests/build.gradle | 43 ----- .../src/test/groovy/example/grails/HomePage.groovy | 10 -- .../src/test/groovy/example/grails/HomeSpec.groovy | 19 -- .../src/test/resources/GebConfig.groovy | 43 ----- grails-profiles/web-test/profiles-install.sh | 44 ----- grails-profiles/web-test/runtests.sh | 33 ---- grails-profiles/web-test/web.sh | 168 ------------------ 49 files changed, 2733 deletions(-) diff --git a/grails-profiles/plugin-test/.travis.yml b/grails-profiles/plugin-test/.travis.yml deleted file mode 100644 index 179c6e775f..0000000000 --- a/grails-profiles/plugin-test/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -jdk: - - openjdk8 -addons: - chrome: stable - firefox: latest -install: ./profiles-install.sh -script: - - ./plugin.sh -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/grails-profiles/plugin-test/README.md b/grails-profiles/plugin-test/README.md deleted file mode 100644 index 2fae1e19cb..0000000000 --- a/grails-profiles/plugin-test/README.md +++ /dev/null @@ -1 +0,0 @@ -This repository tests the creation of a Grails application using the [plugin profile](https://github.com/grails-profiles/plugin). diff --git a/grails-profiles/plugin-test/build.gradle b/grails-profiles/plugin-test/build.gradle deleted file mode 100644 index dd25fca7c6..0000000000 --- a/grails-profiles/plugin-test/build.gradle +++ /dev/null @@ -1,180 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -plugins { - id "org.ajoberstar.grgit" version "3.0.0" - id 'base' -} - -ext { - grailsCoreBranch = 'master' - grailsWrapperBranch = 'master' - profilesSlug = 'grails-profiles' - profiles = [ - 'base', - 'plugin', - ] -} - -task deleteProfileApps { - doLast() { - profiles.each { new File(it).deleteDir() } - } -} -clean.dependsOn(deleteProfileApps) - -task cloneGrailsWrapper { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-wrapper".toString(), - uri: "https://github.com/apache/grails-wrapper.git", refToCheckout: grailsWrapperBranch) - } -} - -task cloneGrailsCore { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-core".toString(), - uri: "https://github.com/apache/grails-core.git", refToCheckout: grailsCoreBranch) - } -} - -task cloneProfiles { - doLast() { - profiles.each { String profile -> - def grgit = Grgit.clone(dir: "${buildDir}/${profile}".toString(), - uri: "https://github.com/${profilesSlug}/${profile}.git", refToCheckout: grailsCoreBranch) - } - } -} - -task publishBaseProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'base' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishPluginProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'plugin' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishGrailsCoreToMavenLocal(type: GradleBuild) { - dependsOn cloneGrailsCore - buildFile = "${buildDir}/grails-core/build.gradle" - tasks = ['assemble','publishToMavenLocal'] -} - -task publishReposToMavenLocal { - dependsOn publishBaseProfileToMavenLocal - dependsOn publishPluginProfileToMavenLocal - dependsOn publishGrailsCoreToMavenLocal -} - -task cloneRepos { - dependsOn cloneGrailsCore - dependsOn cloneProfiles -} - -task fixTests { - ext { - appFolders = [ - 'plugin', - ] - appPackage = 'demo' - unitTestFolder = 'src/test/groovy/' - integrationTestFolder = 'src/integration-test/groovy/' - unitTestName = 'Foo' - interceptorName = 'Company' - controllerNames = ['Company', 'Device'] - domainNames = ['Book', 'Employee', 'Device'] - resourceDomainName = 'Car' - serviceNames = ['Book', 'Device'] - taglibName = 'Currency' - integrationTest = 'Int' - functionalTest = 'Func' - } - - doLast() { - for (String domainClass : domainNames) { - String path - File f = appFolders.collect { - path = "${it}/grails-app/domain/${appPackage}/${domainClass}.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("class ${domainClass} {", "class ${domainClass} {\n String name") - f.text = text - } - - for (String spec : (["${interceptorName}Interceptor", - "${taglibName}TagLib", - "${resourceDomainName}", - "${unitTestName}"] + - [domainNames] + - controllerNames.collect { "${it}Controller" } + - serviceNames.collect { "${it}Service" } - ).flatten() - - ) { - String path - File f = appFolders.collect { - path = "${it}/${unitTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - text = text.replace("//params[\"name\"] = 'someValidName'", "params[\"name\"] = 'someValidName'") - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - for (String spec : ([integrationTest, functionalTest] + serviceNames.collect { "${it}Service" }).flatten()) { - String path - File f = appFolders.collect { - path = "${it}/${integrationTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - - Closure randName = { -> - new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} - } - - text = text.replace("//new ", "new ") - for ( String serviceName : serviceNames) { - text = text.replace("//${serviceName}", serviceName) - text = text.replace("${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}()", "${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}(name: '${randName()}')") - text = text.replace("//${serviceName.toLowerCase()}", serviceName.toLowerCase()) - } - - while (text.indexOf('...') != -1) { - String name = - text = text.replace("(...)", "(name: '${randName()}')") - } - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - } -} - -build.dependsOn cloneGrailsWrapper -build.dependsOn cloneRepos -build.dependsOn publishReposToMavenLocal diff --git a/grails-profiles/plugin-test/functional-tests/build.gradle b/grails-profiles/plugin-test/functional-tests/build.gradle deleted file mode 100644 index 5409126fa9..0000000000 --- a/grails-profiles/plugin-test/functional-tests/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id "com.energizedwork.webdriver-binaries" version "1.4" - id 'groovy' -} - -ext { - spockVersion = '1.2-groovy-2.4' - gebVersion = '2.3' - seleniumVersion = '3.14.0' - seleniumSafariDriverVersion='3.14.0' - chromeDriverVersion='2.44' - geckodriverVersion='0.23.0' -} - -repositories { - jcenter() -} - -dependencies { - testCompile "org.spockframework:spock-core:$spockVersion" - - compile "org.gebish:geb-spock:$gebVersion" - compile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - - testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" -} - -webdriverBinaries { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" -} - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - testLogging { - events "passed", "skipped", "failed" - exceptionFormat 'full' - } -} \ No newline at end of file diff --git a/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy b/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy deleted file mode 100644 index 6ac5044fe1..0000000000 --- a/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package example.grails - -import geb.Page - -class HomePage extends Page { - - static url = '/' - - static at = { title.contains('Grails') } -} diff --git a/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy b/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy deleted file mode 100644 index cbb61e8e71..0000000000 --- a/grails-profiles/plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package example.grails - -import geb.Browser -import geb.spock.GebSpec -import spock.lang.Requires - -class HomeSpec extends GebSpec { - - def "homepage title contains Grails"() { - given: - Browser browser = new Browser() - - when: - browser.to(HomePage) - - then: - at HomePage - } -} diff --git a/grails-profiles/plugin-test/functional-tests/src/test/resources/GebConfig.groovy b/grails-profiles/plugin-test/functional-tests/src/test/resources/GebConfig.groovy deleted file mode 100644 index f8ebfe9a7c..0000000000 --- a/grails-profiles/plugin-test/functional-tests/src/test/resources/GebConfig.groovy +++ /dev/null @@ -1,43 +0,0 @@ -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions -import org.openqa.selenium.firefox.FirefoxDriver -import org.openqa.selenium.firefox.FirefoxOptions -import org.openqa.selenium.safari.SafariDriver - -baseUrl = 'http://localhost:8080' - -environments { - - // You need to configure in Safari -> Develop -> Allowed Remote Automation - safari { - driver = { new SafariDriver() } - } - - // run via “./gradlew -Dgeb.env=chrome iT” - chrome { - driver = { new ChromeDriver() } - } - - // run via “./gradlew -Dgeb.env=chromeHeadless iT” - chromeHeadless { - driver = { - ChromeOptions o = new ChromeOptions() - o.addArguments('headless') - new ChromeDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefoxHeadless iT” - firefoxHeadless { - driver = { - FirefoxOptions o = new FirefoxOptions() - o.addArguments('-headless') - new FirefoxDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefox iT” - firefox { - driver = { new FirefoxDriver() } - } -} \ No newline at end of file diff --git a/grails-profiles/plugin-test/plugin.sh b/grails-profiles/plugin-test/plugin.sh deleted file mode 100755 index e978fd3164..0000000000 --- a/grails-profiles/plugin-test/plugin.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -cd plugin - -touch settings.gradle - -./grailsw assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw package || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw war || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw bug-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw clean || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw compile || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-command awesome || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Book || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-script scripto || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-unit-test Foo || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw dependency-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw list-plugins || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw plugin-info geb || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw stats || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -# Plugin profile - -./grailsw package-plugin || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw install || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -./gradlew fixTests || EXIT_STATUS=$? - -cd plugin - -./grailsw test-app || EXIT_STATUS=$? - -cd .. - -rm -rf plugin - -exit $EXIT_STATUS diff --git a/grails-profiles/plugin-test/profiles-install.sh b/grails-profiles/plugin-test/profiles-install.sh deleted file mode 100755 index c8a5f2abeb..0000000000 --- a/grails-profiles/plugin-test/profiles-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -curl -s get.sdkman.io | bash - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -echo sdkman_auto_answer=true > ~/.sdkman/etc/config - -source "/home/travis/.sdkman/bin/sdkman-init.sh" - -./gradlew build --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd build/grails-wrapper/ - -./gradlew assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd ../../ - -mkdir -p $HOME/.grails/wrapper - -cp /home/travis/build/grails-profiles-tests/plugin/build/grails-wrapper/wrapper/build/libs/grails4_1-wrapper-3.0.0.BUILD-SNAPSHOT.jar $HOME/.grails/wrapper/grails4-wrapper.jar - -sdk install grails dev /home/travis/build/grails-profiles-tests/plugin/build/grails-core - -sdk install grails - -sdk use grails dev - -grails --version - -grails create-app demo.plugin --profile=plugin - -exit $EXIT_STATUS diff --git a/grails-profiles/plugin-test/runtests.sh b/grails-profiles/plugin-test/runtests.sh deleted file mode 100755 index 0deda1e98e..0000000000 --- a/grails-profiles/plugin-test/runtests.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -e -EXIT_STATUS=0 - -start=`date +%s` - -echo "Starting client and server" -./gradlew bootRun -parallel --console=plain & -PID1=$! - -echo "Waiting 50 seconds for client and server to start" - -sleep 50 - -echo "Executing tests" - -./gradlew --rerun-tasks -Dgeb.env=chromeHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./gradlew --rerun-tasks -Dgeb.env=firefoxHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -killall -9 java - -end=`date +%s` -runtime=$((end-start)) -echo "execution took $runtime seconds" diff --git a/grails-profiles/rest-api-plugin-test/.travis.yml b/grails-profiles/rest-api-plugin-test/.travis.yml deleted file mode 100644 index 664e97b88d..0000000000 --- a/grails-profiles/rest-api-plugin-test/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -jdk: - - openjdk8 -addons: - chrome: stable - firefox: latest -install: ./profiles-install.sh -script: - - ./rest-api-plugin.sh -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/grails-profiles/rest-api-plugin-test/README.md b/grails-profiles/rest-api-plugin-test/README.md deleted file mode 100644 index 363af8ca6e..0000000000 --- a/grails-profiles/rest-api-plugin-test/README.md +++ /dev/null @@ -1 +0,0 @@ -This repository tests the creation of a Grails application using the [rest-api-plugin profile](https://github.com/grails-profiles/rest-api-plugin). diff --git a/grails-profiles/rest-api-plugin-test/build.gradle b/grails-profiles/rest-api-plugin-test/build.gradle deleted file mode 100644 index c8fdeca763..0000000000 --- a/grails-profiles/rest-api-plugin-test/build.gradle +++ /dev/null @@ -1,191 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -plugins { - id "org.ajoberstar.grgit" version "3.0.0" - id 'base' -} - -ext { - grailsCoreBranch = 'master' - grailsWrapperBranch = 'master' - profilesSlug = 'grails-profiles' - profiles = [ - 'base', - 'plugin', - 'rest-api-plugin', - ] -} - -task deleteProfileApps { - doLast() { - profiles.each { new File(it).deleteDir() } - } -} -clean.dependsOn(deleteProfileApps) - -task cloneGrailsWrapper { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-wrapper".toString(), - uri: "https://github.com/apache/grails-wrapper.git", refToCheckout: grailsWrapperBranch) - } -} - -task cloneGrailsCore { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-core".toString(), - uri: "https://github.com/apache/grails-core.git", refToCheckout: grailsCoreBranch) - } -} - -task cloneProfiles { - doLast() { - profiles.each { String profile -> - def grgit = Grgit.clone(dir: "${buildDir}/${profile}".toString(), - uri: "https://github.com/${profilesSlug}/${profile}.git", refToCheckout: grailsCoreBranch) - } - } -} - -task publishBaseProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'base' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishRestApiPluginProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'rest-api-plugin' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishPluginProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'plugin' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishGrailsCoreToMavenLocal(type: GradleBuild) { - dependsOn cloneGrailsCore - buildFile = "${buildDir}/grails-core/build.gradle" - tasks = ['assemble','publishToMavenLocal'] -} - -task publishReposToMavenLocal { - dependsOn publishBaseProfileToMavenLocal - dependsOn publishPluginProfileToMavenLocal - dependsOn publishRestApiPluginProfileToMavenLocal - dependsOn publishGrailsCoreToMavenLocal -} - -task cloneRepos { - dependsOn cloneGrailsCore - dependsOn cloneProfiles -} - -task fixTests { - ext { - appFolders = [ - 'rest-api-plugin', - ] - appPackage = 'demo' - unitTestFolder = 'src/test/groovy/' - integrationTestFolder = 'src/integration-test/groovy/' - unitTestName = 'Foo' - interceptorName = 'Company' - controllerNames = ['Company', 'Device'] - domainNames = ['Book', 'Employee', 'Device'] - resourceDomainName = 'Car' - serviceNames = ['Book', 'Device'] - taglibName = 'Currency' - integrationTest = 'Int' - functionalTest = 'Func' - } - - doLast() { - for (String domainClass : domainNames) { - String path - File f = appFolders.collect { - path = "${it}/grails-app/domain/${appPackage}/${domainClass}.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("class ${domainClass} {", "class ${domainClass} {\n String name") - f.text = text - } - - for (String spec : (["${interceptorName}Interceptor", - "${taglibName}TagLib", - "${resourceDomainName}", - "${unitTestName}"] + - [domainNames] + - controllerNames.collect { "${it}Controller" } + - serviceNames.collect { "${it}Service" } - ).flatten() - - ) { - String path - File f = appFolders.collect { - path = "${it}/${unitTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - text = text.replace("//params[\"name\"] = 'someValidName'", "params[\"name\"] = 'someValidName'") - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - for (String spec : ([integrationTest, functionalTest] + serviceNames.collect { "${it}Service" }).flatten()) { - String path - File f = appFolders.collect { - path = "${it}/${integrationTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - - Closure randName = { -> - new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} - } - - text = text.replace("//new ", "new ") - for ( String serviceName : serviceNames) { - text = text.replace("//${serviceName}", serviceName) - text = text.replace("${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}()", "${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}(name: '${randName()}')") - text = text.replace("//${serviceName.toLowerCase()}", serviceName.toLowerCase()) - } - - while (text.indexOf('...') != -1) { - String name = - text = text.replace("(...)", "(name: '${randName()}')") - } - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - } -} - -build.dependsOn cloneGrailsWrapper -build.dependsOn cloneRepos -build.dependsOn publishReposToMavenLocal diff --git a/grails-profiles/rest-api-plugin-test/functional-tests/build.gradle b/grails-profiles/rest-api-plugin-test/functional-tests/build.gradle deleted file mode 100644 index 5409126fa9..0000000000 --- a/grails-profiles/rest-api-plugin-test/functional-tests/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id "com.energizedwork.webdriver-binaries" version "1.4" - id 'groovy' -} - -ext { - spockVersion = '1.2-groovy-2.4' - gebVersion = '2.3' - seleniumVersion = '3.14.0' - seleniumSafariDriverVersion='3.14.0' - chromeDriverVersion='2.44' - geckodriverVersion='0.23.0' -} - -repositories { - jcenter() -} - -dependencies { - testCompile "org.spockframework:spock-core:$spockVersion" - - compile "org.gebish:geb-spock:$gebVersion" - compile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - - testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" -} - -webdriverBinaries { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" -} - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - testLogging { - events "passed", "skipped", "failed" - exceptionFormat 'full' - } -} \ No newline at end of file diff --git a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy b/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy deleted file mode 100644 index 6ac5044fe1..0000000000 --- a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package example.grails - -import geb.Page - -class HomePage extends Page { - - static url = '/' - - static at = { title.contains('Grails') } -} diff --git a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy b/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy deleted file mode 100644 index cbb61e8e71..0000000000 --- a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package example.grails - -import geb.Browser -import geb.spock.GebSpec -import spock.lang.Requires - -class HomeSpec extends GebSpec { - - def "homepage title contains Grails"() { - given: - Browser browser = new Browser() - - when: - browser.to(HomePage) - - then: - at HomePage - } -} diff --git a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/resources/GebConfig.groovy b/grails-profiles/rest-api-plugin-test/functional-tests/src/test/resources/GebConfig.groovy deleted file mode 100644 index f8ebfe9a7c..0000000000 --- a/grails-profiles/rest-api-plugin-test/functional-tests/src/test/resources/GebConfig.groovy +++ /dev/null @@ -1,43 +0,0 @@ -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions -import org.openqa.selenium.firefox.FirefoxDriver -import org.openqa.selenium.firefox.FirefoxOptions -import org.openqa.selenium.safari.SafariDriver - -baseUrl = 'http://localhost:8080' - -environments { - - // You need to configure in Safari -> Develop -> Allowed Remote Automation - safari { - driver = { new SafariDriver() } - } - - // run via “./gradlew -Dgeb.env=chrome iT” - chrome { - driver = { new ChromeDriver() } - } - - // run via “./gradlew -Dgeb.env=chromeHeadless iT” - chromeHeadless { - driver = { - ChromeOptions o = new ChromeOptions() - o.addArguments('headless') - new ChromeDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefoxHeadless iT” - firefoxHeadless { - driver = { - FirefoxOptions o = new FirefoxOptions() - o.addArguments('-headless') - new FirefoxDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefox iT” - firefox { - driver = { new FirefoxDriver() } - } -} \ No newline at end of file diff --git a/grails-profiles/rest-api-plugin-test/profiles-install.sh b/grails-profiles/rest-api-plugin-test/profiles-install.sh deleted file mode 100755 index 6bbfe1b604..0000000000 --- a/grails-profiles/rest-api-plugin-test/profiles-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -curl -s get.sdkman.io | bash - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -echo sdkman_auto_answer=true > ~/.sdkman/etc/config - -source "/home/travis/.sdkman/bin/sdkman-init.sh" - -./gradlew build --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd build/grails-wrapper/ - -./gradlew assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd ../../ - -mkdir -p $HOME/.grails/wrapper - -cp /home/travis/build/grails-profiles-tests/rest-api-plugin/build/grails-wrapper/wrapper/build/libs/grails4_1-wrapper-3.0.0.BUILD-SNAPSHOT.jar $HOME/.grails/wrapper/grails4-wrapper.jar - -sdk install grails dev /home/travis/build/grails-profiles-tests/rest-api-plugin/build/grails-core - -sdk install grails - -sdk use grails dev - -grails --version - -grails create-app demo.rest-api-plugin --profile=rest-api-plugin - -exit $EXIT_STATUS diff --git a/grails-profiles/rest-api-plugin-test/rest-api-plugin.sh b/grails-profiles/rest-api-plugin-test/rest-api-plugin.sh deleted file mode 100755 index e1ddea4c2d..0000000000 --- a/grails-profiles/rest-api-plugin-test/rest-api-plugin.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -cd rest-api-plugin - -touch settings.gradle - -./grailsw assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw package || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw war || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw bug-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw clean || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw compile || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-command awesome || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Book || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-script scripto || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-service BookService || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-unit-test Foo || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw dependency-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw list-plugins || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw plugin-info geb || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw stats || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-controller Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-resource Car || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-functional-test Func || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-integration-test Int || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-interceptor Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Employee || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-restful-controller Employee || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -# Plugin profile - -./grailsw package-plugin || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw install || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -./gradlew fixTests || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd rest-api-plugin - -./grailsw test-app -unit || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -rm -rf rest-api-plugin - -exit $EXIT_STATUS \ No newline at end of file diff --git a/grails-profiles/rest-api-plugin-test/runtests.sh b/grails-profiles/rest-api-plugin-test/runtests.sh deleted file mode 100755 index 0deda1e98e..0000000000 --- a/grails-profiles/rest-api-plugin-test/runtests.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -e -EXIT_STATUS=0 - -start=`date +%s` - -echo "Starting client and server" -./gradlew bootRun -parallel --console=plain & -PID1=$! - -echo "Waiting 50 seconds for client and server to start" - -sleep 50 - -echo "Executing tests" - -./gradlew --rerun-tasks -Dgeb.env=chromeHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./gradlew --rerun-tasks -Dgeb.env=firefoxHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -killall -9 java - -end=`date +%s` -runtime=$((end-start)) -echo "execution took $runtime seconds" diff --git a/grails-profiles/rest-api-test/.travis.yml b/grails-profiles/rest-api-test/.travis.yml deleted file mode 100644 index 661e4645ce..0000000000 --- a/grails-profiles/rest-api-test/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -jdk: - - openjdk8 -addons: - chrome: stable - firefox: latest -install: ./profiles-install.sh -script: - - ./rest-api.sh -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/grails-profiles/rest-api-test/README.md b/grails-profiles/rest-api-test/README.md deleted file mode 100644 index 2ad3d7d133..0000000000 --- a/grails-profiles/rest-api-test/README.md +++ /dev/null @@ -1 +0,0 @@ -This repository tests the creation of a Grails application using the [rest-api profile](https://github.com/grails-profiles/rest-api). diff --git a/grails-profiles/rest-api-test/build.gradle b/grails-profiles/rest-api-test/build.gradle deleted file mode 100644 index 50964544a1..0000000000 --- a/grails-profiles/rest-api-test/build.gradle +++ /dev/null @@ -1,180 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -plugins { - id "org.ajoberstar.grgit" version "3.0.0" - id 'base' -} - -ext { - grailsCoreBranch = 'master' - grailsWrapperBranch = 'master' - profilesSlug = 'grails-profiles' - profiles = [ - 'base', - 'rest-api', - ] -} - -task deleteProfileApps { - doLast() { - profiles.each { new File(it).deleteDir() } - } -} -clean.dependsOn(deleteProfileApps) - -task cloneGrailsWrapper { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-wrapper".toString(), - uri: "https://github.com/apache/grails-wrapper.git", refToCheckout: grailsWrapperBranch) - } -} - -task cloneGrailsCore { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-core".toString(), - uri: "https://github.com/apache/grails-core.git", refToCheckout: grailsCoreBranch) - } -} - -task cloneProfiles { - doLast() { - profiles.each { String profile -> - def grgit = Grgit.clone(dir: "${buildDir}/${profile}".toString(), - uri: "https://github.com/${profilesSlug}/${profile}.git", refToCheckout: grailsCoreBranch) - } - } -} - -task publishBaseProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'base' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishRestApiProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'rest-api' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishGrailsCoreToMavenLocal(type: GradleBuild) { - dependsOn cloneGrailsCore - buildFile = "${buildDir}/grails-core/build.gradle" - tasks = ['assemble','publishToMavenLocal'] -} - -task publishReposToMavenLocal { - dependsOn publishBaseProfileToMavenLocal - dependsOn publishRestApiProfileToMavenLocal - dependsOn publishGrailsCoreToMavenLocal -} - -task cloneRepos { - dependsOn cloneGrailsCore - dependsOn cloneProfiles -} - -task fixTests { - ext { - appFolders = [ - 'multi/rest-api', - ] - appPackage = 'demo' - unitTestFolder = 'src/test/groovy/' - integrationTestFolder = 'src/integration-test/groovy/' - unitTestName = 'Foo' - interceptorName = 'Company' - controllerNames = ['Company', 'Device'] - domainNames = ['Book', 'Employee', 'Device'] - resourceDomainName = 'Car' - serviceNames = ['Book', 'Device'] - taglibName = 'Currency' - integrationTest = 'Int' - functionalTest = 'Func' - } - - doLast() { - for (String domainClass : domainNames) { - String path - File f = appFolders.collect { - path = "${it}/grails-app/domain/${appPackage}/${domainClass}.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("class ${domainClass} {", "class ${domainClass} {\n String name") - f.text = text - } - - for (String spec : (["${interceptorName}Interceptor", - "${taglibName}TagLib", - "${resourceDomainName}", - "${unitTestName}"] + - [domainNames] + - controllerNames.collect { "${it}Controller" } + - serviceNames.collect { "${it}Service" } - ).flatten() - - ) { - String path - File f = appFolders.collect { - path = "${it}/${unitTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - text = text.replace("//params[\"name\"] = 'someValidName'", "params[\"name\"] = 'someValidName'") - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - for (String spec : ([integrationTest, functionalTest] + serviceNames.collect { "${it}Service" }).flatten()) { - String path - File f = appFolders.collect { - path = "${it}/${integrationTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - - Closure randName = { -> - new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} - } - - text = text.replace("//new ", "new ") - for ( String serviceName : serviceNames) { - text = text.replace("//${serviceName}", serviceName) - text = text.replace("${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}()", "${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}(name: '${randName()}')") - text = text.replace("//${serviceName.toLowerCase()}", serviceName.toLowerCase()) - } - - while (text.indexOf('...') != -1) { - String name = - text = text.replace("(...)", "(name: '${randName()}')") - } - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - } -} - -build.dependsOn cloneGrailsWrapper -build.dependsOn cloneRepos -build.dependsOn publishReposToMavenLocal diff --git a/grails-profiles/rest-api-test/functional-tests/build.gradle b/grails-profiles/rest-api-test/functional-tests/build.gradle deleted file mode 100644 index 5005c8f42c..0000000000 --- a/grails-profiles/rest-api-test/functional-tests/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -plugins { - id "com.energizedwork.webdriver-binaries" version "1.4" - id 'groovy' -} - -ext { - spockVersion = '1.2-groovy-2.4' - micronautVersion = '1.0.3' -} - -repositories { - jcenter() -} - -dependencies { - testCompile "org.spockframework:spock-core:$spockVersion" - testCompile "io.micronaut:micronaut-http-client:$micronautVersion" -} - -tasks.withType(Test) { - testLogging { - events "passed", "skipped", "failed" - exceptionFormat 'full' - } -} \ No newline at end of file diff --git a/grails-profiles/rest-api-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy b/grails-profiles/rest-api-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy deleted file mode 100644 index 230261c14f..0000000000 --- a/grails-profiles/rest-api-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy +++ /dev/null @@ -1,21 +0,0 @@ -package example.grails - -import io.micronaut.http.HttpRequest -import io.micronaut.http.HttpResponse -import io.micronaut.http.HttpStatus -import io.micronaut.http.client.HttpClient -import spock.lang.Specification - -class HomeSpec extends Specification { - - def "root url returns 200"() { - given: - HttpClient client = HttpClient.create(new URL('http://localhost:8080')) - - when: - HttpResponse response = client.toBlocking().exchange(HttpRequest.GET('/')) - - then: - response.status() == HttpStatus.OK - } -} diff --git a/grails-profiles/rest-api-test/profiles-install.sh b/grails-profiles/rest-api-test/profiles-install.sh deleted file mode 100755 index 9e115ccb75..0000000000 --- a/grails-profiles/rest-api-test/profiles-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -curl -s get.sdkman.io | bash - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -echo sdkman_auto_answer=true > ~/.sdkman/etc/config - -source "/home/travis/.sdkman/bin/sdkman-init.sh" - -./gradlew build --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd build/grails-wrapper/ - -./gradlew assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd ../../ - -mkdir -p $HOME/.grails/wrapper - -cp /home/travis/build/grails-profiles-tests/rest-api/build/grails-wrapper/wrapper/build/libs/grails4_1-wrapper-3.0.0.BUILD-SNAPSHOT.jar $HOME/.grails/wrapper/grails4-wrapper.jar - -sdk install grails dev /home/travis/build/grails-profiles-tests/rest-api/build/grails-core - -sdk install grails - -sdk use grails dev - -grails --version - -grails create-app demo.rest-api --profile=rest-api - -exit $EXIT_STATUS diff --git a/grails-profiles/rest-api-test/rest-api.sh b/grails-profiles/rest-api-test/rest-api.sh deleted file mode 100755 index a5e4116f98..0000000000 --- a/grails-profiles/rest-api-test/rest-api.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -mkdir multi - -mv rest-api multi/rest-api - -mv multi/rest-api/gradle multi/gradle - -mv multi/rest-api/gradlew multi/gradlew - -mv multi/rest-api/gradlew.bat multi/gradlew.bat - -cp -r functional-tests multi/ - -cp runtests.sh multi/ - -cd multi - -touch settings.gradle - -echo "include 'rest-api', 'functional-tests'" >> settings.gradle - -cd rest-api - -./grailsw assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw package || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw war || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw bug-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw clean || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw compile || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-command awesome || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Book || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-script scripto || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-service BookService || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-unit-test Foo || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw dependency-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw list-plugins || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw plugin-info geb || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw stats || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-controller Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-resource Car || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-functional-test Func || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-integration-test Int || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-interceptor Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Employee || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-restful-controller Employee || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -cd .. - -./gradlew fixTests || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd multi/rest-api - -./grailsw test-app || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -./runtests.sh - -cd .. - -rm -rf multi - -exit $EXIT_STATUS diff --git a/grails-profiles/rest-api-test/runtests.sh b/grails-profiles/rest-api-test/runtests.sh deleted file mode 100755 index 48d0787781..0000000000 --- a/grails-profiles/rest-api-test/runtests.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -e -EXIT_STATUS=0 - -start=`date +%s` - -echo "Starting client and server" -./gradlew bootRun -parallel --console=plain & -PID1=$! - -echo "Waiting 50 seconds for client and server to start" - -sleep 50 - -echo "Executing tests" - -./gradlew --rerun-tasks functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -killall -9 java - -end=`date +%s` -runtime=$((end-start)) -echo "execution took $runtime seconds" diff --git a/grails-profiles/web-plugin-test/.travis.yml b/grails-profiles/web-plugin-test/.travis.yml deleted file mode 100644 index ae456eeaa3..0000000000 --- a/grails-profiles/web-plugin-test/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -jdk: - - openjdk8 -addons: - chrome: stable - firefox: latest -install: ./profiles-install.sh -script: - - ./web-plugin.sh -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/grails-profiles/web-plugin-test/README.md b/grails-profiles/web-plugin-test/README.md deleted file mode 100644 index d762e7eddd..0000000000 --- a/grails-profiles/web-plugin-test/README.md +++ /dev/null @@ -1 +0,0 @@ -This repository tests the creation of a Grails application using the [web-plugin profile](https://github.com/grails-profiles/web-plugin). diff --git a/grails-profiles/web-plugin-test/build.gradle b/grails-profiles/web-plugin-test/build.gradle deleted file mode 100644 index 5a28532094..0000000000 --- a/grails-profiles/web-plugin-test/build.gradle +++ /dev/null @@ -1,191 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -plugins { - id "org.ajoberstar.grgit" version "3.0.0" - id 'base' -} - -ext { - profilesSlug = 'grails-profiles' - grailsCoreBranch = 'master' - grailsWrapperBranch = 'master' - profiles = [ - 'base', - 'plugin', - 'web-plugin', - ] -} - -task deleteProfileApps { - doLast() { - profiles.each { new File(it).deleteDir() } - } -} -clean.dependsOn(deleteProfileApps) - -task cloneGrailsWrapper { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-wrapper".toString(), - uri: "https://github.com/apache/grails-wrapper.git", refToCheckout: grailsWrapperBranch) - } -} - -task cloneGrailsCore { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-core".toString(), - uri: "https://github.com/apache/grails-core.git", refToCheckout: grailsCoreBranch) - } -} - -task cloneProfiles { - doLast() { - profiles.each { String profile -> - def grgit = Grgit.clone(dir: "${buildDir}/${profile}".toString(), - uri: "https://github.com/${profilesSlug}/${profile}.git", refToCheckout: grailsCoreBranch) - } - } -} - -task publishBaseProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'base' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishPluginProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'plugin' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishWebPluginProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'web-plugin' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishGrailsCoreToMavenLocal(type: GradleBuild) { - dependsOn cloneGrailsCore - buildFile = "${buildDir}/grails-core/build.gradle" - tasks = ['assemble','publishToMavenLocal'] -} - -task publishReposToMavenLocal { - dependsOn publishBaseProfileToMavenLocal - dependsOn publishPluginProfileToMavenLocal - dependsOn publishWebPluginProfileToMavenLocal - dependsOn publishGrailsCoreToMavenLocal -} - -task cloneRepos { - dependsOn cloneGrailsCore - dependsOn cloneProfiles -} - -task fixTests { - ext { - appFolders = [ - 'web-plugin', - ] - appPackage = 'demo' - unitTestFolder = 'src/test/groovy/' - integrationTestFolder = 'src/integration-test/groovy/' - unitTestName = 'Foo' - interceptorName = 'Company' - controllerNames = ['Company', 'Device'] - domainNames = ['Book', 'Employee', 'Device'] - resourceDomainName = 'Car' - serviceNames = ['Book', 'Device'] - taglibName = 'Currency' - integrationTest = 'Int' - functionalTest = 'Func' - } - - doLast() { - for (String domainClass : domainNames) { - String path - File f = appFolders.collect { - path = "${it}/grails-app/domain/${appPackage}/${domainClass}.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("class ${domainClass} {", "class ${domainClass} {\n String name") - f.text = text - } - - for (String spec : (["${interceptorName}Interceptor", - "${taglibName}TagLib", - "${resourceDomainName}", - "${unitTestName}"] + - [domainNames] + - controllerNames.collect { "${it}Controller" } + - serviceNames.collect { "${it}Service" } - ).flatten() - - ) { - String path - File f = appFolders.collect { - path = "${it}/${unitTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - text = text.replace("//params[\"name\"] = 'someValidName'", "params[\"name\"] = 'someValidName'") - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - for (String spec : ([integrationTest, functionalTest] + serviceNames.collect { "${it}Service" }).flatten()) { - String path - File f = appFolders.collect { - path = "${it}/${integrationTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - - Closure randName = { -> - new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} - } - - text = text.replace("//new ", "new ") - for ( String serviceName : serviceNames) { - text = text.replace("//${serviceName}", serviceName) - text = text.replace("${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}()", "${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}(name: '${randName()}')") - text = text.replace("//${serviceName.toLowerCase()}", serviceName.toLowerCase()) - } - - while (text.indexOf('...') != -1) { - String name = - text = text.replace("(...)", "(name: '${randName()}')") - } - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - } -} - -build.dependsOn cloneGrailsWrapper -build.dependsOn cloneRepos -build.dependsOn publishReposToMavenLocal diff --git a/grails-profiles/web-plugin-test/functional-tests/build.gradle b/grails-profiles/web-plugin-test/functional-tests/build.gradle deleted file mode 100644 index 5409126fa9..0000000000 --- a/grails-profiles/web-plugin-test/functional-tests/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id "com.energizedwork.webdriver-binaries" version "1.4" - id 'groovy' -} - -ext { - spockVersion = '1.2-groovy-2.4' - gebVersion = '2.3' - seleniumVersion = '3.14.0' - seleniumSafariDriverVersion='3.14.0' - chromeDriverVersion='2.44' - geckodriverVersion='0.23.0' -} - -repositories { - jcenter() -} - -dependencies { - testCompile "org.spockframework:spock-core:$spockVersion" - - compile "org.gebish:geb-spock:$gebVersion" - compile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - - testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" -} - -webdriverBinaries { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" -} - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - testLogging { - events "passed", "skipped", "failed" - exceptionFormat 'full' - } -} \ No newline at end of file diff --git a/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy b/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy deleted file mode 100644 index 6ac5044fe1..0000000000 --- a/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package example.grails - -import geb.Page - -class HomePage extends Page { - - static url = '/' - - static at = { title.contains('Grails') } -} diff --git a/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy b/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy deleted file mode 100644 index cbb61e8e71..0000000000 --- a/grails-profiles/web-plugin-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package example.grails - -import geb.Browser -import geb.spock.GebSpec -import spock.lang.Requires - -class HomeSpec extends GebSpec { - - def "homepage title contains Grails"() { - given: - Browser browser = new Browser() - - when: - browser.to(HomePage) - - then: - at HomePage - } -} diff --git a/grails-profiles/web-plugin-test/functional-tests/src/test/resources/GebConfig.groovy b/grails-profiles/web-plugin-test/functional-tests/src/test/resources/GebConfig.groovy deleted file mode 100644 index f8ebfe9a7c..0000000000 --- a/grails-profiles/web-plugin-test/functional-tests/src/test/resources/GebConfig.groovy +++ /dev/null @@ -1,43 +0,0 @@ -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions -import org.openqa.selenium.firefox.FirefoxDriver -import org.openqa.selenium.firefox.FirefoxOptions -import org.openqa.selenium.safari.SafariDriver - -baseUrl = 'http://localhost:8080' - -environments { - - // You need to configure in Safari -> Develop -> Allowed Remote Automation - safari { - driver = { new SafariDriver() } - } - - // run via “./gradlew -Dgeb.env=chrome iT” - chrome { - driver = { new ChromeDriver() } - } - - // run via “./gradlew -Dgeb.env=chromeHeadless iT” - chromeHeadless { - driver = { - ChromeOptions o = new ChromeOptions() - o.addArguments('headless') - new ChromeDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefoxHeadless iT” - firefoxHeadless { - driver = { - FirefoxOptions o = new FirefoxOptions() - o.addArguments('-headless') - new FirefoxDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefox iT” - firefox { - driver = { new FirefoxDriver() } - } -} \ No newline at end of file diff --git a/grails-profiles/web-plugin-test/profiles-install.sh b/grails-profiles/web-plugin-test/profiles-install.sh deleted file mode 100755 index 14c06efa15..0000000000 --- a/grails-profiles/web-plugin-test/profiles-install.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -curl -s get.sdkman.io | bash - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -echo sdkman_auto_answer=true > ~/.sdkman/etc/config - -source "/home/travis/.sdkman/bin/sdkman-init.sh" - -./gradlew build --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd build/grails-wrapper/ - -./gradlew assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd ../../ - -mkdir -p $HOME/.grails/wrapper - -cp /home/travis/build/grails-profiles-tests/web-plugin/build/grails-wrapper/wrapper/build/libs/grails4_1-wrapper-3.0.0.BUILD-SNAPSHOT.jar $HOME/.grails/wrapper/grails4-wrapper.jar - -sdk install grails dev /home/travis/build/grails-profiles-tests/web-plugin/build/grails-core - -sdk install grails - -sdk use grails dev - -grails --version - -grails create-app demo.web-plugin --profile=web-plugin - -echo "testingSupport.version=2.2.0.M2" >> web-plugin/gradle.properties - -exit $EXIT_STATUS diff --git a/grails-profiles/web-plugin-test/runtests.sh b/grails-profiles/web-plugin-test/runtests.sh deleted file mode 100755 index 0deda1e98e..0000000000 --- a/grails-profiles/web-plugin-test/runtests.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -e -EXIT_STATUS=0 - -start=`date +%s` - -echo "Starting client and server" -./gradlew bootRun -parallel --console=plain & -PID1=$! - -echo "Waiting 50 seconds for client and server to start" - -sleep 50 - -echo "Executing tests" - -./gradlew --rerun-tasks -Dgeb.env=chromeHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./gradlew --rerun-tasks -Dgeb.env=firefoxHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -killall -9 java - -end=`date +%s` -runtime=$((end-start)) -echo "execution took $runtime seconds" diff --git a/grails-profiles/web-plugin-test/web-plugin.sh b/grails-profiles/web-plugin-test/web-plugin.sh deleted file mode 100755 index 62d44f190e..0000000000 --- a/grails-profiles/web-plugin-test/web-plugin.sh +++ /dev/null @@ -1,152 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -cd web-plugin - -touch settings.gradle - -./grailsw assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw package || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw war || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw bug-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw clean || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw compile || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-command awesome || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Book || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-script scripto || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-service BookService || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-unit-test Foo || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw dependency-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw list-plugins || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw plugin-info geb || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw stats || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-controller Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-interceptor Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-taglib Currency || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -# Plugin profile - -./grailsw package-plugin || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw install || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -./gradlew fixTests || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd web-plugin - -./grailsw test-app || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -rm -rf web-plugin - -exit $EXIT_STATUS \ No newline at end of file diff --git a/grails-profiles/web-test/.github/workflows/gradle.yml b/grails-profiles/web-test/.github/workflows/gradle.yml deleted file mode 100644 index 3e623364fa..0000000000 --- a/grails-profiles/web-test/.github/workflows/gradle.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Java CI -on: - push: - branches: - - master - pull_request: - branches: - - master - workflow_dispatch: - schedule: - - cron: 0 12 * * 2 -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - java: ['8', '11', '14'] - env: - WORKSPACE: ${{ github.workspace }} - GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8 - steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Set up JDK - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'adopt' - - name: Install Profiles - run: | - [ -f ./profiles-install.sh ] && ./profiles-install.sh - - name: Configure JDK for Tests - uses: actions/setup-java@v2 - with: - java-version: ${{ matrix.java }} - distribution: 'adopt' - - name: Run Tests - run: | - [ -f ./web.sh ] && ./web.sh diff --git a/grails-profiles/web-test/.travis.yml b/grails-profiles/web-test/.travis.yml deleted file mode 100644 index 3d1b418d9b..0000000000 --- a/grails-profiles/web-test/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -branches: - only: - - 3.3.x - - 4.0.x -jdk: - - openjdk8 -addons: - chrome: stable - firefox: latest -install: ./profiles-install.sh -script: - - ./web.sh -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ diff --git a/grails-profiles/web-test/README.md b/grails-profiles/web-test/README.md deleted file mode 100644 index 04e3743822..0000000000 --- a/grails-profiles/web-test/README.md +++ /dev/null @@ -1 +0,0 @@ -This repository tests the creation of a Grails application using the [web profile](https://github.com/grails-profiles/web). \ No newline at end of file diff --git a/grails-profiles/web-test/build.gradle b/grails-profiles/web-test/build.gradle deleted file mode 100644 index 7a1a6fe6cf..0000000000 --- a/grails-profiles/web-test/build.gradle +++ /dev/null @@ -1,180 +0,0 @@ -import org.ajoberstar.grgit.Grgit - -plugins { - id "org.ajoberstar.grgit" version "3.0.0" - id 'base' -} - -ext { - grailsCoreBranch = 'master' - grailsWrapperBranch = 'master' - profilesSlug = 'grails-profiles' - profiles = [ - 'base', - 'web', - ] -} - -task deleteProfileApps { - doLast() { - profiles.each { new File(it).deleteDir() } - } -} -clean.dependsOn(deleteProfileApps) - -task cloneGrailsWrapper { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-wrapper".toString(), - uri: "https://github.com/apache/grails-wrapper.git", refToCheckout: grailsWrapperBranch) - } -} - -task cloneGrailsCore { - doLast() { - def grgit = Grgit.clone(dir: "${buildDir}/grails-core".toString(), - uri: "https://github.com/apache/grails-core.git", refToCheckout: grailsCoreBranch) - } -} - -task cloneProfiles { - doLast() { - profiles.each { String profile -> - def grgit = Grgit.clone(dir: "${buildDir}/${profile}".toString(), - uri: "https://github.com/${profilesSlug}/${profile}.git", refToCheckout: grailsCoreBranch) - } - } -} - -task publishBaseProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'base' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishWebProfileToMavenLocal(type: GradleBuild) { - dependsOn cloneProfiles - ext { - profileName = 'web' - } - buildFile = "${buildDir}/${profileName}/build.gradle" - tasks = ['publishToMavenLocal'] -} - -task publishGrailsCoreToMavenLocal(type: GradleBuild) { - dependsOn cloneGrailsCore - buildFile = "${buildDir}/grails-core/build.gradle" - tasks = ['assemble','publishToMavenLocal'] -} - -task publishReposToMavenLocal { - dependsOn publishBaseProfileToMavenLocal - dependsOn publishWebProfileToMavenLocal - dependsOn publishGrailsCoreToMavenLocal -} - -task cloneRepos { - dependsOn cloneGrailsCore - dependsOn cloneProfiles -} - -task fixTests { - ext { - appFolders = [ - 'multi/web', - ] - appPackage = 'demo' - unitTestFolder = 'src/test/groovy/' - integrationTestFolder = 'src/integration-test/groovy/' - unitTestName = 'Foo' - interceptorName = 'Company' - controllerNames = ['Company', 'Device'] - domainNames = ['Book', 'Employee', 'Device'] - resourceDomainName = 'Car' - serviceNames = ['Book', 'Device'] - taglibName = 'Currency' - integrationTest = 'Int' - functionalTest = 'Func' - } - - doLast() { - for (String domainClass : domainNames) { - String path - File f = appFolders.collect { - path = "${it}/grails-app/domain/${appPackage}/${domainClass}.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("class ${domainClass} {", "class ${domainClass} {\n String name") - f.text = text - } - - for (String spec : (["${interceptorName}Interceptor", - "${taglibName}TagLib", - "${resourceDomainName}", - "${unitTestName}"] + - [domainNames] + - controllerNames.collect { "${it}Controller" } + - serviceNames.collect { "${it}Service" } - ).flatten() - - ) { - String path - File f = appFolders.collect { - path = "${it}/${unitTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) - }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - text = text.replace("//params[\"name\"] = 'someValidName'", "params[\"name\"] = 'someValidName'") - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - for (String spec : ([integrationTest, functionalTest] + serviceNames.collect { "${it}Service" }).flatten()) { - String path - File f = appFolders.collect { - path = "${it}/${integrationTestFolder}/${appPackage}/${spec}Spec.groovy" - new File(path) }.find { it.exists() } - if (!f) { - println "${path} does not exists" - continue - } - String text = f.text - text = text.replace("true == false", "true == true") - - Closure randName = { -> - new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} - } - - text = text.replace("//new ", "new ") - for ( String serviceName : serviceNames) { - text = text.replace("//${serviceName}", serviceName) - text = text.replace("${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}()", "${serviceName} ${serviceName.toLowerCase()} = new ${serviceName}(name: '${randName()}')") - text = text.replace("//${serviceName.toLowerCase()}", serviceName.toLowerCase()) - } - - while (text.indexOf('...') != -1) { - String name = - text = text.replace("(...)", "(name: '${randName()}')") - } - text = text.replace("assert false, \"TODO:", "assert true, \"TODO:") - - f.text = text - } - } -} - -build.dependsOn cloneGrailsWrapper -build.dependsOn cloneRepos -build.dependsOn publishReposToMavenLocal diff --git a/grails-profiles/web-test/functional-tests/build.gradle b/grails-profiles/web-test/functional-tests/build.gradle deleted file mode 100644 index 0986e6153f..0000000000 --- a/grails-profiles/web-test/functional-tests/build.gradle +++ /dev/null @@ -1,43 +0,0 @@ -plugins { - id "com.energizedwork.webdriver-binaries" version "1.4" - id 'groovy' -} - -ext { - spockVersion = '2.0-M2-groovy-3.0' - gebVersion = '2.3' - seleniumVersion = '3.14.0' - seleniumSafariDriverVersion='3.14.0' - chromeDriverVersion='2.44' - geckodriverVersion='0.23.0' -} - -repositories { - jcenter() -} - -dependencies { - testCompile "org.spockframework:spock-core:$spockVersion" - - compile("org.gebish:geb-spock:$gebVersion") { - exclude module: "groovy-all" - } - compile "org.seleniumhq.selenium:selenium-support:$seleniumVersion" - - testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" - testRuntime "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion" -} - -webdriverBinaries { - chromedriver "$chromeDriverVersion" - geckodriver "$geckodriverVersion" -} - -tasks.withType(Test) { - systemProperty "geb.env", System.getProperty('geb.env') - testLogging { - events "passed", "skipped", "failed" - exceptionFormat 'full' - } -} diff --git a/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy b/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy deleted file mode 100644 index 6ac5044fe1..0000000000 --- a/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomePage.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package example.grails - -import geb.Page - -class HomePage extends Page { - - static url = '/' - - static at = { title.contains('Grails') } -} diff --git a/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy b/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy deleted file mode 100644 index cbb61e8e71..0000000000 --- a/grails-profiles/web-test/functional-tests/src/test/groovy/example/grails/HomeSpec.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package example.grails - -import geb.Browser -import geb.spock.GebSpec -import spock.lang.Requires - -class HomeSpec extends GebSpec { - - def "homepage title contains Grails"() { - given: - Browser browser = new Browser() - - when: - browser.to(HomePage) - - then: - at HomePage - } -} diff --git a/grails-profiles/web-test/functional-tests/src/test/resources/GebConfig.groovy b/grails-profiles/web-test/functional-tests/src/test/resources/GebConfig.groovy deleted file mode 100644 index f8ebfe9a7c..0000000000 --- a/grails-profiles/web-test/functional-tests/src/test/resources/GebConfig.groovy +++ /dev/null @@ -1,43 +0,0 @@ -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions -import org.openqa.selenium.firefox.FirefoxDriver -import org.openqa.selenium.firefox.FirefoxOptions -import org.openqa.selenium.safari.SafariDriver - -baseUrl = 'http://localhost:8080' - -environments { - - // You need to configure in Safari -> Develop -> Allowed Remote Automation - safari { - driver = { new SafariDriver() } - } - - // run via “./gradlew -Dgeb.env=chrome iT” - chrome { - driver = { new ChromeDriver() } - } - - // run via “./gradlew -Dgeb.env=chromeHeadless iT” - chromeHeadless { - driver = { - ChromeOptions o = new ChromeOptions() - o.addArguments('headless') - new ChromeDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefoxHeadless iT” - firefoxHeadless { - driver = { - FirefoxOptions o = new FirefoxOptions() - o.addArguments('-headless') - new FirefoxDriver(o) - } - } - - // run via “./gradlew -Dgeb.env=firefox iT” - firefox { - driver = { new FirefoxDriver() } - } -} \ No newline at end of file diff --git a/grails-profiles/web-test/profiles-install.sh b/grails-profiles/web-test/profiles-install.sh deleted file mode 100755 index e739ecf28d..0000000000 --- a/grails-profiles/web-test/profiles-install.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -curl -s get.sdkman.io | bash - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -echo sdkman_auto_answer=true > ~/.sdkman/etc/config - -source "$HOME/.sdkman/bin/sdkman-init.sh" - -./gradlew build --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd build/grails-wrapper/ - -./gradlew assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd ../../ - -mkdir -p $HOME/.grails/wrapper - -cp $GITHUB_WORKSPACE/build/grails-wrapper/wrapper/build/libs/grails5-wrapper-3.0.0-SNAPSHOT.jar $HOME/.grails/wrapper/grails5-wrapper.jar - -sdk install grails dev $GITHUB_WORKSPACE/build/grails-core - -sdk install grails - -sdk use grails dev - -grails --version - -grails create-app demo.webapp - -exit $EXIT_STATUS diff --git a/grails-profiles/web-test/runtests.sh b/grails-profiles/web-test/runtests.sh deleted file mode 100755 index 0deda1e98e..0000000000 --- a/grails-profiles/web-test/runtests.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -e -EXIT_STATUS=0 - -start=`date +%s` - -echo "Starting client and server" -./gradlew bootRun -parallel --console=plain & -PID1=$! - -echo "Waiting 50 seconds for client and server to start" - -sleep 50 - -echo "Executing tests" - -./gradlew --rerun-tasks -Dgeb.env=chromeHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./gradlew --rerun-tasks -Dgeb.env=firefoxHeadless functional-tests:test --console=plain || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -killall -9 java - -end=`date +%s` -runtime=$((end-start)) -echo "execution took $runtime seconds" diff --git a/grails-profiles/web-test/web.sh b/grails-profiles/web-test/web.sh deleted file mode 100755 index 2d7072f589..0000000000 --- a/grails-profiles/web-test/web.sh +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash -set -e - -EXIT_STATUS=0 - -mkdir multi - -mv webapp multi/webapp - -mv multi/webapp/gradle multi/gradle - -mv multi/webapp/gradlew multi/gradlew - -mv multi/webapp/gradlew.bat multi/gradlew.bat - -cp -r functional-tests multi/ - -cp runtests.sh multi/ - -cd multi - -touch settings.gradle - -echo "include 'webapp', 'functional-tests'" >> settings.gradle - -cd webapp - -./grailsw assemble || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw package || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw war || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw bug-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw clean || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw compile || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-command awesome || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-domain-class Book || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-script scripto || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-service BookService || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-unit-test Foo || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw dependency-report || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw list-plugins || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw plugin-info geb || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw stats || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-controller Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-integration-test Int || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-interceptor Company || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -./grailsw create-taglib Currency || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -cd .. - -./gradlew fixTests || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd multi/webapp - -./grailsw test-app || EXIT_STATUS=$? - -if [ $EXIT_STATUS -ne 0 ]; then - exit $EXIT_STATUS -fi - -cd .. - -./runtests.sh - -cd .. - -rm -rf multi - -exit $EXIT_STATUS
