Closed
Bug 722381
Opened 14 years ago
Closed 14 years ago
test_file should be separated into more functions
Categories
(Testing :: Talos, defect)
Testing
Talos
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: k0scist, Unassigned)
References
Details
test_file does too many things:
http://hg.mozilla.org/build/talos/file/9c1b3addb9ee/talos/run_tests.py#l402
- it gets the configuration
- it futzes with the configuration
- it gets a device manager
- it may setup a web server
- it runs the tests
- it may report results
I would propose the following:
- getting and futzing with the configuration should go in a new
module, config.py. Eventually we will want to move all
configuration-related things to this file
- combine the methods to get a devicemanager, bug 708052
- move running the tests to its own function
- move reporting to its own function; and actually, eventually this
should be pluggable.
e.g.
report_results(...parameters)
This makes the system more testable and separates concerns.
As a cartoon, test_file should look something like:
def test_file(filename, configuration):
# verify and futz with configuration
config = check_configuration(configuration)
# get a device manager
dm = None
if config['remote']:
dm = utils.get_devicemanager(config['host'], config['port'])
# set up a web server
if config['develop']:
setup_mozhttpd(config['webserver'])
# run the tests
results = run_tests(**config)
# process the results
process_results(results)
I realize that this is a bit off, but wanted to note for posterity.
| Reporter | ||
Comment 1•14 years ago
|
||
This is essentially done. We can take subsequent issues as more specific follow-up
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•