-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for testing JMAP in a murder setup #151
Conversation
realised in the shower that I also want some kinda test_jmap_backend_commands test that verifies that connections directly to the backend don't get proxied, so I'll add that on friday |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and WFM
0e19e0e
to
ac0d731
Compare
It occurs to me that this is not really "JMAP" murder so much as it is "HTTP" murder, and we could use the same mechanism to test DAV-in-murder functionality (if that's a thing; I assume it is but don't really know either way). So I'm tempted to rename If I do that, I probably will split the Murder.pm test suite into separate IMAPMurder.pm and JMAPMurder.pm, allowing for the possibility of additional *DavMurder.pm suites later. Because I think having all those protocols tested in one suite will get real cluttered and hard to maintain. |
Yes. HTTP Murder makes more sense |
ac0d731
to
928d602
Compare
8609516
to
5450f1b
Compare
Mostly refactored, but I need to set up caldavtester and make sure I haven't broken it, which I might have! Next week... |
Looks like I haven't broken caldavtester, whew |
Wait, it was TesterCardDAV that was having problems, not TesterCalDAV. Checking again... |
5450f1b
to
26154ad
Compare
Turns out TesterCardDAV was broken by only enabling "carddav" httpmodule, when it appears that module is dependent on "caldav" too. Have opened cyrusimap/cyrus-imapd#3649 which updates the documentation to reflect this. |
26154ad
to
f17d38d
Compare
@ksmurchison I've now refactored the murder setup stuff like we talked about. Can you review again please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks great!
We could add a JMAP test that uploads a blob via the frontend and download via the backend or vice-versa.
And for completeness, we could add tests via the frontend that GET The session object and do a POST of an API request (something as simple as Core/echo).
I will fix the CardDAV module issue
These are mutually exclusive for now because Cyrus doesn't properly support proxying to backend services on nonstandard ports, and Cassandane requires nonstandard ports, and the way we make it work under Cassandane at all is a nasty hack that can only work for one service at a time.
Rename to make it more closely describe what it's actually doing, and make it decide which to setup based on the test's http service configuration, rather than simply whether $want->{jmap} is set.
This was breaking because _setup_http_service_objects would try to initialise a Net::CardDAV object without being fully set up. Same again for TesterCalDAV for symmetry, though it didn't have the same problem.
f17d38d
to
fc17180
Compare
Oh those are great test ideas, thanks. I've put them into #160 and I'll tackle them as a separate PR. This one can be merged whenever we're about to merge cyrusimap/cyrus-imapd#3564 |
This is for cyrusimap/cyrus-imapd#3564
We have a small handful of very basic tests for murder setups (Murder.pm), but the way we set things up in Cassandane meant these could only use IMAP.
This PR adjusts the infrastructure so that a test can either require an IMAP murder or a JMAP murder (but not both!), modifies the existing Murder.pm tests to use the new infrastructure, and adds a couple of basic JMAP tests too.
We can and should add more tests to this, but so far this proves that the basic premise -- connecting to the frontend, making a JMAP request, and the request being proxied to the backend containing the user's account -- seems to work.
There's probably more to do with the infrastructure yet, but I won't be sure what it needs to look like until we write and debug more tests.