Closed Bug 932605 Opened 11 years ago Closed 10 years ago

[calendar] caldav server for integration testing

Categories

(Firefox OS Graveyard :: Gaia::Calendar, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 C1/1.4 S1(20dec)

People

(Reporter: gaye, Assigned: evanxd)

References

Details

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

Attachments

(1 file, 1 obsolete file)

52 bytes, text/x-github-pull-request
gaye
: review+
jlal
: feedback+
kgrandon
: feedback+
Details
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
Assignee: nobody → evanxd
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)
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)
Flags: needinfo?(gaye)
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)
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)
Flags: needinfo?(gaye)
That sounds great Evan. Why don't you try it out?
Flags: needinfo?(gaye)
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 :)
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.
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?
Attached file Pull request (obsolete) —
Hi Gareth,

Please help me to review the patch.
Thanks.
Attachment #830212 - Flags: review?(gaye)
Attachment #830212 - Flags: review?(gaye)
Attached file Pull request
Hi Gareth,

Please help me review the patch.
Thanks.
Attachment #830212 - Attachment is obsolete: true
Attachment #830214 - Flags: review?(gaye)
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?
Or maybe we could do this in future. 
We could review the patch and land it first.
Attachment #830214 - Flags: superreview?
Attachment #830214 - Flags: feedback?(kgrandon)
Attachment #830214 - Flags: feedback?(jlal)
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>
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>
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+
Hi Gareth,

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

Thanks. :)
Flags: needinfo?
Flags: needinfo?
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.
Flags: needinfo?(gaye)
Hi Gareth,

Is the patch OK for r+, or anything we need to change?
Hope we could land it before the Xmas vacation. :P
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
Attachment #830214 - Attachment mime type: text/html → text/x-github-pull-request
Hi Garth,

I already updated the code for the comments.
Please help review the patch.
Thanks. :)
Flags: needinfo?(gaye)
Whiteboard: [ucid:Productivity11, 1.4:p1, ft:productivity][p=5]
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)
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)
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.
That sounds good to me, Evan. Have you gotten a chance to debug those intermittent failures?
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.
Hi Miller,

Thanks for the comments.
I already updated for that.
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)
And Happy Chinese New Year! :D
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)
Happy new year to you too Evan! It was great to see you in Taipei :)
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+
Hi Gareth,

Thanks for your patience.
Learned a lot. :)
master: https://github.com/mozilla-b2g/gaia/commit/8b5ca320593ee14ec3cc1aff3ac25ff10683b8d3
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: