bug 392748 (talos should use PyYAML instead of Syck to read config file) r=rhelmer/anodelman a=myk

git-svn-id: svn://10.0.0.236/trunk@232414 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
anodelman%mozilla.com
2007-08-20 21:22:26 +00:00
parent 6236326904
commit cf5bf90738
3 changed files with 17 additions and 22 deletions

View File

@@ -27,10 +27,9 @@ these performance tests:
the page_load_test/ directory into htdocs/ directory of Apache (found on most systems
at c:\Program Files\Apache Software Foundation\Apache2.2\htdocs)
* Syck YAML Parser
You'll need to download and install Syck from http://whytheluckystiff.net/syck/
Install the binary (a standard install) and the Python extension:
cd ext/python/ && python setup.py build && sudo python setup.py install
* PyYAML YAML Parser
You'll need to download and install PyYAML from http://pyyaml.org/wiki/PyYAML
(or via your OS's package installation system on Linux).
1. Make sure the prerequisites, above, are installed.
2. Copy this entire directory and all subdirectories onto your local disk

View File

@@ -49,7 +49,7 @@ __author__ = 'annie.sullivan@gmail.com (Annie Sullivan)'
import time
import syck
import yaml
import sys
import urllib
import tempfile
@@ -99,27 +99,23 @@ def test_file(filename):
# Read in the profile info from the YAML config file
config_file = open(filename, 'r')
# some versions of syck take a file, while others take a string
try:
yaml = syck.load(config_file)
except:
yaml = syck.load("".join(config_file.readlines()))
yaml_config = yaml.load(config_file)
config_file.close()
for item in yaml:
for item in yaml_config:
if item == 'title':
title = yaml[item]
title = yaml_config[item]
elif item == 'filename':
filename_prefix = yaml[item]
filename_prefix = yaml_config[item]
elif item == 'testdate':
testdate = yaml[item]
testdate = yaml_config[item]
else:
new_config = [yaml[item]['preferences'],
yaml[item]['extensions'],
yaml[item]['firefox'],
yaml[item]['branch'],
yaml[item]['branchid'],
yaml[item]['profile_path'],
yaml[item]['env']]
new_config = [yaml_config[item]['preferences'],
yaml_config[item]['extensions'],
yaml_config[item]['firefox'],
yaml_config[item]['branch'],
yaml_config[item]['branchid'],
yaml_config[item]['profile_path'],
yaml_config[item]['env']]
test_configs.append(new_config)
test_names.append(item)
config_file.close()

View File

@@ -137,7 +137,7 @@ def RunStartupTests(profile_configs, num_runs):
profile_dir = ffprofile.CreateTempProfileDir(config[5],
config[0],
config[1])
utils.debug("temp profile dir created")
utils.debug("temp profile dir " + profile_dir + " created")
# Run Firefox once with new profile so initializing it doesn't
# cause a performance hit, and the second Firefox that gets
# created is properly terminated.