From 3d590a40f5faabedd8aacaff8caae84c1240b607 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 20 Oct 2023 12:35:00 -0500 Subject: [PATCH 1/4] Disable PTS when running experiments --- components/scripts/lib/gradle.sh | 1 + components/scripts/lib/maven.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/components/scripts/lib/gradle.sh b/components/scripts/lib/gradle.sh index d50c08bc..aabe9e09 100644 --- a/components/scripts/lib/gradle.sh +++ b/components/scripts/lib/gradle.sh @@ -32,6 +32,7 @@ invoke_gradle() { -Dcom.gradle.enterprise.build-validation.runNum="${run_num}" -Dcom.gradle.enterprise.build-validation.scriptsVersion="${SCRIPT_VERSION}" -Dscan.capture-task-input-files=true + -Dpts.enabled=false ) # https://stackoverflow.com/a/31485948 diff --git a/components/scripts/lib/maven.sh b/components/scripts/lib/maven.sh index 8a5e3cea..4b91dfba 100644 --- a/components/scripts/lib/maven.sh +++ b/components/scripts/lib/maven.sh @@ -58,6 +58,7 @@ invoke_maven() { -Dcom.gradle.enterprise.build-validation.runNum="${run_num}" -Dcom.gradle.enterprise.build-validation.scriptsVersion="${SCRIPT_VERSION}" -Dgradle.scan.captureGoalInputFiles=true + -Dpts.enabled=false ) # https://stackoverflow.com/a/31485948 From ee35bb1b2887695cd3f713d337702d705224a38e Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 20 Oct 2023 12:48:16 -0500 Subject: [PATCH 2/4] Include -Dpts.enabled=false in displayed commands --- components/scripts/gradle/01-validate-incremental-building.sh | 2 +- .../gradle/02-validate-local-build-caching-same-location.sh | 2 +- .../03-validate-local-build-caching-different-locations.sh | 2 +- .../scripts/gradle/05-validate-remote-build-caching-ci-local.sh | 2 +- .../maven/01-validate-local-build-caching-same-location.sh | 2 +- .../02-validate-local-build-caching-different-locations.sh | 2 +- .../scripts/maven/04-validate-remote-build-caching-ci-local.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/scripts/gradle/01-validate-incremental-building.sh b/components/scripts/gradle/01-validate-incremental-building.sh index bf759933..0f8b2558 100755 --- a/components/scripts/gradle/01-validate-incremental-building.sh +++ b/components/scripts/gradle/01-validate-incremental-building.sh @@ -136,7 +136,7 @@ execute_build() { } print_gradle_command() { - info "./gradlew --no-build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} $*$(print_extra_args)" + info "./gradlew --no-build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false $*$(print_extra_args)" } fetch_build_cache_metrics() { diff --git a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh index 7f2f4f1a..ea6b1479 100755 --- a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh +++ b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh @@ -141,7 +141,7 @@ execute_build() { } print_gradle_command() { - info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" } fetch_build_cache_metrics() { diff --git a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh index 69d9810e..6606af15 100755 --- a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh +++ b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh @@ -146,7 +146,7 @@ execute_build() { } print_gradle_command() { - info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" } fetch_build_cache_metrics() { diff --git a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh index dcf0eb64..fe3a5a3d 100755 --- a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh @@ -204,7 +204,7 @@ execute_build() { args+=(clean ${tasks}) info "Running build:" - info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" invoke_gradle 1 "${args[@]}" } diff --git a/components/scripts/maven/01-validate-local-build-caching-same-location.sh b/components/scripts/maven/01-validate-local-build-caching-same-location.sh index 02e32fff..9e5f5f3e 100755 --- a/components/scripts/maven/01-validate-local-build-caching-same-location.sh +++ b/components/scripts/maven/01-validate-local-build-caching-same-location.sh @@ -142,7 +142,7 @@ execute_build() { } print_maven_command() { - info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" } fetch_build_cache_metrics() { diff --git a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh index ba4a0826..26fcec78 100755 --- a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh +++ b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh @@ -146,7 +146,7 @@ execute_build() { } print_maven_command() { - info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" } fetch_build_cache_metrics() { diff --git a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh index dbdabb06..69e1e736 100755 --- a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh @@ -202,7 +202,7 @@ execute_build() { args+=(clean ${tasks}) info "Running build:" - info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)" + info "./mvnw -Dscan -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} -Dpts.enabled=false clean ${tasks}$(print_extra_args)" # shellcheck disable=SC2086 # we want tasks to expand with word splitting in this case invoke_maven 1 "${args[@]}" From 7f582ddc7bb3267626b7f915438b07a18485cbbc Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 20 Oct 2023 12:52:10 -0500 Subject: [PATCH 3/4] Update release notes --- release/changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/changes.md b/release/changes.md index 19101c30..7399a175 100644 --- a/release/changes.md +++ b/release/changes.md @@ -1 +1 @@ -- [NEW] TBD \ No newline at end of file +- [NEW] Predictive Test Selection is disabled when running builds \ No newline at end of file From 540d9fd38fe7cce4e5dcd35c8df22ae3f14b929c Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 19 Jul 2024 11:09:50 -0500 Subject: [PATCH 4/4] Add instructions to disable PTS in interactive text --- .../scripts/gradle/04-validate-remote-build-caching-ci-ci.sh | 5 +++++ .../gradle/05-validate-remote-build-caching-ci-local.sh | 5 +++++ .../scripts/maven/03-validate-remote-build-caching-ci-ci.sh | 5 +++++ .../maven/04-validate-remote-build-caching-ci-local.sh | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh index e53bfa31..e729f9a0 100755 --- a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh @@ -192,6 +192,11 @@ Make sure the CI configuration uses the proper branch and performs a fresh checkout to avoid any build artifacts lingering around from a previous build that could influence the experiment. +Also, make sure the CI configuration builds the project with Predictive Test +Selection (PTS) disabled, as test results will not be stored in the build cache +when only a subset of tests are selected for execution. PTS can be globally +disabled using the '-Dpts.enabled=false' system property. + Once the build completes, make a note of the commit id that was used, and enter the URL of the build scan produced by the build. EOF diff --git a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh index fe3a5a3d..fd044e9b 100755 --- a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh @@ -284,6 +284,11 @@ Make sure the CI configuration uses the proper branch and performs a fresh checkout to avoid any build artifacts lingering around from a previous build that could influence the experiment. +Also, make sure the CI configuration builds the project with Predictive Test +Selection (PTS) disabled, as test results will not be stored in the build cache +when only a subset of tests are selected for execution. PTS can be globally +disabled using the '-Dpts.enabled=false' system property. + Once the build completes, make a note of the commit id that was used, and enter the URL of the build scan produced by the build. EOF diff --git a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh index 4c4aad8c..cd5e823f 100755 --- a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh @@ -190,6 +190,11 @@ Make sure the CI configuration uses the proper branch and performs a fresh checkout to avoid any build artifacts lingering around from a previous build that could influence the experiment. +Also, make sure the CI configuration builds the project with Predictive Test +Selection (PTS) disabled, as test results will not be stored in the build cache +when only a subset of tests are selected for execution. PTS can be globally +disabled using the '-Dpts.enabled=false' system property. + Once the build completes, make a note of the commit id that was used, and enter the URL of the build scan produced by the build. EOF diff --git a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh index 69e1e736..6164a9d5 100755 --- a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh @@ -284,6 +284,11 @@ Make sure the CI configuration uses the proper branch and performs a fresh checkout to avoid any build artifacts lingering around from a previous build that could influence the experiment. +Also, make sure the CI configuration builds the project with Predictive Test +Selection (PTS) disabled, as test results will not be stored in the build cache +when only a subset of tests are selected for execution. PTS can be globally +disabled using the '-Dpts.enabled=false' system property. + Once the build completes, make a note of the commit id that was used, and enter the URL of the build scan produced by the build. EOF