- Checkout http://code.google.com/p/google-app-engine-django/ and make the necessary changes to your code base according to http://code.google.com/p/google-app-engine-django/source/browse/trunk/README
- In your project directory run: python manage.py shell
- Explore the APIs and play with your models in the interactive session.
- Record the session as a doctest. See an example in the Rietveld project : http://code.google.com/p/rietveld/source/browse/branches/testing/codereview/tests.py
- Replay the test by: python manage.py test _your_pacakge_
Showing posts with label AppEngine. Show all posts
Showing posts with label AppEngine. Show all posts
Tuesday, 8 July 2008
Google App Engine with Django Unit Testing
To my surprise it is extremely easy to develop unit tests for GAE apps. With the help of GoogleAppEngineDjangoHelper, you can write unit tests around your models and application logic against a fake backend store. So you should be able to test most of your code without involving a browser! Here is an list of steps to develop a doctest for GAE apps.
Saturday, 7 June 2008
Hitting scalability issue in the wild appengine world
Yesterday we hit a scalability issue on Rietveld, DeadlineExceededError keeps showing up on review issues that has a lot of patches. It was caused by an nested loop that access datastore in every iteration. After the panic and patching, I felt pretty good about this "feature" of App Engine. It means most of the time when we hit DeadlineExceededError, there is probably an inefficient algorithm just been checked in. We would have assumed it to be some network delay if app engine didn't kill the request.
Anothe lesson learnt is to use the profiler often. If the datastore access shows up high in the profiling report, we should look at the pending change again for performance bugs, and consider caching.
Anothe lesson learnt is to use the profiler often. If the datastore access shows up high in the profiling report, we should look at the pending change again for performance bugs, and consider caching.
Tuesday, 13 May 2008
More code review
Since my last post, I have been working with Guido on the rietveld project http://code.google.com/p/rietveld/ .
It's been a great experience. I've added some features here and there. Guido has been very prompt in giving review comments. That made the transatlantic collaboration a bit easier. And I've learned a lot from his thorough reviews. I will continue working on this project for as long as I can keep learning something new and build useful stuff. And hopefully encourage more people in the open source community to start doing frequent code reviews along the way.
It's been a great experience. I've added some features here and there. Guido has been very prompt in giving review comments. That made the transatlantic collaboration a bit easier. And I've learned a lot from his thorough reviews. I will continue working on this project for as long as I can keep learning something new and build useful stuff. And hopefully encourage more people in the open source community to start doing frequent code reviews along the way.
Wednesday, 7 May 2008
Open source code review system!
I have just wrote in my blog yesterday that I want to build an open source code review system on Google apps engine. And today I am already reading Guido van Rossum's Rietveld . It is based on the code review system "Mondrian" that's widely used in Google, which is also developed by Guido.
I've just tried it out with a patch I made for WebDriver. Worked pretty well even though the user interface looks still in early stage. I'm going to checkout the code to see more about it now.
I've just tried it out with a patch I made for WebDriver. Worked pretty well even though the user interface looks still in early stage. I'm going to checkout the code to see more about it now.
Subscribe to:
Comments (Atom)