Just went over this with msonnabaum, this is an attempt to flesh out the initial BOF notes at http://groups.drupal.org/node/133679 and hopefully we can form some @todos for these.

This is all very rough, subject to change, and most of this isn't really my area so please point out errors/omissions etc.

Branches not patches

The test suite is likely to take a long time per test-run, so testing patches will be impractical.

Instead we will use Jenkins/Hudson to run continuos integration tests on branches.

This will initially run on Drupal core only, but could eventually be applied to forks of core in sandboxes (and eventually contributed projects including install profiles).

We can either start with scheduled tests (daily etc.) or have jenkins trigger test runs based on git commits.

Measurement

We need to be able to run tests on differing infrastructure and get comparable results, this means that standard load testing reports based around wall time are mostly not useful.

Instead we'll generate load on the site (possibly with a load testing tool, but drush scripts and simpletests could also be used), then monitor resource usage locally on the server.

This is likely to include:

Cgroups - isolates services (Apache, MySQL) and monitors CPU, memory, etc. separately for each.

XHProf - Only useful for PHP but msonnabaum already has Drupal integration that can log and query test runs, show diffs etc. - this is the most likely way we'll be able to identify what performance regressions are rather than just that they occurred.

Slow query log / log queries not using indexes.

NewRelic offered us a free account for this but not sure how useful that will be for something that's not running continuosly.

In addition to this, depending on the load test runner, we may be able to use browser instrumentation to gather front end statistics (network, DOM, JavaScript). There's also the possibility for running acceptance tests using those same tools.

Test runs vs. test groups vs. test cases

Test run - all the tests end-to-end on the branch. We'd want to reset the full environment for this.

Test groups vs. cases are trickier.

What's a test group?

A test group would be a distinct Jenkins job (triggered by the overall test run).

This could be:

- Run the full simpletest suite
- Run a series of Capybara/selenium tests one after the other (sharing the same database but likely resetting reporting between each run).

What's a test case?
Running the full simpletest suite would likely be a single test case.

Each capybara/selenium (or whichever tool) test would be a single test case. For example testing anonymous page caching, forum listings, node/n, administrative screens might be separate test cases.

Reporting:

Aggregate results from the full test suite, graphed over time.

Aggregate results from test groups, graphed over time.

Browsable results for an individual test run/group - i.e. slow query log, xhprof runs etc.

Would be good to have some kind of pass/fail/regression/improvement indicator for each run but everything is relative so this could be hard.

CommentFileSizeAuthor
#5 xhprof.zip80.3 KBAnonymous (not verified)

Comments

catch’s picture

This may be obvious but it wasn't to me until just now. Doing it this way means it should be pretty easy to have test runs for Drupal 7 - even if the only test case that worked was 'run the full test suite' that is still going to generate some useful data.

Anonymous’s picture

just a note that i think we should be careful with test data based on running the full simpletest suite.

its easy to collect the data, so its a good starting point.

but - unless we control the environment, even calls to the same function can differ without any code changes within the function, so this data can be hard to compare over time, because the test suite can change a lot outside of our perf testing setup.

if we want to do comparisons over time, we need to make each unit as apples to apples as we can, via 'scripts' that we run with our load testing tool.

EDITED to take out the stupid.

rfay’s picture

Great work.

Anonymous’s picture

here's a sandbox with some proof of concept code for generating tests that are wrapped in xhprof profiling code:

http://drupal.org/sandbox/justinrandell/1212436

not saying this is what we have to go with, just playing around to get a feel for it.

Anonymous’s picture

StatusFileSize
new80.3 KB

attached zip xhprof logs that the sandbox code produces.

Anonymous’s picture

Issue summary: View changes

strong tags.