Kevin Lubick | a0ba612 | 2018-08-15 13:45:28 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2018 Google LLC |
| 3 | # |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | # This assumes it is being run inside a docker container of gold-karma-chrome-tests |
| 8 | # and a Skia checkout has been mounted at /SRC and the output directory |
| 9 | # is mounted at /OUT |
| 10 | |
| 11 | # For example: |
Kevin Lubick | 8e9750d | 2018-10-09 09:36:35 -0400 | [diff] [blame^] | 12 | # docker run -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gcr.io/skia-public/gold-karma-chrome-tests:68.0.3440.106_v1 /SRC/infra/pathkit/test_pathkit.sh |
Kevin Lubick | a0ba612 | 2018-08-15 13:45:28 -0400 | [diff] [blame] | 13 | |
| 14 | set -ex |
| 15 | |
Kevin Lubick | 8e9750d | 2018-10-09 09:36:35 -0400 | [diff] [blame^] | 16 | #BASE_DIR is the dir this script is in ($SKIA_ROOT/infra/pathkit) |
Kevin Lubick | a0ba612 | 2018-08-15 13:45:28 -0400 | [diff] [blame] | 17 | BASE_DIR=`cd $(dirname ${BASH_SOURCE[0]}) && pwd` |
Kevin Lubick | 8e9750d | 2018-10-09 09:36:35 -0400 | [diff] [blame^] | 18 | PATHKIT_DIR=$BASE_DIR/../../modules/pathkit |
Kevin Lubick | a0ba612 | 2018-08-15 13:45:28 -0400 | [diff] [blame] | 19 | |
| 20 | # Start the aggregator in the background |
| 21 | /opt/gold-aggregator $@ & |
| 22 | # Run the tests |
Kevin Lubick | f14a3c0 | 2018-08-22 09:35:32 -0400 | [diff] [blame] | 23 | npx karma start $PATHKIT_DIR/karma.conf.js --single-run |
Kevin Lubick | a0ba612 | 2018-08-15 13:45:28 -0400 | [diff] [blame] | 24 | # Tell the aggregator to dump the json |
| 25 | # This curl command gets the HTTP code and stores it into $CODE |
| 26 | CODE=`curl -s -o /dev/null -I -w "%{http_code}" -X POST localhost:8081/dump_json` |
| 27 | if [ $CODE -ne 200 ]; then |
| 28 | # If we don't get 200 back, something is wrong with writing to disk, so exit with error |
| 29 | exit 1 |
| 30 | fi |