[calendar] caldav server for integration testing

RESOLVED FIXED in 1.3 C1/1.4 S1(20dec)

Status

Firefox OS
Gaia::Calendar
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: gaye, Assigned: evanxd)

Tracking

unspecified
1.3 C1/1.4 S1(20dec)
x86_64
Linux
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ucid:Productivity11, 1.4:p1, ft:productivity][p=5])

Attachments

(1 attachment, 1 obsolete attachment)

52 bytes, text/x-github-pull-request
gaye
: review+
lightsofapollo
: feedback+
kgrandon
: feedback+
Details
(Reporter)

Description

5 years ago
We have some awesome calendar features in the pipeline! Lucky for us, we also have amazing unit test coverage in calendar. It would make me feel a lot more confident that we won't have major regressions if we had great integration test coverage too! Right now, we have essentially none and a big blocking item is being able to point our tests toward a local caldav server.

We can...

(1) use an existing caldav server http://caldav.calconnect.org/implementations/servers.html
(2) use an existing fake dav server like https://github.com/mikedeboer/jsDAV 
(3) build a new fake caldav server
(Reporter)

Updated

5 years ago
Assignee: nobody → evanxd
(Reporter)

Comment 1

5 years ago
It seems like, for the immediate term, using a well-supported caldav server like http://trac.calendarserver.org/ that we could point the calendar app to is a good option. As far as the acceptance criteria go, I would like:

- code that lives in the Makefile or ./bin/gaia-marionette to download and build the server
- a marionette test that does something like...

1. start the caldav server
2. put a fake account on the caldav server
3. add an event to the fake calendar account
4. set up a calendar account pointing to the caldav server
5. assert that the created event is downloaded and displayed properly
6. purge the data from the caldav server
7. take down the caldav server

Does this sound good to you evanxd?
Flags: needinfo?(evanxd)
(Assignee)

Comment 2

5 years ago
Hi gaye,

Got it.
But building the caldav server might take up to 10 minutes.

Will we build that for each time we run the tests,
or we could just download the binary execution file of the caldav server for running the tests?
Flags: needinfo?(evanxd)
(Assignee)

Updated

5 years ago
Flags: needinfo?(gaye)
(Reporter)

Comment 3

5 years ago
That could work, but then we need to worry about making sure that we have an appropriate binary for every platform. This is okay, but it's more headache. We have devs on different versions of osx and linux. I know the buildbot/tbpl machines use ubuntu 12.04 and there are both 32 bit and 64 bit test runs. Honestly it would be better if we could build a fresh caldav server whenever we don't already have one.

Do you know if there's anything we could do to speed up the build process? Perhaps we could give the build more memory or maybe there are steps we can parallelize? What do you think?
Flags: needinfo?(gaye) → needinfo?(evanxd)
(Assignee)

Comment 4

5 years ago
Hi gaye,

Yes, you're right. Dealing with different platforms is not easy. But to speed up the build process is not easy also. I think it just takes those time.

So why do we just use some kind of CalDAV server worked well and wrote in a interpreted language?

