Skip to content

Commit

Permalink
Fix benchmark comparison in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vaithak committed Aug 23, 2023
1 parent fcec295 commit 1cd77a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,8 @@ jobs:
COMPARER='./googlebenchmark-prefix/src/googlebenchmark/tools/compare.py'
for baseline in *-$hash.json
do
common=${baseline:0:-12}
pr_change=$(find . ! -name '*$hash.json' -name "${common}*.json")
common=${baseline%$hash.json}
pr_change=$(find . ! -name "*$hash.json" -name "$common*.json")
echo "Running 'python3 ${COMPARER} benchmarks '${baseline}' '${pr_change}''"
python3 ${COMPARER} benchmarks ${baseline} ${pr_change}
Expand Down
10 changes: 5 additions & 5 deletions cmake/modules/AddCladBenchmark.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Find the current branch.
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE CURRENT_REPO_BRANCH
COMMAND git rev-parse HEAD
OUTPUT_VARIABLE CURRENT_REPO_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE "/" "" CURRENT_REPO_BRANCH ${CURRENT_REPO_BRANCH})
string(REPLACE "/" "" CURRENT_REPO_COMMIT ${CURRENT_REPO_COMMIT})

# Ask cmake to reconfigure each time we change the branch so that it can change
# the value of CURRENT_REPO_BRANCH.
# the value of CURRENT_REPO_COMMIT.
set_property(DIRECTORY APPEND PROPERTY
CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/.git/HEAD")

Expand Down Expand Up @@ -74,7 +74,7 @@ function(CB_ADD_GBENCHMARK benchmark)
# Add benchmark as a CTest
add_test(NAME clad-${benchmark}
COMMAND ${benchmark} --benchmark_out_format=json
--benchmark_out=clad-gbenchmark-${benchmark}-${CURRENT_REPO_BRANCH}.json
--benchmark_out=clad-gbenchmark-${benchmark}-${CURRENT_REPO_COMMIT}.json
--benchmark_color=false)
set_tests_properties(clad-${benchmark} PROPERTIES
TIMEOUT "${TIMEOUT_VALUE}"
Expand Down

0 comments on commit 1cd77a2

Please sign in to comment.