testing/trigger_scripts/base_test_triggerer.py
def trigger_tasks(self, args, remaining):
        """Triggers tasks for each bot.

        Args:
            args: Parsed arguments which we need to use.
            remaining: The remainder of the arguments, which should be passed to
              swarming.py calls.

        Returns:
            Exit code for the script.
        """
        if args.multiple_dimension_script_verbose:
            logging.basicConfig(level=logging.DEBUG)

        # crbug/1140389: debug print outs
        logging.info('DEBUG: init: %s', remaining)

        self.parse_bot_configs(args)
        # Prunes config list to the exact set of configurations to trigger jobs
        # on. This logic is specific to the base class if they want to prune
        # list further.
        self.prune_test_specific_configs(args)

        # In the remaining arguments, find the Swarming dimensions that are
        # specified by the bot configs and remove them, because for each shard,
        # we're going to select one of the bot configs and put all of its
        # Swarming dimensions on the command line.
        filtered_remaining_args = copy.deepcopy(remaining)
        for config in self._bot_configs:
            for k in config.keys():
                filtered_remaining_args = self.remove_swarming_dimension(
                    filtered_remaining_args, k)
        # crbug/1140389: debug print outs
        logging.info('DEBUG: After filtered: %s', filtered_remaining_args)

        merged_json = {}
        selected_config = self.select_config_indices(args)
        shard_map = self.generate_shard_map(
            args, self._findBuilderName(filtered_remaining_args),
            selected_config)
        # Choose selected configs for this run of the test suite.
        for shard_index, bot_index in selected_config:
            # For each shard that we're going to distribute, do the following:
            # 1. Pick which bot configuration to use.
            # 2. Insert that bot configuration's dimensions as command line
            #    arguments, and invoke "swarming.py trigger".
            # Holds the results of the swarming.py trigger call.
            try:
                json_temp = self.make_temp_file(
                    prefix='base_trigger_dimensions', suffix='.json')
                # crbug/1140389: debug print outs
                logging.info('DEBUG: Before modify args: %s',
                             filtered_remaining_args)
                args_to_pass = self.modify_args(filtered_remaining_args,
                                                bot_index, shard_index,
                                                args.shards, json_temp,
                                                shard_map)
                # crbug/1140389: debug print outs
                logging.info('DEBUG: Before calling swarming: %s',
                             args_to_pass)
                ret = self.run_swarming_go(args_to_pass, json_temp,
                                           shard_index, args.shards,
                                           merged_json)
                if ret:
                    sys.stderr.write('Failed to trigger a task, aborting\n')
                    return ret
            finally:
                self.delete_temp_file(json_temp)
        self.write_json_to_file(merged_json, args.dump_json)
        return 0
Triggers tasks for each bot.

        Args:
            args: Parsed arguments which we need to use.
            remaining: The remainder of the arguments, which should be passed to
              swarming.py calls.

        Returns:
            Exit code for the script.
        
Triggers tasks for each bot.
Triggers tasks for each bot .
def trigger_tasks(self, args, remaining):
        if args.multiple_dimension_script_verbose:
            logging.basicConfig(level=logging.DEBUG)
        logging.info('DEBUG: init: %s', remaining)
        self.parse_bot_configs(args)
        self.prune_test_specific_configs(args)
        filtered_remaining_args = copy.deepcopy(remaining)
        for config in self._bot_configs:
            for k in config.keys():
                filtered_remaining_args = self.remove_swarming_dimension(
                    filtered_remaining_args, k)
        logging.info('DEBUG: After filtered: %s', filtered_remaining_args)
        merged_json = {}
        selected_config = self.select_config_indices(args)
        shard_map = self.generate_shard_map(
            args, self._findBuilderName(filtered_remaining_args),
            selected_config)
        for shard_index, bot_index in selected_config:
            try:
                json_temp = self.make_temp_file(
                    prefix='base_trigger_dimensions', suffix='.json')
                logging.info('DEBUG: Before modify args: %s',
                             filtered_remaining_args)
                args_to_pass = self.modify_args(filtered_remaining_args,
                                                bot_index, shard_index,
                                                args.shards, json_temp,
                                                shard_map)
                logging.info('DEBUG: Before calling swarming: %s',
                             args_to_pass)
                ret = self.run_swarming_go(args_to_pass, json_temp,
                                           shard_index, args.shards,
                                           merged_json)
                if ret:
                    sys.stderr.write('Failed to trigger a task, aborting\n')
                    return ret
            finally:
                self.delete_temp_file(json_temp)
        self.write_json_to_file(merged_json, args.dump_json)
        return 0
def trigger_tasks ( self , args , remaining ) : if args . multiple_dimension_script_verbose : logging . basicConfig ( level = logging . DEBUG ) logging . info ( 'DEBUG: init: %s' , remaining ) self . parse_bot_configs ( args ) self . prune_test_specific_configs ( args ) filtered_remaining_args = copy . deepcopy ( remaining ) for config in self . _bot_configs : for k in config . keys ( ) : filtered_remaining_args = self . remove_swarming_dimension ( filtered_remaining_args , k ) logging . info ( 'DEBUG: After filtered: %s' , filtered_remaining_args ) merged_json = { } selected_config = self . select_config_indices ( args ) shard_map = self . generate_shard_map ( args , self . _findBuilderName ( filtered_remaining_args ) , selected_config ) for shard_index , bot_index in selected_config : try : json_temp = self . make_temp_file ( prefix = 'base_trigger_dimensions' , suffix = '.json' ) logging . info ( 'DEBUG: Before modify args: %s' , filtered_remaining_args ) args_to_pass = self . modify_args ( filtered_remaining_args , bot_index , shard_index , args . shards , json_temp , shard_map ) logging . info ( 'DEBUG: Before calling swarming: %s' , args_to_pass ) ret = self . run_swarming_go ( args_to_pass , json_temp , shard_index , args . shards , merged_json ) if ret : sys . stderr . write ( 'Failed to trigger a task, aborting\n' ) return ret finally : self . delete_temp_file ( json_temp ) self . write_json_to_file ( merged_json , args . dump_json ) return 0
Triggers tasks for each bot.
Triggers tasks for each bot .
"""Triggers tasks for each bot.

        Args:
            args: Parsed arguments which we need to use.
            remaining: The remainder of the arguments, which should be passed to
              swarming.py calls.

        Returns:
            Exit code for the script.
        """ # crbug/1140389: debug print outs # Prunes config list to the exact set of configurations to trigger jobs # on. This logic is specific to the base class if they want to prune # list further. # In the remaining arguments, find the Swarming dimensions that are # specified by the bot configs and remove them, because for each shard, # we're going to select one of the bot configs and put all of its # Swarming dimensions on the command line. # crbug/1140389: debug print outs # Choose selected configs for this run of the test suite. # For each shard that we're going to distribute, do the following: # 1. Pick which bot configuration to use. # 2. Insert that bot configuration's dimensions as command line #    arguments, and invoke "swarming.py trigger". # Holds the results of the swarming.py trigger call. # crbug/1140389: debug print outs # crbug/1140389: debug print outs
Exit code for the script.
Exit code for the script .
self
args
Parsed arguments which we need to use.
Parsed arguments which we need to use .
remaining
The remainder of the arguments, which should be passed to
swarming.py calls.
The remainder of the arguments which should be passed to swarming . py calls .