servo/etc/ci/performance/test_perf.sh
bors-servo 5f33d35cde Auto merge of #19207 - asajeffrey:test-perf-add-base-url-option, r=edunham
Add --base option to test-perf.

<!-- Please describe your changes on the following line: -->

Add a `--base <URL>` option to test-perf, which is handy for two reasons: a) it reduces randomness in tests by allowing tests to be file URLs, and b) it doesn't require running the test suite as root (the tp5n manifest hardwires tests served from port 80 on localhost).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because this is test infrastructure

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19207)
<!-- Reviewable:end -->
2017-11-13 19:51:32 -06:00

38 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -o errexit
set -o nounset
set -o pipefail
TP5N_SOURCE="https://github.com/rwood-moz/talos-pagesets/raw/master/tp5n.zip"
TP5N_PATH="page_load_test/tp5n.zip"
if [[ ! -f "$(dirname "${TP5N_PATH}")/tp5n/tp5n.manifest" ]]; then
if [[ ! -f "${TP5N_PATH}" ]]; then
echo "Downloading the test cases..."
wget "${TP5N_SOURCE}" -O "${TP5N_PATH}"
echo "done"
else
echo "Found existing test cases, skipping download."
fi
echo -n "Unzipping the test cases..."
unzip -q -o "${TP5N_PATH}" -d "$(dirname "${TP5N_PATH}")"
echo "done"
else
echo "Found existing test cases, skipping download and unzip."
fi
virtualenv venv --python="$(which python3)"
PS1="" source venv/bin/activate
# `PS1` must be defined before activating virtualenv
pip install "treeherder-client>=3.0.0"
mkdir -p servo
mkdir -p output # Test result will be saved to output/perf-<timestamp>.json
./git_log_to_json.sh > servo/revision.json
./test_all.sh --servo ${*}