Skip to content

Commit d548eac

Browse files
committed
Script to configure all versions of librdkafka and confluent-kafka-python to soak test
1 parent 50c838d commit d548eac

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

tests/soak/bootstrap.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ sudo dpkg -i otel_collector_package.deb
3030
rm otel_collector_package.deb
3131
sudo cp otel-config.yaml /etc/otelcol-contrib/config.yaml
3232
sudo systemctl restart otelcol-contrib
33+
cp setup_all_versions.py $HOME/setup_all_versions.py
34+
chmod +x $HOME/setup_all_versions.py
3335

3436
./build.sh $librdkafka_branch $python_branch
3537

tests/soak/setup_all_versions.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python3
2+
import os
3+
import subprocess
4+
5+
PYTHON_SOAK_TEST_BRANCH = 'dev_otel_agent_soak_test'
6+
7+
LIBRDKAFKA_VERSIONS=[
8+
#'2.11.1'
9+
#'2.10.1',
10+
'2.8.0',
11+
'2.6.1',
12+
'2.5.3',
13+
'2.4.0',
14+
'2.3.0',
15+
'2.2.0',
16+
'2.1.1',
17+
'2.0.2'
18+
]
19+
20+
PYTHON_VERSIONS=[
21+
#'2.11.0'
22+
#'2.10.1',
23+
'2.8.0',
24+
'2.6.1',
25+
'2.5.3',
26+
'2.4.0',
27+
'2.3.0',
28+
'2.2.0',
29+
'2.1.1',
30+
'2.0.2'
31+
]
32+
33+
def run(command):
34+
print(f'Running command: {command}')
35+
env = os.environ.copy()
36+
env['MAKEFLAGS'] = 'SHELL=/bin/bash -j8' # For parallel make jobs
37+
result = subprocess.run(command, shell=True, env=env)
38+
if result.returncode != 0:
39+
raise Exception(f'Command failed: {command}, result: {result.returncode}')
40+
41+
if __name__ == '__main__':
42+
for i, librdkafka_version in enumerate(LIBRDKAFKA_VERSIONS):
43+
python_version = PYTHON_VERSIONS[i]
44+
folder_name = f'confluent-kafka-python_{librdkafka_version.replace('.', '_')}'
45+
if os.path.exists(folder_name):
46+
print(f'Skipping \'{folder_name}\', already exists.')
47+
continue
48+
49+
run(f'git clone https://github.com/confluentinc/confluent-kafka-python.git')
50+
run(f'mv confluent-kafka-python {folder_name}')
51+
run(f'cd {folder_name} && git checkout {PYTHON_SOAK_TEST_BRANCH}')
52+
run(f'cd {folder_name}/tests/soak && ./build.sh v{librdkafka_version} v{python_version}')
53+
run(f'cp config/*.config {folder_name}/tests/soak')

0 commit comments

Comments
 (0)