70
70
* <li>with a max heap of 1024M
71
71
* <li>to run after any Checkstyle and format checking tasks
72
72
* <li>to enable retries with a maximum of three attempts when running on CI
73
- * <li>to use predictive test selection when running locally
73
+ * <li>to use predictive test selection when the value of the
74
+ * {@code ENABLE_PREDICTIVE_TEST_SELECTION} environment variable is {@code true}
74
75
* </ul>
75
76
* <li>A {@code testRuntimeOnly} dependency upon
76
77
* {@code org.junit.platform:junit-platform-launcher} is added to projects with the
@@ -181,8 +182,12 @@ private void configureTestRetries(Test test) {
181
182
testRetry .getMaxRetries ().set (isCi () ? 3 : 0 );
182
183
}
183
184
185
+ private boolean isCi () {
186
+ return Boolean .parseBoolean (System .getenv ("CI" ));
187
+ }
188
+
184
189
private void configurePredictiveTestSelection (Test test ) {
185
- if (! isCi ()) {
190
+ if (isPredictiveTestSelectionEnabled ()) {
186
191
PredictiveTestSelectionExtension predictiveTestSelection = test .getExtensions ()
187
192
.getByType (PredictiveTestSelectionExtension .class );
188
193
predictiveTestSelection .getEnabled ().set (true );
@@ -191,8 +196,8 @@ private void configurePredictiveTestSelection(Test test) {
191
196
}
192
197
}
193
198
194
- private boolean isCi () {
195
- return Boolean .parseBoolean (System .getenv ("CI " ));
199
+ private boolean isPredictiveTestSelectionEnabled () {
200
+ return Boolean .parseBoolean (System .getenv ("ENABLE_PREDICTIVE_TEST_SELECTION " ));
196
201
}
197
202
198
203
private void configureJavadocConventions (Project project ) {
0 commit comments