Commit Graph

9224 Commits

Author SHA1 Message Date
Sajith Sasidharan
201c08dbe5 Declare JSON request interface using @implementer
"zope.interface.implements(IRequest)" is deprectated in favor of
"@zope.interface.implementer(IRequest)" decorator.
2020-04-20 16:54:51 -04:00
Sajith Sasidharan
82cd5a87fe Use DummyRequest in storage tests
Using twisted.web.server.Request causes test_new_style_classes to
fail like so:

  Traceback (most recent call last):
  Failure: testtools.testresult.real._StringException: Traceback (most recent call last):
    File ".tox/coverage/lib/python2.7/site-packages/allmydata/test/test_python2_regressions.py", line 69, in test_new_style_classes
      "Expected to find no classic classes.",
    File ".tox/coverage/lib/python2.7/site-packages/testtools/testcase.py", line 502, in assertThat
      raise mismatch_error
  testtools.matchers._impl.MismatchError: !=:
  reference = set([])
  actual    = set([<class allmydata.test.test_storage.JSONRequest at 0x7fd938040bb0>])
  : Expected to find no classic classes.

Seems that `DummyRequest` is an acceptable new style class.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
b2b7061980 Refactor storage test helpers
Rewrite `renderSynchronously()` to use `renderDeferred()`
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
72b8f72080 Add docstrings to storage test helpers 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
8b7ef33b3d Remove redundant render_json() method 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
3e7dea7dda Wrap renderer results in tags 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
8c92187d92 Avoid using nevow FakeRequest in storage test.
Use twisted.web.server.Request instead, with a DummyChannel.

There's still one line of inevitable nevow now, because of code in
web/common.py; but that should be easily replaceable once we switch
that over.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
9c7357bc61 Remove an extraneous directive
`t:data` is not really a Twisted template directive.  Added my
mistake, removing now.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
bae32179bf Remove StorageStatus.renderHTTP
This was added to please the test suite. Pleased to remove it!
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
f1fe3a7588 Get rid of WebRenderingMixin in storage test 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
110734daf0 Use a helper to exercise render() in storage test cases 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
554c477cea Prefix member variable with "_" 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
6c3256517a Use slots to render storage stats table 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
0cbe2871fd Give the suite the precise string it wants 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
ff019e5b12 Use BeautifulSoup to check favicon in storage page 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
7625d959bc Use <t:transparent> to render node nickname and id
CI did not like the old way, but it passed in my system.  Odd.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
9bb7812148 Add news fragment 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
36a486426e Mark format_recovered as static method 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
0382b1ec63 Use Unicode strings to render space 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
aab940f65f Remove redundant None-checks on self.storage
When no storage is up, `storage_running()` renderer will return a big
honking `no storage server running` message, and no further renderers
will be invoked.  Therefore the extra defense is probably not
required.

(I tested this hypothesis.  The extra defense is not required, unless
there's something I have not seen.)
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
c061f6830e Use successResultOf in renderSynchronously
Get rid of [].append trick when dealing with the deferred.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
e2fc1fc07e Move renderSynchronously to test suite 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
7a053ddeff Use explicit None-check on self.storage 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
9b51bdf7fa Return result from renderHTTP
Bogus renderHTTP, but test failures are now down to three. We just
need to handle requests for JSON now.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
6e9a4e30d7 Add a docstring 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
f22417e51b Rename function for clarity 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
227d06fe64 Add docstrings to StorageStatusElement 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
d3ff578640 Use parentheses in test suite's import statement 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
b1c78244ab Use parentheses in import statement 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
2df2ae92d5 Fix test_storage.WebStatus.test_no_server failure 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
b14f36082c Use <t:transparent /> within table cells 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
d46df30bd0 Use render_space methods to render space 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
0993e61046 Drop unused ctx argument from render_space methods 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
c7a63f957d Refactor so that test_util pass 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
c88c97aad5 Use right syntax for twisted.web.template tags 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
4e81a3a0a2 Check storage server status before using it 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
c019c7e955 Second version of renderSynchronously 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
d3790a4d42 Add missing flattenString import 2020-04-17 15:25:42 -04:00
Sajith Sasidharan
b29652e0f0 Add StorageStatus::renderSynchronously
Related to ticket:3247

test_storage.py wants a `StorageStatus::renderSynchronously()` method
and a `StorageStatus::renderHTTP()` method.  Let us begin with the
goofy first-cut.

Both these methods are not only wrong, but they will also not please
the test suite.  However error messages produced in CI can be shared,
and that way I can hopefully get unstuck.
2020-04-17 15:25:42 -04:00
Sajith Sasidharan
d142ccb159 Use twisted.web.template in web/storage.py
Related to ticket:3247.  Nevow usage has been removed, and generated
page looks the same as its former self, but tests are failing because
test_storage.py assumes that we're using nevow.
2020-04-17 15:25:42 -04:00
Jean-Paul Calderone
34e85ac515
Merge pull request #707 from tahoe-lafs/3303.disable-eliot-test-suite
Disable Eliot test suite
2020-04-17 14:06:48 -04:00
Sajith Sasidharan
e8695f41a0
Merge pull request #706 from sajith/3299.update-pypy
Use 2.7-buster Docker image for pypy
2020-04-17 06:44:00 -04:00
Jean-Paul Calderone
d308577397
Fixes: ticket:3303 2020-04-16 08:24:31 -04:00
Jean-Paul Calderone
30d0953bcf
Disable the Eliot test suite 2020-04-16 08:24:15 -04:00
Jean-Paul Calderone
2136ef46a1
Merge pull request #695 from tahoe-lafs/3284.remove-magic-folder
Remove magic-folder, now a stand-alone project

See https://github.com/LeastAuthority/magic-folder

Fixes: ticket:3284
2020-04-16 08:07:38 -04:00
Jean-Paul Calderone
66cc6e3b76
Merge pull request #705 from tahoe-lafs/3302.report-listener-creation
Report Foolscap Tub Listener creation stack on failure

This may help ease further debugging of EADDRINUSE failures from the test suite.
2020-04-16 07:57:50 -04:00
Jean-Paul Calderone
71aa17ab0b
I assume it's utf-8 2020-04-15 09:07:23 -04:00
Jean-Paul Calderone
d4d8ce4e13
missing front matter 2020-04-15 08:55:00 -04:00
Jean-Paul Calderone
72ca4e8c53
move the imports 2020-04-15 08:54:50 -04:00
Sajith Sasidharan
4fc6840c10 Build Docker images for pypy 2.7-buster on CircleCI 2020-04-14 17:35:44 -04:00