Due to https://crbug.com/792690, this must be run outside the chroot.
Install Google Cloud SDK:
Follow the instructions.
Install the Python App Engine component:
sudo apt-get install google-cloud-sdk-app-engine-python
Log in to gcloud:
gcloud auth login LDAP@google.com
sudo apt-get install python-pip
python setup_environment.py to download third-party libraries and credentials.
pip install -t lib -r requirements.txt locally on your workstation to verify whether it could work.
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.
Presubmit will kick off sanity test for verifying suite_scheduler.ini:
python runner.py --test_type sanity
python runner.py' or 'python runner.py --test_type unittest
Run integration test:
python runner.py --test_type integration
Run tests with debug mode:
python runner.py --debug
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.