Skip to content

Commit

Permalink
Merge pull request #1272 from msimberg/perf-test-no-submit-on-failure
Browse files Browse the repository at this point in the history
Don't attempt to submit performance test results to elastic on failure
  • Loading branch information
msimberg authored Oct 30, 2024
2 parents fcf19ec + 4232fb2 commit d218034
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions .gitlab/scripts/run_performance_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pika_test_options=(
)

index=0
failures=0
for executable in "${pika_targets[@]}"; do
test_opts=${pika_test_options[$index]}
raw_result_file=$(mktemp --tmpdir "${executable}_raw.XXXXXXXXXX.json")
Expand All @@ -124,21 +125,27 @@ for executable in "${pika_targets[@]}"; do
exit_code=$?
set -e
if [[ ${exit_code} -ne 0 ]]; then
failures=$((failures + 1))

echo "${executable} failed with exit code ${exit_code}"
else
# Append command and command line options
json_add_value_string "${result_file}" "metric.benchmark.command" "${executable}"
json_add_value_string "${result_file}" "metric.benchmark.command_options" "${test_opts}"

# Extract name and timing data from raw result file
benchmark_name=$(cat "${raw_result_file}" | keep_json | jq '.outputs[0].name')
benchmark_series=$(cat "${raw_result_file}" | keep_json | jq '.outputs[0].series')
json_add_value_json "${result_file}" "metric.benchmark.name" "${benchmark_name}"
json_add_value_json "${result_file}" "metric.benchmark.series" "${benchmark_series}"

json_merge "${metadata_file}" "${result_file}" "${result_file}"
submit_logstash "${result_file}"
fi

# Append command and command line options
json_add_value_string "${result_file}" "metric.benchmark.command" "${executable}"
json_add_value_string "${result_file}" "metric.benchmark.command_options" "${test_opts}"

# Extract name and timing data from raw result file
benchmark_name=$(cat "${raw_result_file}" | keep_json | jq '.outputs[0].name')
benchmark_series=$(cat "${raw_result_file}" | keep_json | jq '.outputs[0].series')
json_add_value_json "${result_file}" "metric.benchmark.name" "${benchmark_name}"
json_add_value_json "${result_file}" "metric.benchmark.series" "${benchmark_series}"

json_merge "${metadata_file}" "${result_file}" "${result_file}"
submit_logstash "${result_file}"

index=$((index + 1))
done

if ((failures > 0)); then
exit 1
fi

0 comments on commit d218034

Please sign in to comment.