From 2928999accbccf5502b96b652f011a3b93ee48e6 Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Thu, 12 Oct 2023 13:07:32 -0300 Subject: [PATCH] chore(ci): include build info in tests (WPB-4505) (#2319) --- AR-builder.groovy | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/AR-builder.groovy b/AR-builder.groovy index 6461fe55ca..3b409e7b8b 100644 --- a/AR-builder.groovy +++ b/AR-builder.groovy @@ -249,9 +249,15 @@ pipeline { withGradle() { sh './gradlew runUnitTests' } - publishHTML(allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "app/build/reports/tests/test${params.FLAVOR}${params.BUILD_TYPE}UnitTest/", reportFiles: 'index.html', reportName: 'Unit Test Report', reportTitles: 'Unit Test') - zip archive: true, defaultExcludes: false, dir: "app/build/reports/tests/test${params.FLAVOR}${params.BUILD_TYPE}UnitTest/", overwrite: true, glob: "", zipFile: "unit-tests-android.zip" + + script { + commitHash = sh( + script: 'git rev-parse HEAD | xargs echo -n', + returnStdout: true + ) + } + zip archive: true, defaultExcludes: false, dir: "app/build/reports/tests/test${params.FLAVOR}${params.BUILD_TYPE}UnitTest/", overwrite: true, glob: "", zipFile: "unit-tests-android_${commitHash}.zip" } } @@ -305,9 +311,15 @@ pipeline { withGradle() { sh './gradlew runAcceptanceTests' } - publishHTML(allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "app/build/reports/androidTests/connected/debug/flavors/${params.FLAVOR.toLowerCase()}", reportFiles: 'index.html', reportName: 'Acceptance Test Report', reportTitles: 'Acceptance Test') - zip archive: true, defaultExcludes: false, dir: "app/build/reports/androidTests/connected/debug/flavors/${params.FLAVOR.toLowerCase()}", overwrite: true, glob: "", zipFile: "integration-tests-android.zip" + + script { + commitHash = sh( + script: 'git rev-parse HEAD | xargs echo -n', + returnStdout: true + ) + } + zip archive: true, defaultExcludes: false, dir: "app/build/reports/androidTests/connected/debug/flavors/${params.FLAVOR.toLowerCase()}", overwrite: true, glob: "", zipFile: "integration-tests-android_${commitHash}.zip" } }