test: Move perf.js report file to $LOGDIR/web

The tests generate a performance report in $BASEPATH/perf.js and
hooks/pre-push copies it to the website.  To avoid cluttering the working
directory, instead put perf.js in $LOGDIR/web, since it's a test output
artefact.  Update hooks/pre-push to copy from its new location.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-09-13 14:35:29 +10:00 committed by Stefano Brivio
parent 4e9b50f7b6
commit 6f2db0e34b
3 changed files with 4 additions and 4 deletions

View file

@ -34,8 +34,8 @@ ssh "${USER_HOST}" "mkdir -p ${WEB} ${TEST} ${BIN}"
cd test cd test
./ci ./ci
gzip -fk9 perf.js gzip -fk9 test_logs/web/perf.js
scp perf.js perf.js.gz "${USER_HOST}:${WEB}/" scp test_logs/web/perf.js test_logs/web/perf.js.gz "${USER_HOST}:${WEB}/"
scp test_logs/* "${USER_HOST}:${TEST}/" scp test_logs/* "${USER_HOST}:${TEST}/"
./run_demo ./run_demo

1
test/.gitignore vendored
View file

@ -1,4 +1,3 @@
perf.js
test_logs/ test_logs/
mbuto/ mbuto/
*.img *.img

View file

@ -14,7 +14,7 @@
# Author: Stefano Brivio <sbrivio@redhat.com> # Author: Stefano Brivio <sbrivio@redhat.com>
PERF_LINK_COUNT=0 PERF_LINK_COUNT=0
PERF_JS="${BASEPATH}/perf.js" PERF_JS="${LOGDIR}/web/perf.js"
PERF_TEMPLATE_HTML="document.write('"' PERF_TEMPLATE_HTML="document.write('"'
Throughput in Gbps, latency in µs. Threads are <span style="font-family: monospace;">iperf3</span> processes, <i>passt</i> and <i>pasta</i> are currently single-threaded.<br/> Throughput in Gbps, latency in µs. Threads are <span style="font-family: monospace;">iperf3</span> processes, <i>passt</i> and <i>pasta</i> are currently single-threaded.<br/>
@ -126,6 +126,7 @@ for (var i = 0; i < perf_links.length; i++) {
# perf_init() - Process first part of template # perf_init() - Process first part of template
perf_init() { perf_init() {
mkdir -p "$(dirname "${PERF_JS}")"
echo "${PERF_TEMPLATE_HTML}" > "${PERF_JS}" echo "${PERF_TEMPLATE_HTML}" > "${PERF_JS}"
perf_report_sub commit "$(echo ${COMMIT} | sed "s/'/\\\'/g")" perf_report_sub commit "$(echo ${COMMIT} | sed "s/'/\\\'/g")"
} }