skia2/infra/pathkit/perf_pathkit.sh
Kevin Lubick 371967f791 [canvaskit] Update Chrome version and use npm ci for tests
By using npm ci, we can make sure the versions of the helper
libraries (e.g. Karma, Jasmine) we are testing with locally
is the same as the versions we are using in the continuous
integration system.

The copying is needed because our docker recipe forces us
to run as not root, and this was causing some issues. As a
result, I changed the canvaskit test/perf to not re-use the
same file as pathkit does so copying was easier and the
dependencies between the two modules is broken.

Bug: skia:11077
Change-Id: Ib05890d666d3507d4f724a4ae298484629c7932a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343503
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 15:03:42 +00:00

37 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Copyright 2018 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This assumes it is being run inside a docker container of perf-karma-chrome-tests
# and a Skia checkout has been mounted at /SRC and the output directory
# is mounted at /OUT
set -ex
#BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/pathkit)
BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd`
PATHKIT_DIR=$BASE_DIR/../../modules/pathkit
# We avoid a lot of file permission errors by copying the tests and binary into the Docker
# container and running npm ci there.
cp -R $PATHKIT_DIR /tmp/work
cd /tmp/work
npm ci --cache /tmp/npmcache
# Start the aggregator in the background
/opt/perf-aggregator $@ &
# Run the tests 10 times to get a wide set of data
for i in `seq 1 10`;
do
npx karma start /tmp/work/karma.bench.conf.js --single-run
done
# Tell the aggregator to dump the json
# This curl command gets the HTTP code and stores it into $CODE
CODE=`curl -s -o /dev/null -I -w "%{http_code}" -X POST localhost:8081/dump_json`
if [ $CODE -ne 200 ]; then
# If we don't get 200 back, something is wrong with writing to disk, so exit with error
exit 1
fi