Skip to content
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

[dubbo-1521]add java 9 in travis yml #1575

Merged
merged 1 commit into from
Apr 10, 2018
Merged

[dubbo-1521]add java 9 in travis yml #1575

merged 1 commit into from
Apr 10, 2018

Conversation

htynkn
Copy link
Member

@htynkn htynkn commented Apr 9, 2018

What is the purpose of the change

add java9 in ci

Brief changelog

use jacoco
fix reflection issue

Verifying this change

ci pass
coverage in codecov.io

close #1521

@codecov-io
Copy link

Codecov Report

Merging #1575 into master will increase coverage by 2.26%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1575      +/-   ##
============================================
+ Coverage     32.17%   34.43%   +2.26%     
- Complexity        0     3669    +3669     
============================================
  Files           682      618      -64     
  Lines         32972    30823    -2149     
  Branches       6597     5445    -1152     
============================================
+ Hits          10608    10615       +7     
+ Misses        20468    18378    -2090     
+ Partials       1896     1830      -66
Impacted Files Coverage Δ Complexity Δ
...a/com/alibaba/dubbo/common/utils/ReflectUtils.java 44.7% <100%> (+0.63%) 112 <0> (+112) ⬆️
...ng/transport/dispatcher/WrappedChannelHandler.java 30.3% <0%> (-12.13%) 2% <0%> (+2%)
...com/alibaba/dubbo/common/logger/LoggerFactory.java 28.26% <0%> (-7.16%) 3% <0%> (+3%)
...ing/transport/dispatcher/ChannelEventRunnable.java 77.08% <0%> (-6.25%) 9% <0%> (+9%)
...ubbo/common/compiler/support/AbstractCompiler.java 45.45% <0%> (-4.55%) 3% <0%> (+3%)
...bo/remoting/transport/netty/NettyCodecAdapter.java 53.12% <0%> (-3.6%) 3% <0%> (+3%)
...ibaba/dubbo/rpc/protocol/thrift/ThriftInvoker.java 56.81% <0%> (-3.19%) 5% <0%> (+5%)
.../com/alibaba/dubbo/rpc/filter/ExceptionFilter.java 19.04% <0%> (-2.39%) 2% <0%> (+2%)
...rpc/protocol/thrift/ext/MultiServiceProcessor.java 12.76% <0%> (-2.13%) 3% <0%> (+3%)
...ubbo/remoting/transport/mina/MinaCodecAdapter.java 56.89% <0%> (-2.12%) 3% <0%> (+3%)
... and 199 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 497803c...fe265bf. Read the comment docs.

</configuration>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${maven_jacoco_version}</version>
Copy link
Member

@kimmking kimmking Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jacoco instead of cobertura?**

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kimmking yes, this pr is using jacoco.
cobertura is no longer active since 2015. There is no support for java9 and higher version.
so in order to support java9 and even java10, we must try another tool to replace cobertura

jacoco is a good choice here:

  • jacoco use agent to capture test coverage, it's more quick
  • jacoco has a active team and also it support java9 and java10
  • jacoco has lots of users in community. for example, gradle has built-in support for jacoco

@lovepoem
Copy link
Member

lovepoem commented Apr 9, 2018

Have you tested when the program error or the test case doesn't pass, will the CI process terminate? @htynkn

@htynkn
Copy link
Member Author

htynkn commented Apr 10, 2018

@lovepoem please refer this build: https://travis-ci.org/diamondblack/incubator-dubbo
If test fail, CI will fail too. logs here: https://api.travis-ci.org/v3/job/364388877/log.txt

@lovepoem
Copy link
Member

Look good to me

@lovepoem lovepoem merged commit c25d462 into apache:master Apr 10, 2018
@@ -910,6 +910,9 @@ private static Object getEmptyObject(Class<?> returnType, Map<Class<?>, Object>
while (cls != null && cls != Object.class) {
Field[] fields = cls.getDeclaredFields();
for (Field field : fields) {
if (field.isSynthetic()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to include this change?

@@ -910,6 +910,9 @@ private static Object getEmptyObject(Class<?> returnType, Map<Class<?>, Object>
while (cls != null && cls != Object.class) {
Field[] fields = cls.getDeclaredFields();
for (Field field : fields) {
if (field.isSynthetic()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose to add this filter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lovepoem @beiwei30
please refer to jacoco faq http://www.jacoco.org/jacoco/trunk/doc/faq.html
screen shot 2018-04-10 at 12 15 57 pm
We need this change to skip $jacocoData, otherwise test will fail.

Also skip synthetic field in reflection is also a good practice.
Refer to those two links:

According to the JVM Spec: "A class member that does not appear in the source code must be marked using a Synthetic attribute." Also, "The Synthetic attribute was introduced in JDK release 1.1 to support nested classes and interfaces."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds reasonable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class is also added synthetic checking?

@htynkn htynkn deleted the chore/add-java-9 branch April 10, 2018 04:27
@chickenlj chickenlj added this to the 2.6.2 milestone Apr 24, 2018
rolandhe pushed a commit to rolandhe/dubbo that referenced this pull request Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add java9 in CI build
6 participants