Skip to content

Commit 5fb2a8a

Browse files
authored
ci(benchmarks): use json.dumps to pass data from configs to test runs (#13844)
this fixes an issue with the startup benchmarks not being able to properly set env variables ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [ ] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 3292584 commit 5fb2a8a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

benchmarks/base/run.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22

3+
import json
34
import os
45
import subprocess
56
import sys
@@ -45,7 +46,11 @@ def run(scenario_py, cname, cvars, output_dir):
4546
]
4647
for cvarname, cvarval in cvars.items():
4748
cmd.append("--{}".format(cvarname))
48-
cmd.append(str(cvarval))
49+
if isinstance(cvarval, (dict, list)):
50+
# convert dicts and lists to JSON strings
51+
cmd.append(json.dumps(cvarval))
52+
else:
53+
cmd.append(str(cvarval))
4954

5055
proc = subprocess.Popen(cmd)
5156
proc.wait()

0 commit comments

Comments
 (0)