Example #1
0
 def _AbortPreviousHWTestSuites(self):
     """Abort any outstanding synchronous hwtest suites from this builder."""
     # Only try to clean up previous HWTests if this is really running on one of
     # our builders in a non-trybot build.
     debug = (self._run.options.remote_trybot
              or (not self._run.options.buildbot)
              or self._run.options.debug)
     build_identifier, _ = self._run.GetCIDBHandle()
     buildbucket_id = build_identifier.buildbucket_id
     if self.buildstore.AreClientsReady():
         builds = self.buildstore.GetBuildHistory(
             self._run.config.name,
             2,
             branch=self._run.options.branch,
             ignore_build_id=buildbucket_id)
         for build in builds:
             old_version = build['full_version']
             if old_version is None:
                 continue
             if build['status'] == constants.BUILDER_STATUS_PASSED:
                 continue
             for suite_config in self._run.config.hw_tests:
                 # Python 3.7+ made async a reserved keyword.
                 if not getattr(suite_config, 'async'):
                     if self._run.config.enable_skylab_hw_tests:
                         commands.AbortSkylabHWTests(
                             build='%s/%s' %
                             (self._run.config.name, old_version),
                             board=self._run.config.boards[0],
                             debug=False,  # For tryjob
                             suite=suite_config.suite)
                     else:
                         commands.AbortHWTests(self._run.config.name,
                                               old_version, debug,
                                               suite_config.suite)
Example #2
0
 def _AbortPreviousHWTestSuites(self):
   """Abort any outstanding synchronous hwtest suites from this builder."""
   # Only try to clean up previous HWTests if this is really running on one of
   # our builders in a non-trybot build.
   debug = (self._run.options.remote_trybot or
            (not self._run.options.buildbot) or
            self._run.options.debug)
   build_id, db = self._run.GetCIDBHandle()
   if db:
     builds = db.GetBuildHistory(self._run.config.name, 2,
                                 ignore_build_id=build_id)
     for build in builds:
       old_version = build['full_version']
       if old_version is None:
         continue
       for suite_config in self._run.config.hw_tests:
         if not suite_config.async:
           commands.AbortHWTests(self._run.config.name, old_version,
                                 debug, suite_config.suite)
 def testAbortHWTests(self):
   """Verifies that HWTests are aborted for a specific non-CQ config."""
   topology.FetchTopologyFromCIDB(None)
   commands.AbortHWTests('my_config', 'my_version', debug=False)
   self.assertCommandContains(['-i', 'my_config/my_version'])