tree: 7b12b717932d23b1dd154417479522ab3c2a1c34 [path history] [tgz]
  1. chromium_bugs/
  2. chromium_committers/
  3. chromium_status/
  4. chromium_status_py3/
  5. cr-buildbucket/
  6. experimental/
  7. findit/
  8. monorail/
  9. predator/
  10. rietveld_staticgen/
  11. third_party/
  12. ui_catalogue/
  13. .eslintrc.json
  14. .gitignore
  16. p2_test_revert_and_reland.txt
  17. package-lock.json
  18. package.json


This directory contains appengine applications, one per subdirectory (the testing framework relies on this assumption to list all tests). To be consistent with appengine principles, each of these directories must contain everything it needs to work. Code shared between several applications should live in appengine_modules/ and be symlinked into each application directory that needs it.

Creating an appengine application


Create a new Appengine app by running <app_name>.

The script will create a minimal structure of a working Appengine app in infra.git:

  • an app directory under appengine/, say appengine/myapp
  • appengine/myapp/app.yaml
  • appengine/myapp/ implements a trivial public endpoint.
  • appengine/myapp/ is a symlink pointing at appengine_modules/ This is required for testing, see below.
  • appengine/myapp/.expect_tests.cfg lists any third-party components that should be skipped by tests.
  • appengine/myapp/components (optional) points at luci/appengine/components/components. Most infra apps require authentication, and components/auth is our standard. Delete this link if your app does not use it, and edit .expect_tests.cfg appropriately.
  • appengine/myapp/ points at luci/appengine/components/tools/ (optional), a handy script for deploying and managing your app.
  • appengine/myapp/test/ (optional, but highly recommended) tests for

Example: the myapp application should live in appengine/myapp. To use appengine_module/testing_utils, create a symlink to it in appengine/myapp/testing_utils. The name should remain the same as Python relies on directory names for its import system.

Note: symbolic links do not work on Managed VMs. A workaround is to create a temporary deployment directory:

rsync -L -r appengine/myapp /tmp/deploy_myapp
pushd /tmp/deploy_myapp/myapp
<deploy your app here>

AppEngine Modules

The default module is configured in app.yaml. Any non-default module must be configured in module-<module_name>.yaml. This is how the script will know you what modules you have.


Tests included in AppEngine applications (classes deriving from unittest.TestCase) are run by Some convenience functions to help using the testbed server are included in appengine_modules/testing_utils. Some examples can be found in existing applications, and a simple test setup is also provided by the script.

See Testing in infra.git for more details. In particular, it's important to have a test file tests/ for every source file

Note: for test code to be able to import modules from the AE SDK (e.g. endpoints), some manipulation of sys.path has to be done by This manipulation has to be performed in an file located at the root of the appengine app, with the content of appengine_module/ Adding a symlink to that file should be enough for 99.99% of cases. (and yes, it's very hacky, we know).

Managing AppEngine apps

A convenience script wrapping called can be used to simplify and normalize the deployment process in infra.git. Just add a symlink to it in your application as It is located in luci/appengine/components/tools/

cd myproject
ln -s ../../../luci/appengine/components/tools/

Run --help to see what can do.