Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#589] test: add more test failure infomation if test failed. (#859)

FANNG1c8ea4791340
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 585b198064..5ae89bc2a1 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -41,6 +41,14 @@ jobs:
- name: Build with Gradle
run: gradle build -PskipITs
+ - name: Upload unit tests report
+ uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: unit test report
+ path:
+ build/reports
+
- name: Jacoco Report to PR
id: jacoco
uses: madrapps/[email protected]
diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml
index cd6e206e2d..5eedaa6301 100644
--- a/.github/workflows/integration-test.yml
+++ b/.github/workflows/integration-test.yml
@@ -61,7 +61,7 @@ jobs:
- name: Package Gravitino
run: |
gradle build -x test
- gradle compileDistribution
+ gradle compileDistribution -x test
- name: Check docker container status
uses: nick-fields/retry@v2
@@ -89,18 +89,16 @@ jobs:
gradle test --rerun-tasks -PskipTests -PtestMode=embedded
gradle test --rerun-tasks -PskipTests -PtestMode=deploy
- - name: Print logs when Gravitino integration tests failure
+ - name: Upload integrate tests reports
+ uses: actions/upload-artifact@v3
if: ${{ failure() && steps.integrationTest.outcome == 'failure' }}
- run: |
- if [ -f "integration-test/build/integration-test.log" ]; then
- cat integration-test/build/integration-test.log
- fi
- if [ -f "distribution/package/logs/gravitino-server.out" ]; then
- cat distribution/package/logs/gravitino-server.out
- fi
- if [ -f "distribution/package/logs/gravitino-server.log" ]; then
- cat distribution/package/logs/gravitino-server.log
- fi
+ with:
+ name: integrate test reports
+ path: |
+ build/reports
+ integration-test/build/integration-test.log
+ distribution/package/logs/gravitino-server.out
+ distribution/package/logs/gravitino-server.log
- name: Stop and remove container
run: |
diff --git a/build.gradle.kts b/build.gradle.kts
index 629ac157ee..49b5f7c3d9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,6 +13,7 @@ import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.InventoryHtmlReportRenderer
import com.github.jk1.license.filter.DependencyFilter
import com.github.jk1.license.filter.LicenseBundleNormalizer
+import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
`maven-publish`
@@ -139,6 +140,13 @@ subprojects {
}
tasks.configureEach<Test> {
+ testLogging {
+ exceptionFormat = TestExceptionFormat.FULL
+ showExceptions = true
+ showCauses = true
+ showStackTraces = true
+ }
+ reports.html.outputLocation.set(file("${rootProject.projectDir}/build/reports/"))
val skipTests = project.hasProperty("skipTests")
if (!skipTests) {
if (project.name == "trino-connector") {
diff --git a/docs/assets/test-fail-job.png b/docs/assets/test-fail-job.png
new file mode 100644
index 0000000000..29ef4bfd5d
Binary files /dev/null and b/docs/assets/test-fail-job.png differ
diff --git a/docs/assets/test-fail-pr.png b/docs/assets/test-fail-pr.png
new file mode 100644
index 0000000000..f1e77e12f7
Binary files /dev/null and b/docs/assets/test-fail-pr.png differ
diff --git a/docs/assets/test-fail-summary.png b/docs/assets/test-fail-summary.png
new file mode 100644
index 0000000000..e6a48e1dff
Binary files /dev/null and b/docs/assets/test-fail-summary.png differ
diff --git a/docs/integration-test.md b/docs/integration-test.md
index 4dcca41cd2..e3bb8789cd 100644
--- a/docs/integration-test.md
+++ b/docs/integration-test.md
@@ -136,3 +136,21 @@ You have two modes to debug the Gravitino server and integration tests: `embedde
- The Gravitino project is compiled and packaged in the `distribution` directory using the `./gradlew compileDistribution` command.
- Execution the `./gradlew test -PtestMode=[embedded|deploy]` command.
- Stop the Docker image to clean up.
+
+## Test Failure
+If a test fails, valuable information can be retrieved from the logs and test report. Test reports
+are stored in the `./build/reports` directory. The integration test logs are situated in the
+`./integrate-test/build` directory. In deploy mode, Gravitino server logs can be found at
+`./distribution/package/logs/` directory. In the event of a test failure within the GitHub workflow,
+both logs and the test report are archived. To obtain the archive, please follow these steps:
+1. Click the `detail` link associated with the failed integrate test in the pull request (PR). This will redirect you to the job page.
+
+ ![pr page Image](assets/test-fail-pr.png)
+
+2. On the job page, locate the `Summary` button on the left-hand side and click it to access the workflow summary page.
+
+ ![job page Image](assets/test-fail-job.png)
+
+3. Look for the Artifacts item on the summary page and download the archive from there.
+
+ ![summary page Image](assets/test-fail-summary.png)