Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit b7a084a

Browse files
committed
Named logcat files uniquely
Now that there are multiple matrix test environments it helps to have uniquely named `logcat` files so that they all get collected and it is easier to identify which is which. Added a `TEST_ENV_NAME` for a prefix, reverting to a UUID if there is no TEST_ENV_NAME
1 parent 8a3c867 commit b7a084a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

AndroidTest/app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ task(clearDeviceLog, type: AndroidExec) {
123123

124124
task(pullDeviceLog, type: AndroidExec) {
125125
doFirst {
126-
standardOutput = new FileOutputStream(new File(reportsDir, "logcat.log"), false)
126+
def logPrefix = System.getenv('TEST_ENV_NAME')
127+
if (logPrefix == null) logPrefix = UUID.randomUUID()
128+
standardOutput = new FileOutputStream(new File(reportsDir, logPrefix + "_logcat.log"), false)
127129
}
128130
commandLine "adb","logcat", "-d", "-v", "threadtime"
129131
}

Jenkinsfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def runTests(testEnv, isAndroid) {
3535
junit '**/build/**/*.xml'
3636
if (isAndroid) {
3737
// Collect the device log
38-
archiveArtifacts artifacts: '**/build/**/*.log'
38+
archiveArtifacts artifacts: '**/build/**/*logcat.log'
3939
}
4040
}
4141
}
@@ -60,10 +60,10 @@ stage('Build') {
6060

6161
stage('QA') {
6262
// Define the matrix environments
63-
def CLOUDANT_ENV = ['DB_HTTP=https', 'DB_HOST=clientlibs-test.cloudant.com', 'DB_PORT=443', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=clientlibs-test']
64-
def COUCH1_6_ENV = ['DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=5984', 'DB_IGNORE_COMPACTION=false', 'CREDS_ID=couchdb']
65-
def COUCH2_0_ENV = ['DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=5985', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=couchdb']
66-
def CLOUDANT_LOCAL_ENV = ['DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=8081', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=couchdb']
63+
def CLOUDANT_ENV = ['TEST_ENV_NAME=Cloudant_Test','DB_HTTP=https', 'DB_HOST=clientlibs-test.cloudant.com', 'DB_PORT=443', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=clientlibs-test']
64+
def COUCH1_6_ENV = ['TEST_ENV_NAME=CouchDB1_6_Test','DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=5984', 'DB_IGNORE_COMPACTION=false', 'CREDS_ID=couchdb']
65+
def COUCH2_0_ENV = ['TEST_ENV_NAME=CouchDB2_0_Test','DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=5985', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=couchdb']
66+
def CLOUDANT_LOCAL_ENV = ['TEST_ENV_NAME=CloudantLocal_Test','DB_HTTP=http', 'DB_HOST=cloudantsync002.bristol.uk.ibm.com', 'DB_PORT=8081', 'DB_IGNORE_COMPACTION=true', 'CREDS_ID=couchdb']
6767

6868
// Standard builds do Findbugs and test sync-android for Android and Java against Cloudant
6969
def axes = [

0 commit comments

Comments
 (0)