Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions ci/scripts/go_bench_adapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@

ARROW_ROOT = Path(__file__).parent.parent.parent.resolve()
SCRIPTS_PATH = ARROW_ROOT / "ci" / "scripts"
RUN_REASON = "commit" if os.environ.get("CONBENCH_REF") == "master" else "branch"

if os.environ.get("CONBENCH_REF") == "master":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is CONBENCH_REF set in the workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here:

CONBENCH_REF: ${{ github.ref_name }}

github = {
"repository": os.environ["GITHUB_REPOSITORY"],
"commit": os.environ["GITHUB_SHA"],
"pr_number": None, # implying default branch
}
run_reason = "commit"
else:
github = None # scrape github info from the local repo
run_reason = "branch"

class GoAdapter(BenchmarkAdapter):
result_file = "bench_stats.json"
Expand Down Expand Up @@ -78,12 +88,8 @@ def _transform_results(self) -> List[BenchmarkResult]:
"name": pieces[0],
"params": '/'.join(pieces[1:]),
},
run_reason=RUN_REASON,
github={
"repository": os.environ["GITHUB_REPOSITORY"],
"commit": os.environ["GITHUB_SHA"],
"pr_number": None, # we currently only run this on the default branch
},
run_reason=run_reason,
github=github,
)
parsed.run_name = f"{parsed.run_reason}: {parsed.github['commit']}"
parsed_results.append(parsed)
Expand Down