Merge lp://qastaging/~coreygoldberg/selenium-simple-test/bmobproxy-har into lp://qastaging/selenium-simple-test

Proposed by Corey Goldberg
Status: Merged
Approved by: Michael Foord
Approved revision: 261
Merged at revision: 257
Proposed branch: lp://qastaging/~coreygoldberg/selenium-simple-test/bmobproxy-har
Merge into: lp://qastaging/selenium-simple-test
Diff against target: 809 lines (+347/-64)
12 files modified
MANIFEST.in (+1/-1)
docs/README (+1/-4)
docs/assets/nature.css (+18/-15)
docs/changelog.rst (+44/-0)
docs/conf.py (+1/-1)
docs/index.rst (+71/-15)
src/sst/actions.py (+85/-5)
src/sst/bmobproxy.py (+51/-0)
src/sst/command.py (+10/-8)
src/sst/config.py (+4/-0)
src/sst/runtests.py (+8/-6)
sst-run (+53/-9)
To merge this branch: bzr merge lp://qastaging/~coreygoldberg/selenium-simple-test/bmobproxy-har
Reviewer Review Type Date Requested Status
Michael Foord (community) Approve
Corey Goldberg (community) Needs Resubmitting
Review via email: mp+93838@code.qastaging.launchpad.net

Commit message

Performance tracing with Browsermob Proxy (HAR)

Description of the change

Browsermob Proxy integration.

- added ability to launch/stop browsermob http proxy
- added FF profile settings to route through proxy when enabled
- instrumented actions that trigger pageloads to record/save har files

see "Performance tracing with Browsermob Proxy (HAR)" in docs for more info.

To post a comment you must log in.
Revision history for this message
Michael Foord (mfoord) wrote :

Command line parameter for browsermob should be --browsermob (--proxy is too generic for this specific functionality)

We *really* need a changelog now that we're doing proper releases.

Still reading the rest of the mp.

review: Needs Fixing
Revision history for this message
Michael Foord (mfoord) wrote :

Similarly config.proxy_enabled should be renamed config.browsermob_enabled

Revision history for this message
Michael Foord (mfoord) wrote :

I would marginally prefer "if proxy is not None:" to "if proxy:", purely as a stylistic issue. Not a big deal.

Revision history for this message
Michael Foord (mfoord) wrote :

Line 324 - you can use "x.isalnum()" instead of "x.isalpha() or x.isdigit()".

Revision history for this message
Michael Foord (mfoord) wrote :

When _make_useable_har_name is called without args - on clicking a link for example - then the generated file names will look like:

    har-date-.har

Because stem is empty. Is this ideal? Maybe omit the trailing slash for an empty stem, or use a non-empty stem for default instead of ''.

There's some duplicated code for saving har files (etc) in various actions. This could potentially be implemented as a decorator. *Unfortunately* using the standard decorator pattern clobbers function signatures - so our introspection code that generates the docs would need to be updated. (All decorated functions tend to have a *args, **kwargs signature - our decorator could expose the undecorated function as an attribute, and our doc generating code could know to check that attribute first for finding the function signature.)

Revision history for this message
Michael Foord (mfoord) wrote :

Line 638: should this warning be an error and stop the test run? If not should cmd_opts.proxy be set to False so that we don't *attempt* to start browsermob.

Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

just pushed a new version with changes...

> Command line parameter for browsermob should be
> --browsermob (--proxy is too generic for this
> specific functionality)

done.

> Similarly config.proxy_enabled should be renamed
> config.browsermob_enabled

done. all var names referring to proxy now more clearly named.

> I would marginally prefer "if proxy is not None:" to "if proxy:",
> purely as a stylistic issue. Not a big deal.

done. changed those also.

> Line 324 - you can use "x.isalnum()" instead of
> "x.isalpha() or x.isdigit()".

done. (nice tip)

> When _make_useable_har_name is called without args - on clicking a
> link for example - then the generated file names will look like:
> har-date-.har
> Because stem is empty. Is this ideal? Maybe omit the trailing slash

done. if no stem is provided, format will be har-date.har

> Line 638: should this warning be an error and stop the test run?
> If not should cmd_opts.proxy be set to False so that we don't
> *attempt* to start browsermob.

it's somewhat useful for development to run the internal tests with
browsermob on. it actually still routes requests through the proxy,
it just doesn't record them. i can change it to stop the test run, if
you think a warning will cause confusion.

> There's some duplicated code for saving har files (etc) in various
> actions. This could potentially be implemented as a decorator.

I was thinking a decorator could could be used, but wasn't totally
sure how to approach it. can discuss.

> We *really* need a changelog now that we're doing proper releases.

I will add a changelog.rst in a followup MP.

258. By Corey Goldberg

updates per MP comments

259. By Corey Goldberg

doc update

Revision history for this message
Corey Goldberg (coreygoldberg) :
review: Needs Resubmitting
Revision history for this message
Michael Foord (mfoord) wrote :

Ok, we can discuss the decorator approach - not sure its *necessary*, but it would remove the code duplication.

Note that the doc update still says "config.proxy_enabled" which should now be "config.browsermob_enabled". (Line 184 of diff.)

Other changes look good.

Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

just pushed fix for doc.
changed "config.proxy_enabled" to "config.browsermob_enabled"

260. By Corey Goldberg

doc fix

261. By Corey Goldberg

added changelog

Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

added changelog and pushed.

review: Needs Resubmitting
Revision history for this message
Michael Foord (mfoord) wrote :

Great stuff. The check_flags action is new and doesn't appear in the changelog, but we can add that separately.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches