diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-04-03 18:58:39 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-05 12:36:45 +0100 |
commit | 46e76ffd460933ab35da4cfd3509f7c5de5ecd93 (patch) | |
tree | 741b29a7a214446b948cf507413fd638942e441a /scripts | |
parent | d8e14df29d28bfe805dc746f43c9f3a7726e57ce (diff) | |
download | openembedded-core-46e76ffd460933ab35da4cfd3509f7c5de5ecd93.tar.gz openembedded-core-46e76ffd460933ab35da4cfd3509f7c5de5ecd93.tar.bz2 openembedded-core-46e76ffd460933ab35da4cfd3509f7c5de5ecd93.zip |
build-perf-test-wrapper.sh: support sending email reports
Add new '-E' command line option for sending an email report to
specified recipient.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/contrib/build-perf-test-wrapper.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh index c8471977d2..49bc298c5b 100755 --- a/scripts/contrib/build-perf-test-wrapper.sh +++ b/scripts/contrib/build-perf-test-wrapper.sh @@ -19,6 +19,7 @@ # oe-build-perf-test and archives the results. script=`basename $0` +script_dir=$(realpath $(dirname $0)) archive_dir=~/perf-results/archives usage () { @@ -32,6 +33,7 @@ Optional arguments: -c COMMITISH test (checkout) this commit, <branch>:<commit> can be specified to test specific commit of certain branch -C GIT_REPO commit results into Git + -E EMAIL_ADDR send email report -P GIT_REMOTE push results to a remote Git repository -w WORK_DIR work dir for this script (default: GIT_TOP_DIR/build-perf-test) @@ -39,12 +41,16 @@ Optional arguments: EOF } +get_os_release_var () { + ( source /etc/os-release; eval echo '$'$1 ) +} + # Parse command line arguments commitish="" oe_build_perf_test_extra_opts=() oe_git_archive_extra_opts=() -while getopts "ha:c:C:P:w:x" opt; do +while getopts "ha:c:C:E:P:w:x" opt; do case $opt in h) usage exit 0 @@ -55,6 +61,8 @@ while getopts "ha:c:C:P:w:x" opt; do ;; C) results_repo=`realpath -s "$OPTARG"` ;; + E) email_to="$OPTARG" + ;; P) oe_git_archive_extra_opts+=("--push" "$OPTARG") ;; w) base_dir=`realpath -s "$OPTARG"` @@ -178,8 +186,18 @@ if [ -n "$results_repo" ]; then --notes "buildstats/{branch_name}" "$results_dir/buildstats.json" \ "${oe_git_archive_extra_opts[@]}" \ "$results_dir" + + # Send email report + if [ -n "$email_to" ]; then + echo -e "\nEmailing test report" + os_name=`get_os_release_var PRETTY_NAME` + oe-build-perf-report -r "$results_repo" > report.txt + oe-build-perf-report -r "$results_repo" --html > report.html + "$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 + fi fi + echo -ne "\n\n-----------------\n" echo "Global results file:" echo -ne "\n" |