3

Has anyone done tests on production (or on staging) as opposed to local tests on the dev server? is it a bad idea to try?

At first glance, App Engine and unit tests aren't a great fit. App Engine requests can only be driven by http or xmpp. Unit tests are typically initiated via command-line or IDE. App Engine requests are limited to 30 seconds. A unit test suite may contain thousands of tests that take far longer than 30 seconds to execute. How do we bridge the gap?

is there a python equivalent to cloud cover?

I would love my app to have a webpage of checkbox's which allows me to select which tests to run and displays recent results for each test. (preferably without me writing my own version of unittest / unittest2

While some of my tests may be local only, I think I may need to run some of these tests on production also. I may also have additional "live only tests".

I guess my concern is how to run the local tests on live without having to maintain two separate sets of tests. And also how to run some tests on live without messing up the live data in the datastore. (yes some tests may use stubs or mocks but I might wanna check the production datastore or a staged version of it?)

I haven't tried running a unit test on live, I assume via stdout unittest would log results to the administration console which probably wouldn't be as useful as having the results show up on a webpage that is used for running the tests.

I would also want to set up staging before production by changing the version number in app.yaml (combined with Namespaces, Versions and Multitenancy.. ). I could run tests on staging also.

Anyone got a basic approach I should try?

Community
  • 1
  • 1
Rusty Rob
  • 16,489
  • 8
  • 100
  • 116

2 Answers2

2

Check out aeta. It runs tests in the task queue, and you can access these tests from the web interface or the command line.

For testing the live datastore without messing up your data, you could try using a staging or testing server.

1

Have you tried the remote_api console? It will allow you to run unit tests inside your local directory straight onto the live appengine runtime.

Hans Then
  • 10,935
  • 3
  • 32
  • 51
  • thanks - that would be a start but luckily they have recently open sourced aeta which is more what i'm after. – Rusty Rob Sep 25 '12 at 08:26