C0urante commented on code in PR #13302:
URL: https://github.com/apache/kafka/pull/13302#discussion_r1246879168
##########
tests/kafkatest/services/connect.py:
##########
@@ -285,26 +285,31 @@ def append_to_environment_variable(self, envvar, value):
env_opts = "\"%s %s\"" % (env_opts.strip('\"'), value)
self.environment[envvar] = env_opts
- def append_filestream_connectors_to_classpath(self):
+ def maybe_append_filestream_connectors_to_classpath(self):
if self.include_filestream_connectors:
- cwd = os.getcwd()
- self.logger.info("Including filestream connectors when starting
Connect. "
- "Looking for jar locally in: %s" % cwd)
- relative_path = "/connect/file/build/libs/"
- local_dir = cwd + relative_path
- lib_dir = self.path.home() + relative_path
- for pwd, dirs, files in os.walk(local_dir):
- for file in files:
- if file.startswith("connect-file") and
file.endswith(".jar"):
- # Use the expected directory on the node instead of
the path in the driver node
- file_path = lib_dir + file
- self.logger.debug("Appending %s to Connect worker's
CLASSPATH" % file_path)
- return "export CLASSPATH=${CLASSPATH}:%s; " % file_path
- self.logger.info("Jar with filestream connectors was not found
under %s" % lib_dir)
+ return self.append_module_to_classpath("file")
else:
self.logger.info("Starting Connect without filestream connectors
in the CLASSPATH")
+ return ""
- return None
+ def append_test_plugins_to_classpath(self):
+ return self.append_module_to_classpath("test-plugins")
+
+ def append_module_to_classpath(self, module):
+ cwd = os.getcwd()
+ relative_path = "/connect/" + module + "/build/libs/"
+ local_dir = cwd + relative_path
+ lib_dir = self.path.home() + relative_path
+ for pwd, dirs, files in os.walk(local_dir):
+ for file in files:
+ if file.endswith(".jar"):
+ # Use the expected directory on the node instead of the
path in the driver node
+ file_path = lib_dir + file
+ self.logger.debug("Appending %s to Connect worker's
CLASSPATH" % file_path)
Review Comment:
One last nit: raise to INFO level to replace [this log
message](https://github.com/apache/kafka/blob/30b087ead967b28d459945fe90c80545bf189d1f/tests/kafkatest/services/connect.py#L291-L292)?
```suggestion
self.logger.info("Appending %s to Connect worker's
CLASSPATH" % file_path)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]