mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +00:00
build-perf-test-wrapper.sh: support uploading test reports
Implement new '-R' command line option for specifying an rsync destination where to upload test reports. [YOCTO #5049] (From OE-Core rev: ebc37ede5b247347483128f091b505fe33356591) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5403db7f40
commit
4fdb6aa28d
@@ -35,6 +35,7 @@ Optional arguments:
|
|||||||
-C GIT_REPO commit results into Git
|
-C GIT_REPO commit results into Git
|
||||||
-E EMAIL_ADDR send email report
|
-E EMAIL_ADDR send email report
|
||||||
-P GIT_REMOTE push results to a remote Git repository
|
-P GIT_REMOTE push results to a remote Git repository
|
||||||
|
-R DEST rsync reports to a remote destination
|
||||||
-w WORK_DIR work dir for this script
|
-w WORK_DIR work dir for this script
|
||||||
(default: GIT_TOP_DIR/build-perf-test)
|
(default: GIT_TOP_DIR/build-perf-test)
|
||||||
-x create xml report (instead of json)
|
-x create xml report (instead of json)
|
||||||
@@ -50,7 +51,7 @@ get_os_release_var () {
|
|||||||
commitish=""
|
commitish=""
|
||||||
oe_build_perf_test_extra_opts=()
|
oe_build_perf_test_extra_opts=()
|
||||||
oe_git_archive_extra_opts=()
|
oe_git_archive_extra_opts=()
|
||||||
while getopts "ha:c:C:E:P:w:x" opt; do
|
while getopts "ha:c:C:E:P:R:w:x" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h) usage
|
h) usage
|
||||||
exit 0
|
exit 0
|
||||||
@@ -65,6 +66,8 @@ while getopts "ha:c:C:E:P:w:x" opt; do
|
|||||||
;;
|
;;
|
||||||
P) oe_git_archive_extra_opts+=("--push" "$OPTARG")
|
P) oe_git_archive_extra_opts+=("--push" "$OPTARG")
|
||||||
;;
|
;;
|
||||||
|
R) rsync_dst="$OPTARG"
|
||||||
|
;;
|
||||||
w) base_dir=`realpath -s "$OPTARG"`
|
w) base_dir=`realpath -s "$OPTARG"`
|
||||||
;;
|
;;
|
||||||
x) oe_build_perf_test_extra_opts+=("--xml")
|
x) oe_build_perf_test_extra_opts+=("--xml")
|
||||||
@@ -132,6 +135,11 @@ if [ -n "$commitish" ]; then
|
|||||||
git reset --hard $commit > /dev/null
|
git reset --hard $commit > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Determine name of the current branch
|
||||||
|
branch=`git symbolic-ref HEAD 2> /dev/null`
|
||||||
|
# Strip refs/heads/
|
||||||
|
branch=${branch:11}
|
||||||
|
|
||||||
# Setup build environment
|
# Setup build environment
|
||||||
if [ -z "$base_dir" ]; then
|
if [ -z "$base_dir" ]; then
|
||||||
base_dir="$git_topdir/build-perf-test"
|
base_dir="$git_topdir/build-perf-test"
|
||||||
@@ -187,13 +195,25 @@ if [ -n "$results_repo" ]; then
|
|||||||
"${oe_git_archive_extra_opts[@]}" \
|
"${oe_git_archive_extra_opts[@]}" \
|
||||||
"$results_dir"
|
"$results_dir"
|
||||||
|
|
||||||
|
# Generate test reports
|
||||||
|
sanitized_branch=`echo $branch | tr / _`
|
||||||
|
report_txt=`hostname`_${sanitized_branch}_${machine}.txt
|
||||||
|
report_html=`hostname`_${sanitized_branch}_${machine}.html
|
||||||
|
echo -e "\nGenerating test report"
|
||||||
|
oe-build-perf-report -r "$results_repo" > $report_txt
|
||||||
|
oe-build-perf-report -r "$results_repo" --html > $report_html
|
||||||
|
|
||||||
# Send email report
|
# Send email report
|
||||||
if [ -n "$email_to" ]; then
|
if [ -n "$email_to" ]; then
|
||||||
echo -e "\nEmailing test report"
|
echo "Emailing test report"
|
||||||
os_name=`get_os_release_var PRETTY_NAME`
|
os_name=`get_os_release_var PRETTY_NAME`
|
||||||
oe-build-perf-report -r "$results_repo" > report.txt
|
"$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text $report_txt --html $report_html "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}"
|
||||||
oe-build-perf-report -r "$results_repo" --html > report.html
|
fi
|
||||||
"$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text report.txt --html report.html "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}"
|
|
||||||
|
# Upload report files, unless we're on detached head
|
||||||
|
if [ -n "$rsync_dst" -a -n "$branch" ]; then
|
||||||
|
echo "Uploading test report"
|
||||||
|
rsync $report_txt $report_html $rsync_dst
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user