For example, there is a open source CalDAV server project called Radicale(http://radicale.org/). It is wrote in pure Python, and does not depend on any library. It could run in Linux and MacOS, even Windows. And it works well with these CalDAV clients http://radicale.org/user_documentation/#idcaldav-and-carddav-clients.

It seems resolve the issues we discussed in above. So we might use it in our testing jobs. How do you think?
Flags: needinfo?(evanxd)
(Assignee)

Updated

5 years ago
Flags: needinfo?(gaye)
(Reporter)

Comment 5

5 years ago
That sounds great Evan. Why don't you try it out?
Flags: needinfo?(gaye)
(Reporter)

Comment 6

5 years ago
I looked around a little bit more. Radicale looks very nice and small and has very few dependencies. It'd be great if we could get this to work :)
(Assignee)

Comment 7

5 years ago
Hi gaye,

Cool! Let's try to do the work with Radicale.
Kevin mentioned wanting to use a fake server for contacts... Not 100% sure what kind of server you want but carddav is much like caldav.
(Assignee)

Comment 9

5 years ago
Hi James,

I think we just would like a CalDAV server for doing complete tests for Calendar App.
Did you mean that Contacts and Calendar App could use the fake server for testing?
I thought the caldav and cardav are two kinds of protocol, right?
(Assignee)

Comment 10

5 years ago
Created attachment 830212 [details]
Pull request

Hi Gareth,

Please help me to review the patch.
Thanks.
Attachment #830212 - Flags: review?(gaye)
(Assignee)

Updated

5 years ago
Attachment #830212 - Flags: review?(gaye)
(Assignee)

Comment 11

5 years ago
Created attachment 830214 [details]
Pull request

Hi Gareth,

Please help me review the patch.
Thanks.
Attachment #830212 - Attachment is obsolete: true
Attachment #830214 - Flags: review?(gaye)
(Assignee)

Comment 12

5 years ago
Hi Gareth,

In the patch, we add a the CalDAV helper in the Calendar App folder.
But if we do this, it could only be used for tests in Calendar App.

I think the other Apps might use the serve in some conditions.
So could we make the helper as a marionette plugin?

How do you think?
(Assignee)

Comment 13

5 years ago
Or maybe we could do this in future. 
We could review the patch and land it first.
(Reporter)

Updated

5 years ago
Attachment #830214 - Flags: superreview?
Attachment #830214 - Flags: feedback?(kgrandon)
Attachment #830214 - Flags: feedback?(jlal)
(Assignee)

Comment 14

5 years ago
Comment on attachment 830214 [details]
Pull request

<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/gaia/pull/13578/files">
<title>Bugzilla Code Review</title>
<p>You can review this patch at <a href="https://github.com/mozilla-b2g/gaia/pull/13578/files">https://github.com/mozilla-b2g/gaia/pull/13578/files</a>, or wait 5 seconds to be redirected there automatically.</p>
(Assignee)

Comment 15

5 years ago
Comment on attachment 830214 [details]
Pull request

<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/gaia/pull/13578/files
">
<title>Bugzilla Code Review</title>
<p>You can review this patch at <a href="https://github.com/mozilla-b2g/gaia/pull/13578/files
">https://github.com/mozilla-b2g/gaia/pull/13578/files
</a>, or wait 5 seconds to be redirected there automatically.</p>
(Assignee)

Comment 16

5 years ago
Comment on attachment 830214 [details]
Pull request

<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="5;https://github.com/mozilla-b2g/gaia/pull/13578/files">
<title>Bugzilla Code Review</title>
<p>You can review this patch at <a href="https://github.com/mozilla-b2g/gaia/pull/13578/files">https://github.com/mozilla-b2g/gaia/pull/13578/files</a>, or wait 5 seconds to be redirected there automatically.</p>
Attachment #830214 - Attachment is patch: false
Attachment #830214 - Attachment mime type: text/plain → text/html
Comment on attachment 830214 [details]
Pull request

Left a nit on github and Gareth is doing a great job with reviews. Thanks for the work on this!
Attachment #830214 - Flags: feedback?(kgrandon) → feedback+
Comment on attachment 830214 [details]
Pull request

Big++ I did not run the code but the interfaces look good to me. The one thing which I was not super clear on... Can we create multiple accounts AND calendars for those accounts?
Attachment #830214 - Flags: feedback?(jlal) → feedback+
(Assignee)

Comment 19

5 years ago
Hi Gareth,

I updated the patch for your comments.
Please help me review the patch.

Thanks. :)
Flags: needinfo?
(Assignee)

Updated

5 years ago
Flags: needinfo?
(Assignee)

Comment 20

5 years ago
Hi Gareth,

I updated the patch for your comments.
And we need to discuss the factory things in https://github.com/mozilla-b2g/gaia/pull/13578/files#r7877944.

Thanks for the review.
(Assignee)

Updated

5 years ago
Flags: needinfo?(gaye)
(Assignee)

Comment 21

5 years ago
Hi Gareth,

Is the patch OK for r+, or anything we need to change?
(Assignee)

Comment 22

5 years ago
Hope we could land it before the Xmas vacation. :P
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
(Assignee)

Updated

5 years ago
Attachment #830214 - Attachment mime type: text/html → text/x-github-pull-request
(Assignee)

Comment 23

5 years ago
Hi Garth,

I already updated the code for the comments.
Please help review the patch.
Thanks. :)
(Reporter)

Updated

5 years ago
Flags: needinfo?(gaye)
Whiteboard: [ucid:Productivity11, 1.4:p1, ft:productivity][p=5]
(Assignee)

Comment 24

4 years ago
Hi Gareth,

The Travis is good for the patch.
Finally, we could r+ and land it now.

Please help me to set r+ for it.
Thanks.:)
Flags: needinfo?(gaye)
(Reporter)

Comment 25

4 years ago
Evan -

I ran the build 24 times on CI and I already see that it's failed twice. We need to make sure it passes 100% of the time https://travis-ci.org/mozilla-b2g/gaia/builds/16723565. Please look into this!
Flags: needinfo?(gaye)
(Assignee)

Comment 26

4 years ago
Hi Gareth,

Yes, let it pass at 100% of the time.
And we need to find a way to try to make sure the thing will be happened.

Let us run the patch at 30 times with no failure in Travis.
Then we could believe that it will pass at 100% of the time.

I'm just thinking that how do developers make sure their tests pass at 100% of time.
Running many times(like 30) without any failure is a good way for that, or?
Does gaye have good idea?

I think we could do the 30 times without failure first to make sure that.
Thanks.
(Reporter)

Comment 27

4 years ago
That sounds good to me, Evan. Have you gotten a chance to debug those intermittent failures?
(Assignee)

Comment 28

4 years ago
Yes, I am working on this.
Comment on attachment 830214 [details]
Pull request

I added some notes to the Pull Request as well. I think this is a **very nice** solution to the problem and way easier than writing a fake client ourselves. It will simplify the test process a lot and should give a good level of confidence.
(Assignee)

Comment 30

4 years ago
Hi Miller,

Thanks for the comments.
I already updated for that.
(Assignee)

Comment 31

4 years ago
Hi Gareth,

The patch is stable enough now.
The test could be passed at least 30 times.
You could see that in https://travis-ci.org/mozilla-b2g/gaia/builds/17818904.

If everything is good, we could r+ and land the patch.
Thanks.

Evan
Flags: needinfo?(gaye)
(Assignee)

Comment 32

4 years ago
And Happy Chinese New Year! :D
(Reporter)

Comment 33

4 years ago
Comment on attachment 830214 [details]
Pull request

We're really close! I'm sorry that I have another round pf feedback, but these items should be really small. Flag me again once you've addressed and we will merge!
Attachment #830214 - Flags: superreview?
Attachment #830214 - Flags: review?(gaye)
Flags: needinfo?(gaye)
(Reporter)

Comment 34

4 years ago
Happy new year to you too Evan! It was great to see you in Taipei :)
(Reporter)

Comment 35

4 years ago
Comment on attachment 830214 [details]
Pull request

Nice job Evan! I think this is ready to land! Thanks for sticking with it :)
Attachment #830214 - Flags: review+
(Assignee)

Comment 36

4 years ago
Hi Gareth,

Thanks for your patience.
(Assignee)

Comment 37

4 years ago
Learned a lot. :)
(Assignee)

Comment 38

4 years ago
master: https://github.com/mozilla-b2g/gaia/commit/8b5ca320593ee14ec3cc1aff3ac25ff10683b8d3
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
Depends on: 973876
... virtualenv doesn't work on my machine since I upgrade to 10.9, so I can't run integration test anymore.
You need to log in before you can comment on or make changes to this bug.