-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Gradle to 5.5 version #4567
Conversation
scoverage now does not create scoverage specific jars. So now we copy the instrumented classes into the docker container and remove the existing jars
8992b77
to
0b7944d
Compare
Codecov Report
@@ Coverage Diff @@
## master #4567 +/- ##
==========================================
- Coverage 84.52% 78.76% -5.76%
==========================================
Files 183 183
Lines 8252 8252
Branches 558 558
==========================================
- Hits 6975 6500 -475
- Misses 1277 1752 +475
Continue to review full report at Codecov.
|
* Task to generate coverage xml report. Requires the | ||
* tests to be executed prior to its invocation | ||
*/ | ||
task reportCoverage(type: ScoverageReport) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version now creates task like report<Test Task Name>Scoverage
as entry task. This task in turn adapts the compile task to use the instrumented classes. This works fine for conventional cases where tests are part of same module.
However in our case as we have a separate test module and further to capture coverage of code running within container (as part of integration test) we copy the coverage metrics files manually we cannot use default tasks.
Hence the report task duplicate bit of logic from actual task and clones the config from generated reportTestCoverage
task
@@ -250,8 +255,33 @@ gradle.projectsEvaluated { | |||
showStandardStreams = true | |||
exceptionFormat = 'full' | |||
} | |||
maxHeapSize = "1024m" //Gradle 5.5 defaults to 512MB which is low |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Gradle 5.0 it now defaults to 512M of heap. Due to this OOM was seen in test runs on Travis (which has 7 GB memory). Hence specifying the size explicitly to 1024 MB now
All workers, including compilers and test executors, now start with 512MB of heap. The previous default was 1/4th of physical memory. Large projects may have to increase this setting on the relevant tasks, e.g. JavaCompile or Test.
@@ -17,6 +17,6 @@ | |||
|
|||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to 5.5.1 and also to all
mode so as to enable code assists in IDE
@@ -43,13 +43,6 @@ gradle.ext.scalafmt = [ | |||
config: new File(rootProject.projectDir, '.scalafmt.conf') | |||
] | |||
|
|||
gradle.ext.scoverage = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now scoverage plugin internally adapts the classpath with required dependencies. So no need to explicitly add them
* Aggregates the scoverage xml reports from various modules into a | ||
* single report | ||
*/ | ||
task aggregateCoverage(type: JavaExec, dependsOn: reportCoverage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task was never used as we rely on codecov to perform actual aggregation
This PR is now ready for review |
@dgrove-oss @rabbah Can you review this PR. Once merged we can then work on publishing Maven artifacts from core repo (#4579). Not sure if any PG run is needed as it would impact the build process |
@@ -30,7 +30,7 @@ set APP_BASE_NAME=%~n0 | |||
set APP_HOME=%DIRNAME% | |||
|
|||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | |||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 | |||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this too low?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but thats the current default in there generated files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a different heap size is appropriate, we can change it. It's fine for us to diverge from the upstream gradlew[.bat] as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now build seems to work fine. If we see any issue then we can change. I believe Gradle wrapper internally forks a new jvm process so it needs bare minimum memory for its work
No issues on my side using this patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. Only comment was on heapsize argument in default JVM args in gradlew; feel free to deviate from upstream version to set a default appropriate to this project if you want.
Updates Gradle to 5.5 to enable work with JDK 11. Along with that it also upgrades the scoverage plugin as the older version does not work with Gradle 5. Due to various changes in how scoverage works we needed to adapt the way how instrumented classes are included in test runs
Updates Gradle to 5.5 version and also updates Gradle Scoverage plugin to 3.1.5
Description
For enabling running and building on JDK 11 (#4217) we need to move to Gradle 5.x version which officially supports JDK 11. In doing so we would need to update the Gradle Scoverage plugin to 3.1.5 as existing version was not compatible
Benefits
Scoverage Version Impact
Newer soverage plugin has a different model of working and does not produce a jar of instrumented classes which impacts our logic for coverage collection for code running within container (#3685). To make it work we now copy the instrumented classes within container and remove existing packaged jars from the lib
Related issue and scope
My changes affect the following components
Types of changes
Checklist: