Merge lp:~jml/launchpad/xx-service-txt into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: no longer in the source branch.
Merged at revision: 11955
Proposed branch: lp:~jml/launchpad/xx-service-txt
Merge into: lp:launchpad
Diff against target: 19 lines (+0/-10)
1 file modified
lib/canonical/launchpad/pagetests/webservice/xx-service.txt (+0/-10)
To merge this branch: bzr merge lp:~jml/launchpad/xx-service-txt
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+41392@code.launchpad.net

Description of the change

The branch fixes a failure in lp:launchpad/devel.

Failure in test lib/canonical/launchpad/pagetests/webservice/xx-service.txt
Traceback (most recent call last):
  File "/usr/lib/python2.6/unittest.py", line 279, in run
    testMethod()
  File "/usr/lib/python2.6/doctest.py", line 2152, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for xx-service.txt
  File "lib/canonical/launchpad/pagetests/webservice/xx-service.txt", line 0

----------------------------------------------------------------------
File "lib/canonical/launchpad/pagetests/webservice/xx-service.txt", line 40, in xx-service.txt
Failed example:
    print webservice.get("/builders")
Differences (ndiff with -expected +actual):
    - HTTP/1.1 404 Not Found
    - ...
    + HTTP/1.1 200 Ok
    + Status: 200 Ok
    + Content-Length: 1223
    + Content-Type: application/json
    + Vary: Accept
    + X-Powered-By: Zope (www.zope.org), Python (www.python.org)
    + <BLANKLINE>
    + {"total_size": 2, "start": 0, "entries": [{"description": "The default build-slave", "title": "Bob The Builder", "url": "http://localhost:8221/", "manual": false, "failure_count": 0, "virtualized": false, "active": true, "owner_link": "http://api.launchpad.dev/beta/~launchpad-buildd-admins", "vm_host": null, "self_link": "http://api.launchpad.dev/beta/builders/bob", "http_etag": "\"da39a3ee5e6b4b0d3255bfef95601890afd80709-ac4768307aa3c9b1ac2609287d2ae356b9ed7d06\"", "failnotes": null, "resource_type_link": "http://api.launchpad.dev/beta/#builder", "builderok": true, "name": "bob"}, {"description": "The untrusted build-slave", "title": "The frog builder", "url": "http://localhost:9221/", "manual": false, "failure_count": 0, "virtualized": true, "active": true, "owner_link": "http://api.launchpad.dev/beta/~launchpad-buildd-admins", "vm_host": "localhost-host.ppa", "self_link": "http://api.launchpad.dev/beta/builders/frog", "http_etag": "\"da39a3ee5e6b4b0d3255bfef95601890afd80709-65e7e41a7c01d28b1937a8c91cacb03ebba06af6\"", "failnotes": null, "resource_type_link": "http://api.launchpad.dev/beta/#builder", "builderok": false, "name": "frog"}], "resource_type_link" : "http://api.launchpad.dev/beta/#builders"}

To fix the failure, I have just deleted the test. Testing that a non-exposed web service 404s seems like it might be appropriate for a unit test, but this clearly is not. It might be appropriate as documentation, but I don't see how any user of the webservice will find xx-service.txt, or why any creator of the webservice would consult it.

If it is a critical lynch-pin of our webservice testing strategy, then I'm happy to see it restored, but in some way that is robust against new bits of Launchpad being exposed.

Creating the MP for post-hoc reviews.

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) :
review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

I think the test is trying to say 'things must be explicitly added to
the web service'. A good replacement would be to create a new top
level collection on the fly with a unique name, and check that works
on browsers not on apis. I think that that can wait though.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-service.txt'
2--- lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2010-10-29 13:48:32 +0000
3+++ lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2010-11-20 09:53:34 +0000
4@@ -31,16 +31,6 @@
5 ...
6
7
8-Resources not exposed on the web service
9-========================================
10-
11-Soyuz build set (exposed on the web at /builders) are not available on the
12-web service:
13-
14- >>> print webservice.get("/builders")
15- HTTP/1.1 404 Not Found
16- ...
17-
18 Anonymous requests
19 ==================
20