From d0adadf3caa164dd71e36b48c79bf0ba5b2a16a7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 24 Sep 2019 17:25:24 +0100 Subject: [PATCH] Capture maxParallelForks of Test tasks in build scans The parallel forks configuration of Test tasks can have a big impact on their execution time. This commit updates the build can configuration to capture each Test task's maxParallelForks configuration as custom values in the build scan. This will make this data available when comparing scans which will be useful as we experiment with different parallel fork settings to reduce the build's overall execution time. Closes gh-23691 --- gradle/build-scan-user-data.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle/build-scan-user-data.gradle b/gradle/build-scan-user-data.gradle index d924ef8411..d4f483d66f 100644 --- a/gradle/build-scan-user-data.gradle +++ b/gradle/build-scan-user-data.gradle @@ -3,6 +3,7 @@ tagIde() tagCiOrLocal() addCiMetadata() addGitMetadata() +addTestTaskMetadata() void tagOs() { buildScan.tag System.getProperty('os.name') @@ -49,6 +50,16 @@ void addCiMetadata() { } } +void addTestTaskMetadata() { + allprojects { + tasks.withType(Test) { test -> + doFirst { + buildScan.value "Test#maxParallelForks[${test.path}]", test.maxParallelForks.toString() + } + } + } +} + boolean isCi() { isBamboo() }