diff --git a/.circleci/config.yml b/.circleci/config.yml index 003cd72..edafc10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.0 jobs: build: docker: - - image: circleci/openjdk:8-jdk + - image: cimg/openjdk:17.0 working_directory: ~/repo environment: JVM_OPTS: -Xmx4096m @@ -23,10 +23,10 @@ jobs: key: v1-dependencies-{{ checksum "build.gradle" }} - run: name: Run tests - command: GRADLE_OPTS="-Xms256m -Xmx2048m" ./gradlew build --no-daemon --scan + command: GRADLE_OPTS="-Xms256m -Xmx2048m" ./gradlew build --no-daemon - run: name: Code coverage - command: GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew jacocoTestReport coveralls --no-daemon --scan + command: GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew jacocoTestReport coveralls --no-daemon - run: name: Save reports command: | @@ -47,7 +47,7 @@ jobs: publish: docker: - - image: circleci/openjdk:8-jdk + - image: cimg/openjdk:17.0 working_directory: ~/repo environment: JVM_OPTS: -Xmx3200m @@ -68,7 +68,7 @@ jobs: - run: name: Publish plugin command: - GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew clean publishPlugins --no-daemon --scan + GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew clean publishPlugins --no-daemon -Pgradle.publish.key=${GRADLE_PUBLISH_KEY} -Pgradle.publish.secret=${GRADLE_PUBLISH_SECRET} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..411c077 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto eol=lf + +*.bat text eol=crlf +*.jar binary diff --git a/CHANGELOG.md b/CHANGELOG.md index b2a0f76..e8f86ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,26 @@ # Changelog -## [v3.2.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v3.2.0) (2022-02-27) +## [v4.0.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v4.0.0) (2023-10-11) -[Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v3.1.0...v3.2.0) +[Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v3.2.0...v4.0.0) -**Implemented enhancements:** +**Fixed bugs:** -- Add filter: hide regular passing tests, show slow passing tests [\#158](https://github.com/radarsh/gradle-test-logger-plugin/issues/158) +- The `Provider.forUseAtConfigurationTime` method has been deprecated. [\#321](https://github.com/radarsh/gradle-test-logger-plugin/issues/321) + +**Closed issues:** + +- Upgrade to Gradle 7.5.x [\#295](https://github.com/radarsh/gradle-test-logger-plugin/issues/295) **Merged pull requests:** +- Update compatibility matrix [\#323](https://github.com/radarsh/gradle-test-logger-plugin/pull/323) ([radarsh](https://github.com/radarsh)) +- Adopt Gradle 8 [\#322](https://github.com/radarsh/gradle-test-logger-plugin/pull/322) ([Goooler](https://github.com/Goooler)) +- Upgrade to plugin publish 1.0.0 [\#298](https://github.com/radarsh/gradle-test-logger-plugin/pull/298) ([radarsh](https://github.com/radarsh)) +- Bump dependency versions [\#297](https://github.com/radarsh/gradle-test-logger-plugin/pull/297) ([radarsh](https://github.com/radarsh)) +- Upgrade to Gradle 7.5.1 [\#296](https://github.com/radarsh/gradle-test-logger-plugin/pull/296) ([radarsh](https://github.com/radarsh)) +- Bump Gradle enterprise plugin version [\#294](https://github.com/radarsh/gradle-test-logger-plugin/pull/294) ([radarsh](https://github.com/radarsh)) +- Bump com.gradle.enterprise from 3.8.1 to 3.11.2 [\#293](https://github.com/radarsh/gradle-test-logger-plugin/pull/293) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump byte-buddy from 1.12.6 to 1.12.7 [\#255](https://github.com/radarsh/gradle-test-logger-plugin/pull/255) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump com.gradle.enterprise from 3.8 to 3.8.1 [\#254](https://github.com/radarsh/gradle-test-logger-plugin/pull/254) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump com.gradle.plugin-publish from 0.18.0 to 0.19.0 [\#251](https://github.com/radarsh/gradle-test-logger-plugin/pull/251) ([dependabot[bot]](https://github.com/apps/dependabot)) @@ -21,6 +32,14 @@ - Bump com.gradle.plugin-publish from 0.16.0 to 0.17.0 [\#238](https://github.com/radarsh/gradle-test-logger-plugin/pull/238) ([dependabot[bot]](https://github.com/apps/dependabot)) - adds filter for showing only slow tests [\#207](https://github.com/radarsh/gradle-test-logger-plugin/pull/207) ([grimmjo](https://github.com/grimmjo)) +## [v3.2.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v3.2.0) (2022-02-27) + +[Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v3.1.0...v3.2.0) + +**Implemented enhancements:** + +- Add filter: hide regular passing tests, show slow passing tests [\#158](https://github.com/radarsh/gradle-test-logger-plugin/issues/158) + ## [v3.1.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v3.1.0) (2021-11-02) [Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v3.0.0...v3.1.0) @@ -87,7 +106,7 @@ - Bump com.github.kt3k.coveralls from 2.9.0 to 2.11.0 [\#194](https://github.com/radarsh/gradle-test-logger-plugin/pull/194) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Bump byte-buddy from 1.10.17 to 1.10.22 [\#193](https://github.com/radarsh/gradle-test-logger-plugin/pull/193) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Bump com.gradle.plugin-publish from 0.12.0 to 0.13.0 [\#189](https://github.com/radarsh/gradle-test-logger-plugin/pull/189) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) -- Fix for NPE when the exception in the TestResult is null. [\#180](https://github.com/radarsh/gradle-test-logger-plugin/pull/180) ([osh-onstructive](https://github.com/osh-onstructive)) +- Fix for NPE when the exception in the TestResult is null. [\#180](https://github.com/radarsh/gradle-test-logger-plugin/pull/180) ([osh-zuri](https://github.com/osh-zuri)) - Bump byte-buddy from 1.10.1 to 1.10.17 [\#176](https://github.com/radarsh/gradle-test-logger-plugin/pull/176) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Bump commons-io from 2.6 to 2.8.0 [\#174](https://github.com/radarsh/gradle-test-logger-plugin/pull/174) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) - Upgrade to Gradle 6.7 [\#173](https://github.com/radarsh/gradle-test-logger-plugin/pull/173) ([radarsh](https://github.com/radarsh)) diff --git a/README.md b/README.md index 646224e..09f2654 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Scroll down for more themes and customisation options or visit the [screenshots ```groovy plugins { - id 'com.adarshr.test-logger' version '3.2.0' + id 'com.adarshr.test-logger' version '4.0.0' } ``` @@ -41,7 +41,7 @@ buildscript { } } dependencies { - classpath 'com.adarshr:gradle-test-logger-plugin:3.2.0' + classpath 'com.adarshr:gradle-test-logger-plugin:4.0.0' } } @@ -50,11 +50,12 @@ apply plugin: 'com.adarshr.test-logger' ### Compatibility matrix -| Test logger version | Minimum Gradle version | -|---------------------|-----------------------------| -| 1.x | 4.x | -| 2.x | 5.x | -| 3.x | 6.5 | +| Test logger version | Minimum Gradle version | +|---------------------|------------------------| +| 1.x | 4.x | +| 2.x | 5.x | +| 3.x | 6.5 | +| 4.x | 7.6 | ## Configuration diff --git a/build.gradle b/build.gradle index 44e0f4c..22b6c0f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,8 +11,8 @@ plugins { id 'maven-publish' id 'idea' id 'jacoco' - id 'com.gradle.plugin-publish' version '0.19.0' - id 'com.github.kt3k.coveralls' version '2.12.0' + id 'com.gradle.plugin-publish' version '1.2.1' + id 'com.github.kt3k.coveralls' version '2.12.2' } def thisPlugin = @@ -23,10 +23,6 @@ apply from: 'gradle/publishing.gradle' apply from: 'gradle/coverage.gradle' apply plugin: thisPlugin -repositories { - mavenCentral() -} - sourceSets { functionalTest { groovy { @@ -38,20 +34,23 @@ sourceSets { } dependencies { - implementation gradleApi() - implementation localGroovy() + compileOnly gradleApi() + compileOnly localGroovy() implementation 'org.fusesource.jansi:jansi:2.4.0' testImplementation gradleTestKit() testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' - testImplementation 'net.bytebuddy:byte-buddy:1.12.7' - testImplementation 'org.objenesis:objenesis:3.2' - testImplementation 'commons-io:commons-io:2.11.0' + testImplementation 'net.bytebuddy:byte-buddy:1.14.9' + testImplementation 'org.objenesis:objenesis:3.3' + testImplementation 'commons-io:commons-io:2.14.0' - functionalTestImplementation localGroovy() functionalTestImplementation gradleTestKit() functionalTestImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' - functionalTestImplementation 'commons-io:commons-io:2.11.0' + functionalTestImplementation 'commons-io:commons-io:2.14.0' +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(8) } gradlePlugin { @@ -69,7 +68,7 @@ idea { } } -test { +tasks.named("test") { useJUnitPlatform() testClassesDirs += sourceSets.functionalTest.output.classesDirs @@ -83,7 +82,9 @@ test { exclude 'com/adarshr/gradle/testlogger/functional/**' } -task functionalTest(type: Test) { +tasks.register("functionalTest", Test) { + dependsOn 'pluginUnderTestMetadata', 'testClasses' + useJUnitPlatform() inputs.dir "$projectDir/src/test-functional/resources" @@ -101,6 +102,6 @@ task functionalTest(type: Test) { include 'com/adarshr/gradle/testlogger/functional/**' } -tasks.check.dependsOn 'functionalTest' -tasks.functionalTest.dependsOn 'pluginUnderTestMetadata', 'testClasses' -tasks.functionalTest.mustRunAfter 'test' +tasks.named("check") { + dependsOn("functionalTest") +} diff --git a/gradle.properties b/gradle.properties index ac01c78..3a038f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,6 @@ -version=3.2.0 +version=4.0.0 group=com.adarshr -org.gradle.daemon=true + +org.gradle.jvmargs=-Dfile.encoding=UTF-8 org.gradle.caching=false org.gradle.parallel=true diff --git a/gradle/coverage.gradle b/gradle/coverage.gradle index c0fad67..a681ec4 100644 --- a/gradle/coverage.gradle +++ b/gradle/coverage.gradle @@ -1,9 +1,9 @@ jacoco { - toolVersion '0.8.5' + toolVersion '0.8.10' } jacocoTestReport { - executionData "${project.buildDir}/jacoco/test.exec", "${project.buildDir}/jacoco/functionalTest.exec" + executionData layout.buildDirectory.file("jacoco/test.exec").get().asFile, layout.buildDirectory.file("jacoco/functionalTest.exec").get().asFile reports { xml.required = true diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle index d98054b..0bf8369 100644 --- a/gradle/publishing.gradle +++ b/gradle/publishing.gradle @@ -1,35 +1,15 @@ -task sourceJar(type: Jar) { - archiveClassifier.set('sources') - from sourceSets.main.allSource -} - -publishing { - publications { - module(MavenPublication) { - from components.java - - artifact(sourceJar) { - classifier = 'sources' - } - } - } -} - -pluginBundle { +gradlePlugin { website = 'https://github.com/radarsh/gradle-test-logger-plugin' vcsUrl = 'https://github.com/radarsh/gradle-test-logger-plugin' - description = 'A Gradle plugin for printing beautiful logs on the console while running tests' - tags = ['test', 'logging', 'console', 'terminal', 'groovy'] plugins { testLoggerPlugin { id = 'com.adarshr.test-logger' displayName = 'Gradle Test Logger Plugin' + description = 'A Gradle plugin for printing beautiful logs on the console while running tests' + implementationClass = 'com.adarshr.gradle.testlogger.TestLoggerPlugin' + description = 'A Gradle plugin for printing beautiful logs on the console while running tests' + tags = ['test', 'logging', 'console', 'terminal', 'groovy'] } } - - mavenCoordinates { - groupId = project.group - artifactId = project.name - } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a0f7639..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c787..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ @@ -205,6 +214,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd3..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..906c402 --- /dev/null +++ b/renovate.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ], + "packageRules": [ + { + "groupName": "Spek2", + "matchPackagePrefixes": [ + "org.spekframework.spek2" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 8ad8296..4fe8f54 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,11 +1,27 @@ +pluginManagement { + repositories { + gradlePluginPortal() + } +} + plugins { - id 'com.gradle.enterprise' version '3.8.1' + id 'com.gradle.enterprise' version '3.15.1' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' } +dependencyResolutionManagement { + repositories { + mavenCentral() + } +} + +def isCiBuild = providers.environmentVariable("CI").isPresent() + gradleEnterprise { buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service' termsOfServiceAgree = 'yes' + publishAlwaysIf(isCiBuild) } } diff --git a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy index ca4034d..16bff18 100644 --- a/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy +++ b/src/main/groovy/com/adarshr/gradle/testlogger/TestLoggerExtension.groovy @@ -71,7 +71,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { ThemeType getTheme() { providers.systemProperty('testlogger.theme') - .forUseAtConfigurationTime() .map { ThemeType.fromName(it) } .orElse(theme) .orElse(projectExtension.@theme) @@ -80,7 +79,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { LogLevel getLogLevel() { providers.systemProperty('testlogger.logLevel') - .forUseAtConfigurationTime() .map { LogLevel.valueOf(it.toUpperCase()) } .orElse(logLevel) .orElse(projectExtension.@logLevel) @@ -89,7 +87,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowExceptions() { providers.systemProperty('testlogger.showExceptions') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showExceptions) .orElse(projectExtension.@showExceptions) @@ -101,7 +98,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowCauses() { providers.systemProperty('testlogger.showCauses') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showCauses) .orElse(projectExtension.@showCauses) @@ -113,7 +109,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowStackTraces() { providers.systemProperty('testlogger.showStackTraces') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showStackTraces) .orElse(projectExtension.@showStackTraces) @@ -125,7 +120,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowFullStackTraces() { providers.systemProperty('testlogger.showFullStackTraces') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showFullStackTraces) .orElse(projectExtension.@showFullStackTraces) @@ -137,7 +131,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Long getSlowThreshold() { providers.systemProperty('testlogger.slowThreshold') - .forUseAtConfigurationTime() .map { Long.valueOf(it) } .orElse(slowThreshold) .orElse(projectExtension.@slowThreshold) @@ -146,7 +139,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowSummary() { providers.systemProperty('testlogger.showSummary') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showSummary) .orElse(projectExtension.@showSummary) @@ -155,7 +147,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowStandardStreams() { providers.systemProperty('testlogger.showStandardStreams') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showStandardStreams) .orElse(projectExtension.@showStandardStreams) @@ -168,7 +159,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowPassedStandardStreams() { providers.systemProperty('testlogger.showPassedStandardStreams') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showPassedStandardStreams) .orElse(projectExtension.@showPassedStandardStreams) @@ -177,7 +167,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowSkippedStandardStreams() { providers.systemProperty('testlogger.showSkippedStandardStreams') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showSkippedStandardStreams) .orElse(projectExtension.@showSkippedStandardStreams) @@ -186,7 +175,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowFailedStandardStreams() { providers.systemProperty('testlogger.showFailedStandardStreams') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showFailedStandardStreams) .orElse(projectExtension.@showFailedStandardStreams) @@ -195,7 +183,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowPassed() { providers.systemProperty('testlogger.showPassed') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showPassed) .orElse(projectExtension.@showPassed) @@ -204,7 +191,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowSkipped() { providers.systemProperty('testlogger.showSkipped') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showSkipped) .orElse(projectExtension.@showSkipped) @@ -213,7 +199,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowFailed() { providers.systemProperty('testlogger.showFailed') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showFailed) .orElse(projectExtension.@showFailed) @@ -222,7 +207,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowSimpleNames() { providers.systemProperty('testlogger.showSimpleNames') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showSimpleNames) .orElse(projectExtension.@showSimpleNames) @@ -231,7 +215,6 @@ class TestLoggerExtension extends TestLoggerExtensionProperties { Boolean getShowOnlySlow() { providers.systemProperty('testlogger.showOnlySlow') - .forUseAtConfigurationTime() .map { Boolean.valueOf(it) } .orElse(showOnlySlow) .orElse(projectExtension.@showOnlySlow) diff --git a/src/test-functional/groovy/com/adarshr/gradle/testlogger/functional/AbstractFunctionalSpec.groovy b/src/test-functional/groovy/com/adarshr/gradle/testlogger/functional/AbstractFunctionalSpec.groovy index 9fce9e7..c3f3bc9 100644 --- a/src/test-functional/groovy/com/adarshr/gradle/testlogger/functional/AbstractFunctionalSpec.groovy +++ b/src/test-functional/groovy/com/adarshr/gradle/testlogger/functional/AbstractFunctionalSpec.groovy @@ -4,6 +4,7 @@ import com.adarshr.gradle.testlogger.renderer.AnsiTextRenderer import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.UnexpectedBuildFailure +import org.gradle.util.GradleVersion import spock.lang.Specification import spock.lang.TempDir import spock.util.environment.OperatingSystem @@ -19,8 +20,6 @@ abstract class AbstractFunctionalSpec extends Specification { private static final String TEST_ROOT = 'src/test-functional/resources' - private static final String GRADLE_VERSION = '7.2' - @TempDir Path temporaryFolder @@ -129,7 +128,7 @@ abstract class AbstractFunctionalSpec extends Specification { private BuildResult runProject(File projectDir, String args) { try { GradleRunner.create() - .withGradleVersion(GRADLE_VERSION) + .withGradleVersion(GradleVersion.current().version) .withProjectDir(projectDir) .withPluginClasspath() .withDebug(true) diff --git a/src/test-functional/resources/many-spock-tests/build.gradle b/src/test-functional/resources/many-spock-tests/build.gradle index 741f9fa..8d9a7c1 100644 --- a/src/test-functional/resources/many-spock-tests/build.gradle +++ b/src/test-functional/resources/many-spock-tests/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.codehaus.groovy:groovy:3.0.19' testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' } diff --git a/src/test-functional/resources/sample-junit4-tests/build.gradle b/src/test-functional/resources/sample-junit4-tests/build.gradle index efe989d..2614105 100644 --- a/src/test-functional/resources/sample-junit4-tests/build.gradle +++ b/src/test-functional/resources/sample-junit4-tests/build.gradle @@ -12,5 +12,5 @@ repositories { } dependencies { - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13.2' } diff --git a/src/test-functional/resources/sample-junit5-jupiter-deep-nested-tests/build.gradle b/src/test-functional/resources/sample-junit5-jupiter-deep-nested-tests/build.gradle index 5bb4527..f213d75 100644 --- a/src/test-functional/resources/sample-junit5-jupiter-deep-nested-tests/build.gradle +++ b/src/test-functional/resources/sample-junit5-jupiter-deep-nested-tests/build.gradle @@ -12,8 +12,8 @@ repositories { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' } test { diff --git a/src/test-functional/resources/sample-junit5-jupiter-nested-tests/build.gradle b/src/test-functional/resources/sample-junit5-jupiter-nested-tests/build.gradle index 5bb4527..f213d75 100644 --- a/src/test-functional/resources/sample-junit5-jupiter-nested-tests/build.gradle +++ b/src/test-functional/resources/sample-junit5-jupiter-nested-tests/build.gradle @@ -12,8 +12,8 @@ repositories { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' } test { diff --git a/src/test-functional/resources/sample-junit5-jupiter-tests/build.gradle b/src/test-functional/resources/sample-junit5-jupiter-tests/build.gradle index 7fca3d5..492a9d6 100644 --- a/src/test-functional/resources/sample-junit5-jupiter-tests/build.gradle +++ b/src/test-functional/resources/sample-junit5-jupiter-tests/build.gradle @@ -12,9 +12,9 @@ repositories { } dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' + testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' } test { diff --git a/src/test-functional/resources/sample-junit5-vintage-tests/build.gradle b/src/test-functional/resources/sample-junit5-vintage-tests/build.gradle index f479454..b07ce79 100644 --- a/src/test-functional/resources/sample-junit5-vintage-tests/build.gradle +++ b/src/test-functional/resources/sample-junit5-vintage-tests/build.gradle @@ -12,8 +12,8 @@ repositories { } dependencies { - testImplementation 'junit:junit:4.12' - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.5.2' + testImplementation 'junit:junit:4.13.2' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.0' } test { diff --git a/src/test-functional/resources/sample-kotest-tests/build.gradle b/src/test-functional/resources/sample-kotest-tests/build.gradle index f941d56..6e49e77 100644 --- a/src/test-functional/resources/sample-kotest-tests/build.gradle +++ b/src/test-functional/resources/sample-kotest-tests/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.jetbrains.kotlin.jvm' version '1.5.31' + id 'org.jetbrains.kotlin.jvm' version '1.9.10' id 'com.adarshr.test-logger' apply false } @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.6.3' + testImplementation 'io.kotest:kotest-runner-junit5-jvm:5.7.2' } test { diff --git a/src/test-functional/resources/sample-kotest-tests/src/test/kotlin/com/adarshr/test/WordSpecTest.kt b/src/test-functional/resources/sample-kotest-tests/src/test/kotlin/com/adarshr/test/WordSpecTest.kt index 79cb252..a41f1e1 100644 --- a/src/test-functional/resources/sample-kotest-tests/src/test/kotlin/com/adarshr/test/WordSpecTest.kt +++ b/src/test-functional/resources/sample-kotest-tests/src/test/kotlin/com/adarshr/test/WordSpecTest.kt @@ -2,7 +2,7 @@ package com.adarshr.test import io.kotest.core.spec.style.WordSpec import io.kotest.matchers.comparables.shouldBeGreaterThan -import kotlin.time.Duration +import kotlin.time.Duration.Companion.milliseconds import kotlin.time.ExperimentalTime @@ -28,7 +28,7 @@ class WordSpecTest : WordSpec() { "have a test" { 2.shouldBeGreaterThan(1) } - "have a test with config".config(timeout = Duration.milliseconds(10000)) { + "have a test with config".config(timeout = 10000.milliseconds) { 2.shouldBeGreaterThan(1) } } diff --git a/src/test-functional/resources/sample-spek-tests/build.gradle b/src/test-functional/resources/sample-spek-tests/build.gradle index 72edb60..4002e48 100644 --- a/src/test-functional/resources/sample-spek-tests/build.gradle +++ b/src/test-functional/resources/sample-spek-tests/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.jetbrains.kotlin.jvm' version '1.5.31' + id 'org.jetbrains.kotlin.jvm' version '1.9.10' id 'com.adarshr.test-logger' apply false } @@ -12,11 +12,11 @@ repositories { } dependencies { - testImplementation 'org.jetbrains.kotlin:kotlin-test:1.5.31' - testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.17' + testImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.10' + testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.19' - testRuntimeOnly 'org.spekframework.spek2:spek-runner-junit5:2.0.17' - testRuntimeOnly 'org.jetbrains.kotlin:kotlin-reflect:1.5.31' + testRuntimeOnly 'org.spekframework.spek2:spek-runner-junit5:2.0.19' + testRuntimeOnly 'org.jetbrains.kotlin:kotlin-reflect:1.9.10' } test { diff --git a/src/test-functional/resources/sample-spock-tests-system-exit/build.gradle b/src/test-functional/resources/sample-spock-tests-system-exit/build.gradle index 741f9fa..8d9a7c1 100644 --- a/src/test-functional/resources/sample-spock-tests-system-exit/build.gradle +++ b/src/test-functional/resources/sample-spock-tests-system-exit/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.codehaus.groovy:groovy:3.0.19' testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' } diff --git a/src/test-functional/resources/sample-spock-tests/build.gradle b/src/test-functional/resources/sample-spock-tests/build.gradle index 741f9fa..8d9a7c1 100644 --- a/src/test-functional/resources/sample-spock-tests/build.gradle +++ b/src/test-functional/resources/sample-spock-tests/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.codehaus.groovy:groovy:3.0.19' testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' } diff --git a/src/test-functional/resources/single-spock-test/build.gradle b/src/test-functional/resources/single-spock-test/build.gradle index 741f9fa..8d9a7c1 100644 --- a/src/test-functional/resources/single-spock-test/build.gradle +++ b/src/test-functional/resources/single-spock-test/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.codehaus.groovy:groovy:3.0.19' testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' } diff --git a/src/test-functional/resources/slow-spock-test/build.gradle b/src/test-functional/resources/slow-spock-test/build.gradle index 741f9fa..8d9a7c1 100644 --- a/src/test-functional/resources/slow-spock-test/build.gradle +++ b/src/test-functional/resources/slow-spock-test/build.gradle @@ -12,7 +12,7 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.codehaus.groovy:groovy:3.0.19' testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' }