Skip to content

Commit

Permalink
Make benchmark results comment on pull request collapsable (opensearc…
Browse files Browse the repository at this point in the history
…h-project#4914)

Signed-off-by: Rishabh Singh <[email protected]>
  • Loading branch information
rishabh6788 authored Aug 5, 2024
1 parent 09b17d4 commit c835776
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
9 changes: 8 additions & 1 deletion jenkins/opensearch/benchmark-pull-request.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,14 @@ pipeline {
}
post {
success {
sh "sed -i '1i\\#### Benchmark Results for Job: ${BUILD_URL}' final_result_${BUILD_NUMBER}.md"
sh """
echo '<details><summary>Benchmark Results</summary>' > temp_result_${BUILD_NUMBER}.md
echo '' >> temp_result_${BUILD_NUMBER}.md
echo '#### Benchmark Results for Job: ${BUILD_URL}' >> temp_result_${BUILD_NUMBER}.md
cat final_result_${BUILD_NUMBER}.md >> temp_result_${BUILD_NUMBER}.md
echo '</details>' >> temp_result_${BUILD_NUMBER}.md
mv temp_result_${BUILD_NUMBER}.md final_result_${BUILD_NUMBER}.md
"""
script {
if (currentBuild.rawBuild.getCauses().toString().contains("GenericCause")) {
withCredentials([usernamePassword(credentialsId: 'jenkins-github-bot-token', passwordVariable: 'GITHUB_TOKEN', usernameVariable: 'GITHUB_USER')]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@
runBenchmarkTestScript.writeFile({file=/tmp/workspace/benchmark.ini, text=})
runBenchmarkTestScript.sh(set +x && ./test.sh benchmark-test --distribution-url https://artifacts.com/artifact.tar.gz --distribution-version 3.0.0 --config /tmp/workspace/config.yml --workload nyc-taxis --benchmark-config /tmp/workspace/benchmark.ini --user-tag run-type:test,security-enabled:false --without-security --single-node --min-distribution --use-50-percent-heap --suffix 307 --data-instance-type r5-4xlarge --test-procedure append-no-conflicts --data-node-storage 100)
benchmark-pull-request.sh(cp /tmp/final_result_307.md final_result_307.md)
benchmark-pull-request.sh(sed -i '1i\#### Benchmark Results for Job: test://artifact.url' final_result_307.md)
benchmark-pull-request.sh(
echo '<details><summary>Benchmark Results</summary>' > temp_result_307.md
echo '' >> temp_result_307.md
echo '#### Benchmark Results for Job: test://artifact.url' >> temp_result_307.md
cat final_result_307.md >> temp_result_307.md
echo '</details>' >> temp_result_307.md
mv temp_result_307.md final_result_307.md
)
benchmark-pull-request.script(groovy.lang.Closure)
benchmark-pull-request.usernamePassword({credentialsId=jenkins-github-bot-token, passwordVariable=GITHUB_TOKEN, usernameVariable=GITHUB_USER})
benchmark-pull-request.withCredentials([[GITHUB_USER, GITHUB_TOKEN]], groovy.lang.Closure)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@
runBenchmarkTestScript.writeFile({file=/tmp/workspace/benchmark.ini, text=})
runBenchmarkTestScript.sh(set +x && ./test.sh benchmark-test --distribution-url https://artifacts.com/artifact.tar.gz --distribution-version 3.0.0 --config /tmp/workspace/config.yml --workload nyc-taxis --benchmark-config /tmp/workspace/benchmark.ini --user-tag run-type:test,security-enabled:false --without-security --single-node --min-distribution --use-50-percent-heap --suffix 307 --data-instance-type r5-4xlarge --test-procedure append-no-conflicts --data-node-storage 100)
benchmark-pull-request.sh(cp /tmp/final_result_307.md final_result_307.md)
benchmark-pull-request.sh(sed -i '1i\#### Benchmark Results for Job: test://artifact.url' final_result_307.md)
benchmark-pull-request.sh(
echo '<details><summary>Benchmark Results</summary>' > temp_result_307.md
echo '' >> temp_result_307.md
echo '#### Benchmark Results for Job: test://artifact.url' >> temp_result_307.md
cat final_result_307.md >> temp_result_307.md
echo '</details>' >> temp_result_307.md
mv temp_result_307.md final_result_307.md
)
benchmark-pull-request.script(groovy.lang.Closure)
benchmark-pull-request.postCleanup()
postCleanup.cleanWs({disableDeferredWipeout=true, deleteDirs=true})

0 comments on commit c835776

Please sign in to comment.