This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 275ec9a Build: Add logs to the CI output (#1789)
275ec9a is described below
commit 275ec9acafb7578591f82b1e5ca63c0c75dd7216
Author: pvary <[email protected]>
AuthorDate: Fri Nov 20 20:56:32 2020 +0100
Build: Add logs to the CI output (#1789)
---
.github/workflows/java-ci.yml | 6 ++++++
build.gradle | 17 +++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/.github/workflows/java-ci.yml b/.github/workflows/java-ci.yml
index 53dac53..7fe91c6 100644
--- a/.github/workflows/java-ci.yml
+++ b/.github/workflows/java-ci.yml
@@ -38,4 +38,10 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- run: ./gradlew check
+ - uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: test logs
+ path: |
+ **/build/testlogs
diff --git a/build.gradle b/build.gradle
index a385685..5a34cc1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -130,6 +130,23 @@ subprojects {
}
test {
+ def logDir = "${rootDir}/build/testlogs"
+ def logFile = "${logDir}/${project.name}.log"
+ mkdir("${logDir}")
+ delete("${logFile}")
+ def buildLog = new File(logFile)
+ addTestOutputListener(new TestOutputListener() {
+ def lastDescriptor
+ @Override
+ void onOutput(TestDescriptor testDescriptor, TestOutputEvent
testOutputEvent) {
+ if (lastDescriptor != testDescriptor) {
+ buildLog << "--------\n- Test log for: "<< testDescriptor <<
"\n--------\n"
+ lastDescriptor = testDescriptor
+ }
+ buildLog << testOutputEvent.destination << " " <<
testOutputEvent.message
+ }
+ })
+
testLogging {
if ("true".equalsIgnoreCase(System.getenv('CI'))) {
events "failed", "passed"