Auto-tools/Projects/SpeedTests: Difference between revisions

Jump to navigation Jump to search
Line 9: Line 9:
== Architecture ==
== Architecture ==


Conceptually the system can be split into three parts, the browser controller, the report and test server, and the tests themselves.  However they are best understood by looking at the whole process rather than the individual parts.
Conceptually the system can be split into four parts: the tests, the browser controller, the report server, and test server (the latter two may be combined).  However they are best understood by looking at the whole process rather than the individual parts.


The browser controller has a list of browsers likely to be installed on the target platform.  It iterates through the list, executing the browser if it is found, pointing it to the server path /nexttest/, which replies with a redirect to the first test (in string order).  It also has a simple HTTP server running on a special port, which awaits a callback from the browser when the last test has executed.
Upon starting, the browser controller first fetches a list of tests from the server (in case any have been added or removed since last run--this means clients do not have to be updated when tests change).  It has a list of browsers likely to be installed on the target platform, and iterates through the existing browsers, running each one with each test, separately.  The controller loads a fresh profile before executing each test, and shuts down the browser after each test finishes, to eliminate interactions between tests.  It also has a simple HTTP server running on a special port, which awaits a callback from the browser containing the results after each test executes.


The tests use a common set of JavaScript functions to report results and to load the next test.  The server collects results and serves tests.  When the test is finished, the browser sends the results via XHR and then loads the URL /nexttest/<current test name>, eg. /nexttest/PsychedelicBrowsing/, which redirects to the test that, in string order, follows the current test.  If the current test was the last test, the server redirects the browser to the callback port on the localhost.
The tests use a common set of JavaScript functions to collect and report results.  The browser controller collects results from each browser and forwards them onto the results server (the latter can be disabled for local testing).  When the last browser has executed the last test, the controller shuts down its HTTP server, prints a report to stdout, and exits.


Upon receiving a GET request on the callback port, the browser controller terminates the current browser and launches the next one in the list.  When the last browser has executed the tests, the controller shuts down its HTTP server and exits.
The test server can be the same server as the results server, or it can be separate.  In the current setup, they are separated, with the test server running internally, since we can't distribute the modified tests.  It is the test server that also serves up the JS library for reporting results.
 
The location of the test and result servers is configured in an ini file on the client.


== Implementation ==
== Implementation ==
Confirmed users
1,927

edits

Navigation menu