Skip to content

Commit 450dc74

Browse files
committed
Merge branch 'release/1.6.0'
2 parents a491b94 + 107a10b commit 450dc74

37 files changed

+501
-100
lines changed

.circleci/config.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
- image: circleci/openjdk:8-jdk
77
working_directory: ~/repo
88
environment:
9-
JVM_OPTS: -Xmx3200m
9+
JVM_OPTS: -Xmx4096m
1010
TERM: dumb
1111
steps:
1212
- checkout
@@ -23,17 +23,22 @@ jobs:
2323
key: v1-dependencies-{{ checksum "build.gradle" }}
2424
- run:
2525
name: Run tests
26-
command: GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew clean test --no-daemon
26+
command: GRADLE_OPTS="-Xms256m -Xmx2048m" ./gradlew build --no-daemon
2727
- run:
2828
name: Code coverage
2929
command: GRADLE_OPTS="-Xms256m -Xmx1024m" ./gradlew jacocoTestReport coveralls --no-daemon
3030
- run:
3131
name: Save reports
3232
command: |
33-
mkdir -p ~/results
34-
mkdir -p ~/reports
35-
find . -type f -regex "./build/test-results/.*xml" -exec cp {} ~/results \;
36-
cp -r build/reports/tests/test/* ~/reports
33+
mkdir -p ~/results/unit
34+
mkdir -p ~/reports/unit
35+
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/results/unit \;
36+
cp -r build/reports/tests/test/* ~/reports/unit
37+
38+
mkdir -p ~/results/functional
39+
mkdir -p ~/reports/functional
40+
find . -type f -regex "./build/test-results/functionalTest/.*xml" -exec cp {} ~/results/functional \;
41+
cp -r build/reports/tests/functionalTest/* ~/reports/functional
3742
when: always
3843
- store_test_results:
3944
path: ~/results

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
# Change Log
22

3-
## [v1.5.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v1.5.0) (2018-09-09)
3+
## [v1.6.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v1.6.0) (2018-11-20)
44

5+
[Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v1.5.0...v1.6.0)
6+
7+
**Implemented enhancements:**
8+
9+
- Allow testlogger to be configured independently for each task [\#90](https://github.com/radarsh/gradle-test-logger-plugin/issues/90)
10+
11+
**Closed issues:**
12+
13+
- Test time reporting under the threshold [\#101](https://github.com/radarsh/gradle-test-logger-plugin/issues/101)
14+
- Doesn't render tickmarks for mocha theme on Windows [\#99](https://github.com/radarsh/gradle-test-logger-plugin/issues/99)
15+
- Add CompileStatic to more classes [\#97](https://github.com/radarsh/gradle-test-logger-plugin/issues/97)
16+
- Print list of tests before execution [\#91](https://github.com/radarsh/gradle-test-logger-plugin/issues/91)
17+
- JUnit5 Gradle Plugin interferes with this one [\#87](https://github.com/radarsh/gradle-test-logger-plugin/issues/87)
18+
- Use of testLogger.showStandardStreams can lead to confusion [\#86](https://github.com/radarsh/gradle-test-logger-plugin/issues/86)
19+
20+
**Merged pull requests:**
21+
22+
- Add @CompileStatic to all classes [\#98](https://github.com/radarsh/gradle-test-logger-plugin/pull/98) ([radarsh](https://github.com/radarsh))
23+
- Highlight lowercase extension name in documentation [\#96](https://github.com/radarsh/gradle-test-logger-plugin/pull/96) ([radarsh](https://github.com/radarsh))
24+
- Clarify documentation about junit-platform Gradle plugin [\#95](https://github.com/radarsh/gradle-test-logger-plugin/pull/95) ([radarsh](https://github.com/radarsh))
25+
- React to testLogging.showStandardStreams [\#94](https://github.com/radarsh/gradle-test-logger-plugin/pull/94) ([radarsh](https://github.com/radarsh))
26+
- Configure testlogger for each task [\#93](https://github.com/radarsh/gradle-test-logger-plugin/pull/93) ([radarsh](https://github.com/radarsh))
27+
28+
## [v1.5.0](https://github.com/radarsh/gradle-test-logger-plugin/tree/v1.5.0) (2018-09-08)
529
[Full Changelog](https://github.com/radarsh/gradle-test-logger-plugin/compare/v1.4.0...v1.5.0)
630

731
**Implemented enhancements:**

README.md

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Scroll down for more themes and customisation options or visit the [screenshots
2525

2626
```groovy
2727
plugins {
28-
id 'com.adarshr.test-logger' version '1.5.0'
28+
id 'com.adarshr.test-logger' version '1.6.0'
2929
}
3030
```
3131

@@ -39,7 +39,7 @@ buildscript {
3939
}
4040
}
4141
dependencies {
42-
classpath 'com.adarshr:gradle-test-logger-plugin:1.5.0'
42+
classpath 'com.adarshr:gradle-test-logger-plugin:1.6.0'
4343
}
4444
}
4545
@@ -48,20 +48,59 @@ apply plugin: 'com.adarshr.test-logger'
4848

4949
## Configuration
5050

51-
All the below configuration settings can either be specified in `build.gradle` file or be set at runtime using system
52-
properties or both. For instance, we could have `theme` set to `mocha` in `build.gradle` file but it can be overridden
53-
to be `standard` at runtime by using `-Dtestlogger.theme=standard` on the command line. Since they're system properties
54-
we have a number of ways of specifying them including `JAVA_OPTS` and `gradle.properties`.
51+
The plugin registers an extension called `testlogger` (all lowercase and one word) at project level
52+
as well as for each task of type [`Test`](https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html).
5553

56-
The convention used for determining the name of the system property is `testlogger.<configuration setting>`.
54+
The following shows the complete default configuration applied when you configure nothing.
5755

58-
- [Switch themes](#switch-themes)
59-
- [Hide exceptions](#hide-exceptions)
60-
- [Define slow threshold](#define-slow-threshold)
61-
- [Hide summary](#hide-summary)
62-
- [Show standard streams](#show-standard-streams)
63-
- [Filter standard streams](#filter-standard-streams)
64-
- [Filter test results](#filter-test-results)
56+
```groovy
57+
testlogger {
58+
theme 'standard'
59+
showExceptions true
60+
slowThreshold 2000
61+
showSummary true
62+
showPassed true
63+
showSkipped true
64+
showFailed true
65+
showStandardStreams false
66+
showPassedStandardStreams true
67+
showSkippedStandardStreams true
68+
showFailedStandardStreams true
69+
}
70+
```
71+
72+
### Project vs task level configuration
73+
74+
Settings configured at the project level can be overridden by redefining them at task level. Settings
75+
not defined at task level will inherit project level values. Consider the below configuration.
76+
77+
```groovy
78+
testlogger {
79+
theme 'mocha' // project level
80+
slowThreshold 5000
81+
}
82+
83+
test {
84+
testlogger {
85+
theme 'standard-parallel' // task level
86+
}
87+
}
88+
```
89+
90+
In the above example, the effective theme will be `standard-parallel` and `slowThreshold` will be `5000` whereas rest of
91+
the settings will retain their default values.
92+
93+
### Overriding settings at runtime
94+
95+
All the above settings can either be specified in `build.gradle` or be set at runtime using system properties or both.
96+
For instance, we could have `theme` set to `mocha` in the build file but it can be overridden to be `standard` at runtime
97+
by using `-Dtestlogger.theme=standard` on the command line. Since they are system properties we have a number of ways of
98+
specifying them including `JAVA_OPTS` and `gradle.properties`.
99+
100+
- The convention used for determining the name of the system property is `testlogger.<configuration setting>`.
101+
- System property overrides will be applied after combining task and project level settings.
102+
- Specifying a system property override will apply the same setting for all tasks, regardless of any configuration
103+
defined in the build file.
65104

66105
### Switch themes
67106

@@ -193,3 +232,21 @@ Yes. You will need to switch to a suitable parallel theme though. This can be on
193232
`mocha-parallel`. The parallel themes are specially designed to work with a setting of
194233
[`maxParallelForks`](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:maxParallelForks)
195234
greater than 1. They achieve this by sacrificing the ability to group tests and thus some readability is lost.
235+
236+
### How are `testlogger` and `Test.testLogging` related?
237+
238+
Until recently, they were unrelated. While this plugin's `testlogger` has many properties named identical to the ones in Gradle's
239+
`Test.testLogging`, to a large extent, they are kept isolated by design.
240+
241+
However, as of this writing `testlogger.showStandardStreams` property has been made to react to `testLogging.showStandardStreams`
242+
property as long as one doesn't configure a value for `testlogger.showStandardStreams`. If a value is configured for
243+
`testlogger.showStandardStreams` (even if it is `false`), the plugin ignores `testLogging.showStandardStreams` altogether.
244+
245+
### Can this plugin co-exist with junit-platform-gradle-plugin?
246+
247+
Due to certain unknown reasons, `junit-platform-gradle-plugin` is incompatible with `gradle-test-logger-plugin`. If you are still
248+
using `junit-platform-gradle-plugin`, it might be worth noting that this plugin was [deprecated in JUnit Platform 1.2 and removed
249+
from JUnit Platform 1.3](https://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle).
250+
251+
The test logger plugin however, is fully compatible with the [Gradle native way](https://docs.gradle.org/current/userguide/java_testing.html#using_junit5) of
252+
using JUnit 5.

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
skip_tags: true
22
test_script:
3-
- gradlew clean test --no-daemon
3+
- gradlew build --no-daemon
44
after_test:
55
- ps: ./uploadTestResults.ps1
66
build: off
77
artifacts:
88
- path: build/reports/tests/test/**/*.*
9+
- path: build/reports/tests/functionalTest/**/*.*

