Merge lp:~henninge/launchpad/bug-824435-failure-reporting-3 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Henning Eggers | ||||
Approved revision: | not available | ||||
Merged at revision: | 13800 | ||||
Proposed branch: | lp:~henninge/launchpad/bug-824435-failure-reporting-3 | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~henninge/launchpad/bug-824435-failure-reporting-2 | ||||
To merge this branch: | bzr merge lp:~henninge/launchpad/bug-824435-failure-reporting-3 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Ian Booth (community) | code* | Approve | |
Review via email: mp+72908@code.launchpad.net |
Commit message
[r=jtv,wallyworld][bug=824435][incr] Add tests for the request builds code in requestbuilds_
Description of the change
= Summary =
The next part in my ongoing quest to replace RequestResponse
requestbuild_
triggered by the fact that RequestResponse
"request daily build" but also by "request builds" which uses a
formoverlay to let the user request builds for this recipe. If I am
going to replace RequestResponse
"request builds" still works as it should after the replacement, just
like I did for "request daily build".
The added complexity here is that "request builds" uses both formoverlay
and the webservice client Launchpad, neither of which had been
instrumented yet to work with mockio.
== Proposed fix ==
Add an io_provider parameter to the Launchpad client class and
instrument its methods.
Add an io_provider attribute to the FormOverlay class. This works out
quite well as attributes can have a default value defined, which in
this case will be "Y". So no extra code is needed to select the right
io_provider.
Wire up io_provider in requestbuild_
Launchpad and FormOverlay.
Add the test for "request builds".
== Implementation details ==
I made an effort to remove all the js lint that was reported in
requestbuild_
of the functional changes is found here:
http://
This diff simply exludes the last four revisions which are purely
concerned with lint. Here is the diff of those:
http://
I needed to expose a method in requestbuild_
overlay to be able to isolate the tests in the test suite. Also, the
overlay was clobbered by the failure handler for 5xx errors. I rewrote
that so it displays 5xx errors in the same space of the overlay as other
error messages.
I moved the sample HTML markup to the HTML file and put them inside a
<script type="text/
the content inside them and not display them. Also, the nodes inside
the script tags will not show up in YUI node queries. Very handy, I got
that suggestion from the YUI page.
I had to move the io_provider helpers from mockio.js to to a different
location because files inside the "testing" directory are not included
in launchpad.js. I put them in client.js and gave them better names. I
also moved their tests to test_lp_client.js.
function foo() {} creates a global variable foo.
var foo = function() {} does not.
Just in case you might ask. ;-)
== Tests ==
firefox lib/lp/
firefox lib/lp/
firefox lib/lp/
firefox lib/lp/
== Demo and Q/A ==
=== Verify that requesting build still works. ===
Go to a new recipe and click on "Request build(s)" to request builds.
In the dialog chose just one distroseries and submit the form.
It will close and the new build will appear in the table.
Open the dialog again, select the same distroseries, submit.
You should see an informational message in the lower part of the
dialog.
Close and open the dialog again.
Select the same distroseries again and another one. Submit.
The dialog will not close but the new build is added to the table
on the page.
An informational message will appear.
If you know of ways to trigger 5xx errors, try that, too.
The error will be displayed in the same space as the informational
messages were.
=== Verify Launchpad client and FormOverlay still work ===
As these are used by many pages, some random testing on the page is
advised. Go through some pages and play around with forms that are
displayed as overlays to the page. They all should work like before.
with some
= Launchpad lint =
Hm, these are more files than I changed ...
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
For some reason, after almost an hour, the diff for this mp still has not generated. Given that on IRC it was claimed it was quite large, I wonder if perhaps it is *too* large and that's bogging down the diff generation?