summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/contrib/build-perf-test-wrapper.sh20
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 @@
19# oe-build-perf-test and archives the results. 19# oe-build-perf-test and archives the results.
20 20
21script=`basename $0` 21script=`basename $0`
22script_dir=$(realpath $(dirname $0))
22archive_dir=~/perf-results/archives 23archive_dir=~/perf-results/archives
23 24
24usage () { 25usage () {
@@ -32,6 +33,7 @@ Optional arguments:
32 -c COMMITISH test (checkout) this commit, <branch>:<commit> can be 33 -c COMMITISH test (checkout) this commit, <branch>:<commit> can be
33 specified to test specific commit of certain branch 34 specified to test specific commit of certain branch
34 -C GIT_REPO commit results into Git 35 -C GIT_REPO commit results into Git
36 -E EMAIL_ADDR send email report
35 -P GIT_REMOTE push results to a remote Git repository 37 -P GIT_REMOTE push results to a remote Git repository
36 -w WORK_DIR work dir for this script 38 -w WORK_DIR work dir for this script
37 (default: GIT_TOP_DIR/build-perf-test) 39 (default: GIT_TOP_DIR/build-perf-test)
@@ -39,12 +41,16 @@ Optional arguments:
39EOF 41EOF
40} 42}
41 43
44get_os_release_var () {
45 ( source /etc/os-release; eval echo '$'$1 )
46}
47
42 48
43# Parse command line arguments 49# Parse command line arguments
44commitish="" 50commitish=""
45oe_build_perf_test_extra_opts=() 51oe_build_perf_test_extra_opts=()
46oe_git_archive_extra_opts=() 52oe_git_archive_extra_opts=()
47while getopts "ha:c:C:P:w:x" opt; do 53while getopts "ha:c:C:E:P:w:x" opt; do
48 case $opt in 54 case $opt in
49 h) usage 55 h) usage
50 exit 0 56 exit 0
@@ -55,6 +61,8 @@ while getopts "ha:c:C:P:w:x" opt; do
55 ;; 61 ;;
56 C) results_repo=`realpath -s "$OPTARG"` 62 C) results_repo=`realpath -s "$OPTARG"`
57 ;; 63 ;;
64 E) email_to="$OPTARG"
65 ;;
58 P) oe_git_archive_extra_opts+=("--push" "$OPTARG") 66 P) oe_git_archive_extra_opts+=("--push" "$OPTARG")
59 ;; 67 ;;
60 w) base_dir=`realpath -s "$OPTARG"` 68 w) base_dir=`realpath -s "$OPTARG"`
@@ -178,8 +186,18 @@ if [ -n "$results_repo" ]; then
178 --notes "buildstats/{branch_name}" "$results_dir/buildstats.json" \ 186 --notes "buildstats/{branch_name}" "$results_dir/buildstats.json" \
179 "${oe_git_archive_extra_opts[@]}" \ 187 "${oe_git_archive_extra_opts[@]}" \
180 "$results_dir" 188 "$results_dir"
189
190 # Send email report
191 if [ -n "$email_to" ]; then
192 echo -e "\nEmailing test report"
193 os_name=`get_os_release_var PRETTY_NAME`
194 oe-build-perf-report -r "$results_repo" > report.txt
195 oe-build-perf-report -r "$results_repo" --html > report.html
196 "$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
197 fi
181fi 198fi
182 199
200
183echo -ne "\n\n-----------------\n" 201echo -ne "\n\n-----------------\n"
184echo "Global results file:" 202echo "Global results file:"
185echo -ne "\n" 203echo -ne "\n"