KAFKA-3615: Exclude test jars in kafka-run-class.sh#1263
Conversation
There was a problem hiding this comment.
This seems a bit too broad, can we not make the check a bit stricter?
There was a problem hiding this comment.
There are other files included too. Basically anything that gets built into */build/libs/* will show up be matched.
We should be sure to exclude javadoc, scaladoc, sources, test and test-sources jars.
|
@Ishiihara Just want to confirm that this is only an issue when running from source right? When running from a release the only line that loads jars in # classpath addition for release
CLASSPATH=$CLASSPATH:$base_dir/libs/*It shouldn't stop this change but I would love to have kafka-run-class.sh work the same for both source builds and release builds. If not done here I can open a jira to track that. |
|
@ijuma @granthenke Thanks for the review. I updated the patch to have more specific filtering condition and also make sure that we also filter files in case that we run from binary package. |
|
@Ishiihara In |
|
@Ishiihara @ewencp |
|
|
|
An environmental variable to trigger addition of test jars seems reasonable |
a2fe7c9 to
27e3892
Compare
|
Thanks for the review. Added a INCLUDE_TEST_JARS variable and change |
|
@Ishiihara but presumably this flag needs to be enabled in some of the system tests? |
|
@Ishiihara Offhand, I think Minikdc service and streams-related services will need this flag (in system test code) And then it would probably be good to run in a branch builder |
|
@granders Added include test jars to relevant system test services. |
| done | ||
| shopt -u nullglob | ||
|
|
||
| echo $CLASSPATH |
|
This LGTM, I'll just remove that one extra |
|
@ewencp Thanks for the review, removed the left over debug output. |
|
|
||
| # classpath addition for release | ||
| CLASSPATH=$CLASSPATH:$base_dir/libs/* | ||
| for file in $base_dir/libs; |
There was a problem hiding this comment.
this is broken. It should be for file in $base_dir/libs/*; ... without the glob, you're looping over 1 entry: "libs".
I believe this bug breaks the classpath for all scripts in bin/ in the release artifact
granders hachikuji Can you take a look when you have time? Appreciate your time to review. Author: Liquan Pei <liquanpei@gmail.com> Reviewers: Grant Henke <granthenke@gmail.com>, Geoff Anderson <geoff@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io> Closes apache#1263 from Ishiihara/classpath-no-test-jar
@granders @hachikuji Can you take a look when you have time? Appreciate your time to review.