Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ./mach test-perf command #13091

Merged
merged 1 commit into from Sep 26, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

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
  • Loading branch information
fuchiao committed Sep 25, 2016
commit fd204e03651b2642bb78ae0796c348561fc47e1c
@@ -24,7 +24,9 @@ Servo Page Load Time Test
## Run
* 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`)
* 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

# How it works
@@ -41,7 +41,7 @@ def execute_test(url, command, timeout):

def get_servo_command(url):
ua_script_path = "{}/user-agent-js".format(os.getcwd())
return ["./servo/servo", url,
return ["../../../target/release/servo", url,
"--userscripts", ua_script_path,
"-x", "-o", "output.png"]

@@ -12,10 +12,10 @@ while (( "${#}" ))
do
case "${1}" in
--servo)
engine="--engine servo"
engine="--engine=servo"
;;
--gecko)
engine="--engine gecko"
engine="--engine=gecko"
;;
--submit)
submit=1
@@ -40,7 +40,7 @@ python3 -m http.server > /dev/null 2>&1 &
# MANIFEST="page_load_test/test.manifest"
MANIFEST="page_load_test/tp5n/20160509.manifest" # A manifest that excludes
# timeout test cases
PERF_FILE="output/perf-$(date --iso-8601=seconds).json"
PERF_FILE="output/perf-$(date +%s).json"

echo "Running tests"
python3 runner.py ${engine} --runs 3 "${MANIFEST}" "${PERF_FILE}"
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

This comment has been minimized.

@shinglyu

shinglyu Aug 31, 2016

Member

Please set the set -o * lines as described in the style guide

This comment has been minimized.

@shinglyu

shinglyu Aug 31, 2016

Member

You may also need to add the license here, run ./mach test-tidy to check


# 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 @@ def test_geckolib(self):

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',
description='Run unit tests',
category='testing')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.