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

always produce coverage reports for unit & integration tests #326

Merged
merged 1 commit into from
Sep 22, 2017

Conversation

cburroughs
Copy link
Contributor

Previously code coverage reports were only generated as part of the
site goal, and were thus rarely looked at. Binding the reports to
the same phase ensures they are always available for inspection.

Due to shading, several hoops need to be jumped through so that the
integration test report can refer to the source and classes under test.
Actions are bound to several maven phases to move files around, acting
as if java-manta-client was part of the integration test module.

ref #317

@cburroughs cburroughs requested review from dekobon and tjcelaya August 29, 2017 20:52
@dekobon
Copy link
Contributor

dekobon commented Aug 29, 2017

Would it be simpler to do this change after #307?

@@ -234,31 +234,31 @@
<relocations>
<relocation>
<pattern>com.joyent.http</pattern>
<shadedPattern>com.joyent.manta.http</shadedPattern>
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the rational to change the shaded pattern? I'll admit the original package name was suboptimal.

If you want to change it, you will need to look for the code points where we detect if we are using a shaded artifact or not. If I recall correctly, this is being done in the kryo module and it may be done elsewhere. In those places, there is a string that refers to the shaded package name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It made it easier to exclude them later, since all of the shaded classes match a single pattern. I think it could work with shadedPattern untouched and a more complicated pattern to unpack later.

@cburroughs
Copy link
Contributor Author

@dekobon
Copy link
Contributor

dekobon commented Aug 30, 2017

@cburroughs
Copy link
Contributor Author

Kept the existing shaded paths, and adding corresponding exclusions.

@cburroughs cburroughs force-pushed the inter-cov-diff branch 2 times, most recently from cbaa1ce to 40ee31b Compare September 20, 2017 13:56
Previously code coverage reports were only generated as part of the
`site` goal, and were thus rarely looked at.  Binding the reports to
the same phase ensures they are always available for inspection.

Due to shading, several hoops need to be jumped through so that the
integration test report can refer to the source and classes under test.
Actions are bound to several maven phases to move files around, acting
as if java-manta-client was part of the integration test module.

ref TritonDataCenter#317
@cburroughs
Copy link
Contributor Author

Copy link
Contributor

@dekobon dekobon left a comment

Choose a reason for hiding this comment

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

LGTM

<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<includes>**/*.class</includes>
<excludes>com/joyent/manta/com/**,com/joyent/manta/org/**,com/joyent/manta/io/**,com/joyent/manta/http/signature/**</excludes>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, under what circumstances would this <excludes> list change? They seem to be the relocation roots but I just want to be sure I know how to maintain this. I'm assuming coverage for library classes shows up if this isn't set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, this is just working backwards from the relocation roots in java-manta-client/pom.xml. Additions there may also require changes here. At some point (4.0?) I think it would be worthwhile to have only a single package path for relocated (ex com.joyent.manta.shade) just to keep things a bit tidier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed about the single package relocation. The question of "why isn't everything shaded to the same place?" has crossed my mind once before. I'll file an issue for this.

@cburroughs cburroughs merged commit b57de7a into TritonDataCenter:master Sep 22, 2017
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.

3 participants