build.gradle

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ sourceSets {
3131
groovy {
3232
srcDir 'src/test-functional/groovy'
3333
compileClasspath += sourceSets.main.output
34+
runtimeClasspath += sourceSets.main.output
3435
}
3536
}
3637
}
3738

38-
test {
39-
testClassesDirs += sourceSets.functionalTest.output.classesDirs
40-
classpath += sourceSets.functionalTest.runtimeClasspath
41-
systemProperty 'file.encoding', 'UTF-8'
42-
}
43-
4439
dependencies {
4540
compile gradleApi()
4641
compile localGroovy()
@@ -76,3 +71,39 @@ idea {
7671
testSourceDirs += file('src/test-functional/groovy')
7772
}
7873
}
74+
75+
test {
76+
testClassesDirs += sourceSets.functionalTest.output.classesDirs
77+
classpath += sourceSets.functionalTest.runtimeClasspath
78+
systemProperty 'file.encoding', 'UTF-8'
79+
80+
testlogger {
81+
theme 'mocha'
82+
}
83+
84+
exclude 'com/adarshr/gradle/testlogger/functional/**'
85+
}
86+
87+
task functionalTest(type: Test) {
88+
maxParallelForks = 2
89+
testClassesDirs = sourceSets.functionalTest.output.classesDirs
90+
classpath = sourceSets.test.runtimeClasspath + sourceSets.functionalTest.runtimeClasspath
91+
systemProperty 'file.encoding', 'UTF-8'
92+
minHeapSize '128m'
93+
maxHeapSize '512m'
94+
95+
jacoco {
96+
append = true
97+
destinationFile = file("${buildDir}/jacoco/test.exec")
98+
}
99+
100+
testlogger {
101+
theme 'mocha-parallel'
102+
}
103+
104+
include 'com/adarshr/gradle/testlogger/functional/**'
105+
}
106+
107+
tasks.check.dependsOn 'functionalTest'
108+
tasks.functionalTest.dependsOn 'pluginUnderTestMetadata', 'testClasses'
109+
tasks.functionalTest.mustRunAfter 'test'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=1.5.0
1+
version=1.6.0
22
group=com.adarshr

gradle/coverage.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jacoco {
2-
toolVersion '0.7.9'
2+
toolVersion '0.8.2'
33
}
44

55
jacocoTestReport {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)