[autotest] Add a new field no_delay in task config for suite scheduler

This is to allow suite scheduler to create suites without delay_minutes.
This should only be used for task that create small set of suites.

BUG=b:31860543
TEST=unittest, local run
/usr/local/autotest/site_utils/suite_scheduler/suite_scheduler.py \
      -d /usr/local/autotest/logs -f /usr/local/autotest/dshi/test_ss.ini  \
      -e nightly  -i git_mnc-release/shamu-userdebug/2457013 \
      -r /tmp/_autotmp_0pjXWQ_suite_scheduler -o android

Change-Id: Id12e109dd1ac8fc2e562a1b37d9ff4d860f6fe38
Reviewed-on: https://chromium-review.googlesource.com/403481
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Simran Basi <sbasi@chromium.org>
diff --git a/site_utils/suite_scheduler/task.py b/site_utils/suite_scheduler/task.py
index 349adb3..29c03ec 100644
--- a/site_utils/suite_scheduler/task.py
+++ b/site_utils/suite_scheduler/task.py
@@ -184,7 +184,7 @@
                        'boards', 'file_bugs', 'cros_build_spec',
                        'firmware_rw_build_spec', 'firmware_ro_build_spec',
                        'test_source', 'job_retry', 'hour', 'day', 'branches',
-                       'targets', 'os_type'])
+                       'targets', 'os_type', 'no_delay'])
         # The parameter of union() is the keys under the section in the config
         # The union merges this with the allowed set, so if any optional keys
         # are omitted, then they're filled in. If any extra keys are present,
@@ -209,6 +209,7 @@
                 section, 'firmware_ro_build_spec')
         test_source = config.getstring(section, 'test_source')
         job_retry = config.getboolean(section, 'job_retry')
+        no_delay = config.getboolean(section, 'no_delay')
         for klass in driver.Driver.EVENT_CLASSES:
             if klass.KEYWORD == keyword:
                 priority = klass.PRIORITY
@@ -306,7 +307,8 @@
                              hour=hour, day=day, os_type=os_type,
                              launch_control_branches=lc_branches,
                              launch_control_targets=lc_targets,
-                             testbed_dut_count=testbed_dut_count)
+                             testbed_dut_count=testbed_dut_count,
+                             no_delay=no_delay)
 
 
     @staticmethod
@@ -342,7 +344,7 @@
                  firmware_ro_build_spec=None, test_source=None, job_retry=False,
                  hour=None, day=None, os_type=OS_TYPE_CROS,
                  launch_control_branches=None, launch_control_targets=None,
-                 testbed_dut_count=None):
+                 testbed_dut_count=None, no_delay=False):
         """Constructor
 
         Given an iterable in |branch_specs|, pre-vetted using CheckBranchSpecs,
@@ -431,6 +433,8 @@
                 for Launch Control builds. The argument is required and only
                 applicable for android/brillo builds.
         @param testbed_dut_count: Number of duts to test when using a testbed.
+        @param no_delay: Set to True to allow suite to be created without
+                configuring delay_minutes. Default is False.
         """
         self._name = name
         self._suite = suite
@@ -455,6 +459,7 @@
                 [t.strip() for t in launch_control_targets.split(',')]
                 if launch_control_targets else [])
         self._testbed_dut_count = testbed_dut_count
+        self._no_delay = no_delay
 
         if ((self._firmware_rw_build_spec or self._firmware_ro_build_spec or
              cros_build_spec) and
@@ -892,7 +897,8 @@
                 job_retry=self._job_retry,
                 launch_control_build=launch_control_build,
                 run_prod_code=run_prod_code,
-                testbed_dut_count=self._testbed_dut_count):
+                testbed_dut_count=self._testbed_dut_count,
+                no_delay=self._no_delay):
             logging.info('Skipping scheduling %s on %s for %s',
                          self._suite, build_string, board)