Skip to content

Commit

Permalink
Fixing post_results_to_develop.py to get the correct branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Sep 21, 2023
1 parent 0d92ccc commit 0f27534
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion k-distribution/tests/profiling/post_results_to_develop.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def execute_command(command):
'\"X-GitHub-Api-Version:', '2022-11-28\"', API_URL]
FROM_BRANCH = json.loads(execute_command(branch_command))[0]['head']['label']

# If FROM_BRANCH contains user information get only the branch name
if ':' in FROM_BRANCH: FROM_BRANCH = FROM_BRANCH.split(':')[1]

print("Exporting last bencher report from", FROM_BRANCH, "to", TO_BRANCH)

# This command will generate a JSON file with a list containing the last reports
Expand All @@ -49,6 +52,8 @@ def execute_command(command):
k_framework = [item for item in data if item['project']['slug'] == 'k-framework'
and item['branch']['slug'] == FROM_BRANCH]

print("Found", len(k_framework), "reports for k-framework in", FROM_BRANCH)

# Append the last 6 reports to the list, they correspond to the last performance
# execution on the last commit in FROM_BRANCH
def get_name_and_value(item):
Expand All @@ -64,7 +69,7 @@ def get_name_and_value(item):

branch = item['branch']
print("Appended:", benchmark_name, "created in", item['created'],
"on branch", branch['name'], "with version", branch['version']['number'])
"on branch", branch['name'], "with id", branch['version']['number'])

data.update({benchmark_name: {metric_name_size: {"value": value_size},
metric_name_memory: {"value": value_memory}}
Expand Down

0 comments on commit 0f27534

Please sign in to comment.