Clone this repo:
  1. 2482bda suite_scheduler.ini: Spread out load from Cts/Gts*Nightly suites by Prathmesh Prabhu · 6 days ago master
  2. 781b34e Merge "[suite_scheduler] Update lab_config.ini to include new models." by Dinesh Kumar Sunkara · 8 days ago
  3. 6e190b4 suite-scheduler: fix unittest. by Xixuan Wu · 9 days ago
  4. 0e26baf suite_scheduler: update boards for bluetooth chameleond suites. by Shijin Abraham · 13 days ago
  5. bbd9fe4 [suite_scheduler] Update lab_config.ini to include new models. by Dinesh Kumar Sunkara · 2 weeks ago

Setup

Due to https://crbug.com/792690, this must be run outside the chroot.

  1. Install Google Cloud SDK:

    1. Follow the instructions.

    2. Install the Python App Engine component:

       sudo apt-get install google-cloud-sdk-app-engine-python
      
  2. Log in to gcloud: gcloud auth login LDAP@google.com

  3. Install pip:

     sudo apt-get install python-pip
    
  4. Run python setup_environment.py to download third-party libraries and credentials.

Known Issues

  1. Failed to install third-packages in requirement.txt:

    Workround: Run pip install -t lib -r requirements.txt locally on your workstation to verify whether it could work.

  2. Failed to download credentials from ‘gs://suite-scheduler.google.com.a.appspot.com/credentials/’:

    Workround: Run gsutil ls gs://suite-scheduler.google.com.a.appspot.com/credentials/ locally on your workstation to verify whether you can fetch credentials with gsutil.

    If there's any auth issue, it may be because

    a. You‘re not using your corp account to login gcloud. Please run gcloud auth list to check what’s the used account for gcloud.

    b. Your corp account is not whitelisted by suite-scheduler project. Please contact @xixuan to whitelist your ldap.

How to test:

  1. Presubmit will kick off sanity test for verifying suite_scheduler.ini:

     python runner.py --test_type sanity
    
  2. Run unittest:

     python runner.py' or 'python runner.py --test_type unittest
    
  3. Run integration test:

     python runner.py --test_type integration
    
  4. Run tests with debug mode:

     python runner.py --debug
    
  5. Run suite scheduler v2 as a local development server:

    If you want to verify any APIs locally, you can run suite scheduler v2 as a local development server (https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server):

    a. Finally, start dev_appserver.py in a window:

       dev_appserver.py app.yaml \
           --port=8888 \
           --admin_port=8001 \
           --log_level=debug
    

    b. Test it:

       curl 'http://localhost:8888/cron/trigger_event', or open it in chrome.
    

    Please note that once a dev_appserver is started, it simulates data_store & task_queue, which means:

    a. The datastore doesn‘t contain any previous cron run’s information, so the first round of cron/trigger_event won't trigger any event.

    b. The task queue is newly created with 0 tasks in it unless cron/trigger_event adds tasks in it. Dev_appserver restart will cause the local task queue to get purged.