-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26838 Junit jar is not included in the hbase tar ball, causing … #4223
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1738871
HBASE-26838 Junit jar is not included in the hbase tar ball, causing …
wchevreuil ef79b4e
Removing blank lines in client.xml; Also moving hamcrest to lib/test
wchevreuil 7f7266c
adding lib/test jars to IntegrationTestIngest classpath
wchevreuil be7c1e7
adding regex check for IntegrationTest in hbase script when deciding …
wchevreuil 968cb3b
adding extra explanation on ref-guide; including mockito in the assem…
wchevreuil b570161
adding test libs on the client tar ball
wchevreuil fb87084
resetting scope test to parent pom and overriding it to compile in as…
wchevreuil 1296a83
Adding comment on assembly pom explaining mockito compile scope
wchevreuil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,8 @@ | |
| <exclude>org.slf4j:*</exclude> | ||
| <exclude>org.apache.logging.log4j:*</exclude> | ||
| <exclude>io.opentelemetry.javaagent:*</exclude> | ||
| <exclude>junit:junit</exclude> | ||
| <exclude>org.hamcrest:hamcrest-core</exclude> | ||
| </excludes> | ||
| </dependencySet> | ||
| </dependencySets> | ||
|
|
@@ -261,6 +263,15 @@ | |
| <include>io.opentelemetry.javaagent:*</include> | ||
| </includes> | ||
| </dependencySet> | ||
|
|
||
| <!-- Adds junit libs to lib/test --> | ||
| <dependencySet> | ||
| <outputDirectory>lib/test</outputDirectory> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noticed this gets missed in the client tarball. Just copy this same block in |
||
| <includes> | ||
| <include>junit:junit</include> | ||
| <include>org.hamcrest:hamcrest-core</include> | ||
| </includes> | ||
| </dependencySet> | ||
| </dependencySets> | ||
|
|
||
| </assembly> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Will we load the libraries under this package?
And better also include hamcrest here.
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.
Yes, these libraries would be packed under a "lib\test" folder, and would not be added to hbase classpath automatically (the hbase script, by default, puts "lib*" on the CP).
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.
I mean we should add these libraries?
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.
You mean add to hbase classpath by default? Junit used to be shipped until it was scoped for test only on all modules, at least since release 2.4 (In 2.2 it was still shipped). In general, HBase processes seem to work pretty fine without it on the CP. The only setback is for the test tooling, such as
IntegrationTestIngest, which will now fail without junit lib in the classpath.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.
So how do we setback when executing IntegrationTestIngest? Manually?
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.
Yes, this could be easily done as
HBASE_CLASSPATH="$HBASE_HOME/lib/tests/*" hbase org.apache.hadoop.hbase.IntegrationTestIngest -m slowDeterministic, since we already provide the lib within the tarball. We could update the ref guide section accordingly.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.
I wonder what is the problem if we always add these jars to our classpath? At lease when running tools(not daemon services)?
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.
Ehh, usually it's been a thing that causes people to ask questions rather than something actually breaking. Apparently others think that we shouldnt' have this on the $CLASSPATH given they removed them.
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 me, it is a security and release hygiene issue to ship test dependencies in the runtime. It is problematic for me that some of our user utilities have runtime dependency on test jars. Only mildly related: I'm curious how much extra space those test dependencies consume in our release artifacts.
Short of the restructuring that I suggested, I am okay with this approach of isolating these test dependencies in their own directory and conditionally including them at runtime. If there are classes that we know require them, our
bin/hbasescript can intelligently add them to the classpath for those classes. Doing so will preserve backward compatibility while also keeping the extra jars out of the daemon services' classpaths.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.
Ok, let me add it to the CP of the tools that require it, in
bin/hbasescript.