From f022d37f70c41fc669b72e2439efec1a628d7e24 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 22 Jan 2019 22:57:47 +0000 Subject: [PATCH] build-perf-test-wrapper/report-email: Tweak for ab-helper usage Signed-off-by: Richard Purdie --- config.json | 2 +- scripts/build-perf-test-wrapper.sh | 17 ++++++++++++++--- scripts/oe-build-perf-report-email.py | 5 ++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/config.json b/config.json index f3a5d42..6af15d7 100644 --- a/config.json +++ b/config.json @@ -99,7 +99,7 @@ "buildperf" : { "MACHINE" : "qemux86", "EXTRAPLAINCMDS" : [ - "scripts/contrib/build-perf-test-wrapper.sh -a ${BUILDPERF_RESULTSDIR}/archive -C ${BUILDPERF_RESULTSDIR}/archive-repo -E yocto-perf@yoctoproject.org -d ${BUILDPERF_STATEDIR}/downloads -g ${BUILDPERF_RESULTSDIR}" + "${SCRIPTSDIR}/build-perf-test-wrapper.sh -r ${BUILDPERF_RESULTSDIR} -E yocto-perf@yoctoproject.org -d ${BUILDPERF_STATEDIR}/downloads -w /home/pokybuild/build-perf-test" ] }, "selftest" : { diff --git a/scripts/build-perf-test-wrapper.sh b/scripts/build-perf-test-wrapper.sh index 7cbb5d7..c99e774 100755 --- a/scripts/build-perf-test-wrapper.sh +++ b/scripts/build-perf-test-wrapper.sh @@ -37,6 +37,7 @@ Optional arguments: -E EMAIL_ADDR send email report -g GLOBALRES_DIR where to place the globalres file -P GIT_REMOTE push results to a remote Git repository + -r RESULTS_DIR directory to store results artefacts in -R DEST rsync reports to a remote destination -w WORK_DIR work dir for this script (default: GIT_TOP_DIR/build-perf-test) @@ -53,7 +54,7 @@ get_os_release_var () { commitish="" oe_build_perf_test_extra_opts=() oe_git_archive_extra_opts=() -while getopts "ha:c:C:d:E:g:P:R:w:x" opt; do +while getopts "ha:c:C:d:E:g:P:r:R:w:x" opt; do case $opt in h) usage exit 0 @@ -75,9 +76,17 @@ while getopts "ha:c:C:d:E:g:P:R:w:x" opt; do ;; P) oe_git_archive_extra_opts+=("--push" "$OPTARG") ;; + r) archive_dir=`realpath -s "$OPTARG"`/archive + results_repo=`realpath -s "$OPTARG"`/archive-repo + globalres_dir=`realpath -s "$OPTARG"` + mkdir -p $results_repo $archive_dir + ;; R) rsync_dst="$OPTARG" ;; w) base_dir=`realpath -s "$OPTARG"` + if [ -n "$base_dir" ]; then + rm -rf $base_dir/* + fi ;; x) oe_build_perf_test_extra_opts+=("--xml") ;; @@ -230,6 +239,9 @@ if [ -n "$results_repo" ]; then oe-build-perf-report -r "$results_repo" > $report_txt oe-build-perf-report -r "$results_repo" --html > $report_html + cp $report_txt $globalres_dir/`hostname`_${sanitized_branch}_$git_rev-$timestamp.txt + cp $report_html $globalres_dir/`hostname`_${sanitized_branch}_$git_rev-$timestamp.html + # Send email report if [ -n "$email_to" ]; then echo "Emailing test report" @@ -237,8 +249,7 @@ if [ -n "$results_repo" ]; then "$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[@]}" fi - # Upload report files, unless we're on detached head - if [ -n "$rsync_dst" -a -n "$branch" ]; then + if [ -n "$rsync_dst" ]; then echo "Uploading test report" rsync $report_txt $report_html $rsync_dst fi diff --git a/scripts/oe-build-perf-report-email.py b/scripts/oe-build-perf-report-email.py index 913847b..f4476f5 100755 --- a/scripts/oe-build-perf-report-email.py +++ b/scripts/oe-build-perf-report-email.py @@ -36,10 +36,9 @@ log = logging.getLogger('oe-build-perf-report') # Find js scaper script -SCRAPE_JS = os.path.join(os.path.dirname(__file__), '..', 'lib', 'build_perf', - 'scrape-html-report.js') +SCRAPE_JS = os.path.join(os.path.dirname(__file__), 'oe-build-perf-report-scrape-html-report.js') if not os.path.isfile(SCRAPE_JS): - log.error("Unableto find oe-build-perf-report-scrape.js") + log.error("Unableto find oe-build-perf-report-scrape-html-report.js") sys.exit(1)