mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Create ./mach test-perf command
in testing_commands.py, I linked the new command to test_perf.sh in test_perf.sh, it would prepare tp5n.zip and virtual environment then run test_all.sh
This commit is contained in:
parent
0dd005eacc
commit
fd204e0365
5 changed files with 43 additions and 5 deletions
|
@ -24,7 +24,9 @@ Servo Page Load Time Test
|
||||||
## Run
|
## Run
|
||||||
* Activate the virutalenv: `source venv/bin/activate`
|
* Activate the virutalenv: `source venv/bin/activate`
|
||||||
* Sync your system clock before running, the Perfherder API SSL check will fail if your system clock is not accurate. (e.g. `sudo nptdate tw.pool.ntp.org`)
|
* Sync your system clock before running, the Perfherder API SSL check will fail if your system clock is not accurate. (e.g. `sudo nptdate tw.pool.ntp.org`)
|
||||||
* Run `test_all.sh`
|
* Run `test_all.sh [--servo|--gecko] [--submit]`
|
||||||
|
- choose `servo` or `gecko` as the testing engine
|
||||||
|
- enable `submit`, if you want to submit to perfherder
|
||||||
* Test results are submitted to https://treeherder.mozilla.org/#/jobs?repo=servo
|
* Test results are submitted to https://treeherder.mozilla.org/#/jobs?repo=servo
|
||||||
|
|
||||||
# How it works
|
# How it works
|
||||||
|
|
|
@ -41,7 +41,7 @@ def execute_test(url, command, timeout):
|
||||||
|
|
||||||
def get_servo_command(url):
|
def get_servo_command(url):
|
||||||
ua_script_path = "{}/user-agent-js".format(os.getcwd())
|
ua_script_path = "{}/user-agent-js".format(os.getcwd())
|
||||||
return ["./servo/servo", url,
|
return ["../../../target/release/servo", url,
|
||||||
"--userscripts", ua_script_path,
|
"--userscripts", ua_script_path,
|
||||||
"-x", "-o", "output.png"]
|
"-x", "-o", "output.png"]
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,10 @@ while (( "${#}" ))
|
||||||
do
|
do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
--servo)
|
--servo)
|
||||||
engine="--engine servo"
|
engine="--engine=servo"
|
||||||
;;
|
;;
|
||||||
--gecko)
|
--gecko)
|
||||||
engine="--engine gecko"
|
engine="--engine=gecko"
|
||||||
;;
|
;;
|
||||||
--submit)
|
--submit)
|
||||||
submit=1
|
submit=1
|
||||||
|
@ -40,7 +40,7 @@ python3 -m http.server > /dev/null 2>&1 &
|
||||||
# MANIFEST="page_load_test/test.manifest"
|
# MANIFEST="page_load_test/test.manifest"
|
||||||
MANIFEST="page_load_test/tp5n/20160509.manifest" # A manifest that excludes
|
MANIFEST="page_load_test/tp5n/20160509.manifest" # A manifest that excludes
|
||||||
# timeout test cases
|
# timeout test cases
|
||||||
PERF_FILE="output/perf-$(date --iso-8601=seconds).json"
|
PERF_FILE="output/perf-$(date +%s).json"
|
||||||
|
|
||||||
echo "Running tests"
|
echo "Running tests"
|
||||||
python3 runner.py ${engine} --runs 3 "${MANIFEST}" "${PERF_FILE}"
|
python3 runner.py ${engine} --runs 3 "${MANIFEST}" "${PERF_FILE}"
|
||||||
|
|
26
etc/ci/performance/test_perf.sh
Executable file
26
etc/ci/performance/test_perf.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/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://people.mozilla.org/~jmaher/taloszips/zips/tp5n.zip"
|
||||||
|
TP5N_PATH="page_load_test/tp5n.zip"
|
||||||
|
if [[ ! -f "${TP5N_PATH}" ]]; then
|
||||||
|
wget "${TP5N_SOURCE}" -O "${TP5N_PATH}"
|
||||||
|
fi
|
||||||
|
unzip -o "${TP5N_PATH}" -d "$(dirname "${TP5N_PATH}")"
|
||||||
|
|
||||||
|
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
|
||||||
|
./git_log_to_json.sh > servo/revision.json && \
|
||||||
|
./test_all.sh --servo
|
|
@ -169,6 +169,16 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
return call(["cargo", "test"], env=env, cwd=path.join("ports", "geckolib"))
|
return call(["cargo", "test"], env=env, cwd=path.join("ports", "geckolib"))
|
||||||
|
|
||||||
|
@Command('test-perf',
|
||||||
|
description='Run the page load performance test',
|
||||||
|
category='testing')
|
||||||
|
def test_perf(self):
|
||||||
|
self.ensure_bootstrapped()
|
||||||
|
env = self.build_env()
|
||||||
|
return call(["bash", "test_perf.sh"],
|
||||||
|
env=env,
|
||||||
|
cwd=path.join("etc", "ci", "performance"))
|
||||||
|
|
||||||
@Command('test-unit',
|
@Command('test-unit',
|
||||||
description='Run unit tests',
|
description='Run unit tests',
|
||||||
category='testing')
|
category='testing')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue