Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
15ec2617
Commit
15ec2617
authored
Jun 04, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x'
Closes gh-21699
parents
16cab0d8
c0f748e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
JavaConventions.java
.../java/org/springframework/boot/build/JavaConventions.java
+11
-9
ConventionsPluginTests.java
...rg/springframework/boot/build/ConventionsPluginTests.java
+8
-3
No files found.
buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
View file @
15ec2617
...
...
@@ -109,15 +109,17 @@ class JavaConventions {
test
.
useJUnitPlatform
();
test
.
setMaxHeapSize
(
"1024M"
);
});
if
(
Boolean
.
parseBoolean
(
System
.
getenv
(
"CI"
)))
{
project
.
getPlugins
().
apply
(
TestRetryPlugin
.
class
);
project
.
getTasks
().
withType
(
Test
.
class
,
(
test
)
->
project
.
getPlugins
().
withType
(
TestRetryPlugin
.
class
,
(
testRetryPlugin
)
->
{
TestRetryTaskExtension
testRetry
=
test
.
getExtensions
().
getByType
(
TestRetryTaskExtension
.
class
);
testRetry
.
getFailOnPassedAfterRetry
().
set
(
true
);
testRetry
.
getMaxRetries
().
set
(
3
);
}));
}
project
.
getPlugins
().
apply
(
TestRetryPlugin
.
class
);
project
.
getTasks
().
withType
(
Test
.
class
,
(
test
)
->
project
.
getPlugins
().
withType
(
TestRetryPlugin
.
class
,
(
testRetryPlugin
)
->
{
TestRetryTaskExtension
testRetry
=
test
.
getExtensions
().
getByType
(
TestRetryTaskExtension
.
class
);
testRetry
.
getFailOnPassedAfterRetry
().
set
(
true
);
testRetry
.
getMaxRetries
().
set
(
isCi
()
?
3
:
0
);
}));
}
private
boolean
isCi
()
{
return
Boolean
.
parseBoolean
(
System
.
getenv
(
"CI"
));
}
private
void
configureJavadocConventions
(
Project
project
)
{
...
...
buildSrc/src/test/java/org/springframework/boot/build/ConventionsPluginTests.java
View file @
15ec2617
...
...
@@ -78,7 +78,7 @@ class ConventionsPluginTests {
}
@Test
void
testRetryIsConfiguredOnCI
()
throws
IOException
{
void
testRetryIsConfigured
WithThreeRetries
OnCI
()
throws
IOException
{
try
(
PrintWriter
out
=
new
PrintWriter
(
new
FileWriter
(
this
.
buildFile
)))
{
out
.
println
(
"plugins {"
);
out
.
println
(
" id 'java'"
);
...
...
@@ -101,7 +101,7 @@ class ConventionsPluginTests {
}
@Test
void
testRetryIs
NotConfigured
Locally
()
throws
IOException
{
void
testRetryIs
ConfiguredWithZeroRetries
Locally
()
throws
IOException
{
try
(
PrintWriter
out
=
new
PrintWriter
(
new
FileWriter
(
this
.
buildFile
)))
{
out
.
println
(
"plugins {"
);
out
.
println
(
" id 'java'"
);
...
...
@@ -111,11 +111,16 @@ class ConventionsPluginTests {
out
.
println
(
"task retryConfig {"
);
out
.
println
(
" doLast {"
);
out
.
println
(
" println \"Retry plugin applied: ${plugins.hasPlugin('org.gradle.test-retry')}\""
);
out
.
println
(
" test.retry {"
);
out
.
println
(
" println \"maxRetries: ${maxRetries.get()}\""
);
out
.
println
(
" println \"failOnPassedAfterRetry: ${failOnPassedAfterRetry.get()}\""
);
out
.
println
(
" }"
);
out
.
println
(
" }"
);
out
.
println
(
"}"
);
}
assertThat
(
runGradle
(
Collections
.
singletonMap
(
"CI"
,
"local"
),
"retryConfig"
,
"--stacktrace"
).
getOutput
())
.
contains
(
"Retry plugin applied: false"
);
.
contains
(
"Retry plugin applied: true"
).
contains
(
"maxRetries: 0"
)
.
contains
(
"failOnPassedAfterRetry: true"
);
}
private
BuildResult
runGradle
(
String
...
args
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment