Skip to content

Commit 6011e9d

Browse files
Copilotphlax
andcommitted
Fix Kafka integration tests to support both WORKSPACE and bzlmod modes
Updated kafka_broker_integration_test.py and kafka_mesh_integration_test.py to detect kafka_bin_dir in both modes instead of hardcoding bzlmod path. Implementation: - Try bzlmod path first: external/_main~envoy_dependencies_extension~kafka_server_binary/bin - Fall back to WORKSPACE path: external/kafka_server_binary/bin - Use os.path.isdir() to check which path exists This fixes Kafka test timeouts in WORKSPACE mode while preserving bzlmod compatibility. Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
1 parent 5db23a1 commit 6011e9d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

configs/configgen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ for FILE in "$@"; do
3030
;;
3131
*)
3232

33-
FILENAME="$(echo "$FILE" | sed -e 's/.*examples[^/]*\///g')"
33+
FILENAME="$(echo "$FILE" | sed -e 's/.*example[^/]*\///g')"
3434
# Configuration filenames may conflict. To avoid this we use the full path.
3535
cp "$FILE" "$OUT_DIR/${FILENAME//\//_}"
3636
;;

contrib/kafka/filters/network/test/broker/integration_test/kafka_broker_integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,11 @@ def start(self):
313313
os.mkdir(kafka_store_dir)
314314

315315
# Find the Kafka server 'bin' directory.
316+
# Try bzlmod path first, fall back to WORKSPACE path
316317
kafka_bin_dir = os.path.join(
317318
'.', 'external', '_main~envoy_dependencies_extension~kafka_server_binary', 'bin')
319+
if not os.path.isdir(kafka_bin_dir):
320+
kafka_bin_dir = os.path.join('.', 'external', 'kafka_server_binary', 'bin')
318321

319322
# Main initialization block:
320323
# - generate random ports,

contrib/kafka/filters/network/test/mesh/integration_test/kafka_mesh_integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,11 @@ def start(self):
392392
os.mkdir(kafka_store_dir2)
393393

394394
# Find the Kafka server 'bin' directory.
395+
# Try bzlmod path first, fall back to WORKSPACE path
395396
kafka_bin_dir = os.path.join(
396397
'.', 'external', '_main~envoy_dependencies_extension~kafka_server_binary', 'bin')
398+
if not os.path.isdir(kafka_bin_dir):
399+
kafka_bin_dir = os.path.join('.', 'external', 'kafka_server_binary', 'bin')
397400

398401
# Main initialization block:
399402
# - generate random ports,

0 commit comments

Comments
 (0)