1
1
/*
2
- * Copyright 2012-2022 the original author or authors.
2
+ * Copyright 2012-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -54,6 +54,9 @@ void setup(@TempDir File projectDir) throws IOException {
54
54
this .buildFile = new File (this .projectDir , "build.gradle" );
55
55
File settingsFile = new File (this .projectDir , "settings.gradle" );
56
56
try (PrintWriter out = new PrintWriter (new FileWriter (settingsFile ))) {
57
+ out .println ("plugins {" );
58
+ out .println (" id 'com.gradle.enterprise'" );
59
+ out .println ("}" );
57
60
out .println ("include ':spring-boot-project:spring-boot-parent'" );
58
61
}
59
62
File springBootParent = new File (this .projectDir , "spring-boot-project/spring-boot-parent/build.gradle" );
@@ -175,17 +178,15 @@ void testRetryIsConfiguredWithThreeRetriesOnCI() throws IOException {
175
178
out .println ("description 'Test'" );
176
179
out .println ("task retryConfig {" );
177
180
out .println (" doLast {" );
178
- out .println (" println \" Retry plugin applied: ${plugins.hasPlugin('org.gradle.test-retry')}\" " );
179
- out .println (" test.retry {" );
181
+ out .println (" test.retry {" );
180
182
out .println (" println \" maxRetries: ${maxRetries.get()}\" " );
181
183
out .println (" println \" failOnPassedAfterRetry: ${failOnPassedAfterRetry.get()}\" " );
182
184
out .println (" }" );
183
185
out .println (" }" );
184
186
out .println ("}" );
185
187
}
186
188
assertThat (runGradle (Collections .singletonMap ("CI" , "true" ), "retryConfig" , "--stacktrace" ).getOutput ())
187
- .contains ("Retry plugin applied: true" ).contains ("maxRetries: 3" )
188
- .contains ("failOnPassedAfterRetry: true" );
189
+ .contains ("maxRetries: 3" ).contains ("failOnPassedAfterRetry: true" );
189
190
}
190
191
191
192
@ Test
@@ -198,17 +199,15 @@ void testRetryIsConfiguredWithZeroRetriesLocally() throws IOException {
198
199
out .println ("description 'Test'" );
199
200
out .println ("task retryConfig {" );
200
201
out .println (" doLast {" );
201
- out .println (" println \" Retry plugin applied: ${plugins.hasPlugin('org.gradle.test-retry')}\" " );
202
- out .println (" test.retry {" );
202
+ out .println (" test.retry {" );
203
203
out .println (" println \" maxRetries: ${maxRetries.get()}\" " );
204
204
out .println (" println \" failOnPassedAfterRetry: ${failOnPassedAfterRetry.get()}\" " );
205
205
out .println (" }" );
206
206
out .println (" }" );
207
207
out .println ("}" );
208
208
}
209
209
assertThat (runGradle (Collections .singletonMap ("CI" , "local" ), "retryConfig" , "--stacktrace" ).getOutput ())
210
- .contains ("Retry plugin applied: true" ).contains ("maxRetries: 0" )
211
- .contains ("failOnPassedAfterRetry: true" );
210
+ .contains ("maxRetries: 0" ).contains ("failOnPassedAfterRetry: true" );
212
211
}
213
212
214
213
private BuildResult runGradle (String ... args ) {
0 commit comments