Skip to content

Commit fa412e2

Browse files
committed
Enable log for Test
1 parent 5c33245 commit fa412e2

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_install:
2929
- docker run -u "$UID" -it --rm -v `pwd`:`pwd` -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -w `pwd` theosakamg7/ros2java:latest sh -c ". ament_ws/install_isolated/local_setup.sh && cd /home/travis/build/ros2_java_ws && ament build --symlink-install --isolated --skip-packages $PKG_EXCLUDE"
3030

3131
script:
32-
- cd $HOME_BUILD && docker run -u "$UID" -it --rm -v `pwd`:`pwd` -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -w `pwd` theosakamg7/ros2java:latest sh -c ". ament_ws/install_isolated/local_setup.sh && cd /home/travis/build/ros2_java_ws && ament test --isolated --only rcljava_utils"
32+
- cd $HOME_BUILD && docker run -u "$UID" -it --rm -v `pwd`:`pwd` -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN -w `pwd` theosakamg7/ros2java:latest sh -c ". ament_ws/install_isolated/local_setup.sh && cd /home/travis/build/ros2_java_ws && ament test --skip-build --skip-install --isolated --only-packages rcljava_utils --ament-gradle-args --parallel --daemon --configure-on-demand --rerun-tasks"
3333

3434
notifications:
3535
webhooks:

rcljava_utils/build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,34 @@ ament {
4242

4343
test { finalizedBy jacocoTestReport }
4444

45+
tasks.withType(Test) {
46+
testLogging {
47+
// set options for log level LIFECYCLE
48+
events "passed", "skipped", "failed", "standardOut"
49+
showExceptions true
50+
exceptionFormat "full"
51+
showCauses true
52+
showStackTraces true
53+
54+
// set options for log level DEBUG and INFO
55+
debug {
56+
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
57+
exceptionFormat "full"
58+
}
59+
info.events = debug.events
60+
info.exceptionFormat = debug.exceptionFormat
61+
62+
afterSuite { desc, result ->
63+
if (!desc.parent) { // will match the outermost suite
64+
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
65+
def startItem = '| ', endItem = ' |'
66+
def repeatLength = startItem.length() + output.length() + endItem.length()
67+
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
68+
}
69+
}
70+
}
71+
}
72+
4573
jacocoTestReport {
4674
reports {
4775
xml.enabled = true // coveralls plugin depends on xml format report

0 commit comments

Comments
 (0)