testing/trigger_scripts/base_test_triggerer.py
def modify_args(self,
                    all_args,
                    bot_index,
                    shard_index,
                    total_shards,
                    temp_file,
                    shard_map=None):
        """Modifies the given argument list.

    Specifically, it does the following:
      * Adds a --dump_json argument, to read in the results of the
        individual trigger command.
      * Adds the dimensions associated with the bot config at the given index.
      * If the number of shards is greater than one, adds --env
        arguments to set the GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS
        environment variables to _shard_index_ and _total_shards_,
        respectively.

    The arguments are structured like this:
    <args to swarming trigger> -- <args to bot running isolate>
    This means we have to add arguments to specific locations in the argument
    list, to either affect the trigger command, or what the bot runs.

    """
        bot_args = ['--dump-json', temp_file]
        if total_shards > 1:
            bot_args.append('--env')
            bot_args.append('GTEST_SHARD_INDEX=%s' % shard_index)
            bot_args.append('--env')
            bot_args.append('GTEST_TOTAL_SHARDS=%s' % total_shards)
        if self._bot_configs:
            for key, val in sorted(self._bot_configs[bot_index].items()):
                bot_args.append('--dimension')
                bot_args.append(key)
                bot_args.append(val)
        if '--' in all_args:
            dash_ind = all_args.index('--')
            additional_args = all_args[:dash_ind] + bot_args + all_args[
                dash_ind:]
        else:
            additional_args = all_args + bot_args
        additional_args = self.append_additional_args(additional_args,
                                                      shard_index)
        # crbug/1140389: debug print outs
        logging.info('DEBUG: Before adding shardmap args: %s', additional_args)
        if shard_map:
            shard_map_str = json.dumps(shard_map, separators=(',', ':'))
            shard_map_args = ['--use-dynamic-shards']
            shard_map_args.append('--dynamic-shardmap=%s' % shard_map_str)
            additional_args += shard_map_args
        return additional_args
Modifies the given argument list.

    Specifically, it does the following:
      * Adds a --dump_json argument, to read in the results of the
        individual trigger command.
      * Adds the dimensions associated with the bot config at the given index.
      * If the number of shards is greater than one, adds --env
        arguments to set the GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS
        environment variables to _shard_index_ and _total_shards_,
        respectively.

    The arguments are structured like this:
    <args to swarming trigger> -- <args to bot running isolate>
    This means we have to add arguments to specific locations in the argument
    list, to either affect the trigger command, or what the bot runs.

    
Modifies the given argument list.
Specifically, it does the following:
Adds a --dump_json argument, to read in the results of the
individual trigger command.
Adds the dimensions associated with the bot config at the given index.
If the number of shards is greater than one, adds --env
arguments to set the GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS
environment variables to _shard_index_ and _total_shards_,
respectively.

The arguments are structured like this:
 -- 
This means we have to add arguments to specific locations in the argument
list, to either affect the trigger command, or what the bot runs.
Modifies the given argument list . Specifically it does the following : Adds a -- dump_json argument to read in the results of the individual trigger command . Adds the dimensions associated with the bot config at the given index . If the number of shards is greater than one adds -- env arguments to set the GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS environment variables to _shard_index_ and _total_shards_ respectively . The arguments are structured like this : -- This means we have to add arguments to specific locations in the argument list to either affect the trigger command or what the bot runs .
def modify_args(self,
                    all_args,
                    bot_index,
                    shard_index,
                    total_shards,
                    temp_file,
                    shard_map=None):
        bot_args = ['--dump-json', temp_file]
        if total_shards > 1:
            bot_args.append('--env')
            bot_args.append('GTEST_SHARD_INDEX=%s' % shard_index)
            bot_args.append('--env')
            bot_args.append('GTEST_TOTAL_SHARDS=%s' % total_shards)
        if self._bot_configs:
            for key, val in sorted(self._bot_configs[bot_index].items()):
                bot_args.append('--dimension')
                bot_args.append(key)
                bot_args.append(val)
        if '--' in all_args:
            dash_ind = all_args.index('--')
            additional_args = all_args[:dash_ind] + bot_args + all_args[
                dash_ind:]
        else:
            additional_args = all_args + bot_args
        additional_args = self.append_additional_args(additional_args,
                                                      shard_index)
        logging.info('DEBUG: Before adding shardmap args: %s', additional_args)
        if shard_map:
            shard_map_str = json.dumps(shard_map, separators=(',', ':'))
            shard_map_args = ['--use-dynamic-shards']
            shard_map_args.append('--dynamic-shardmap=%s' % shard_map_str)
            additional_args += shard_map_args
        return additional_args
def modify_args ( self , all_args , bot_index , shard_index , total_shards , temp_file , shard_map = None ) : bot_args = [ '--dump-json' , temp_file ] if total_shards > 1 : bot_args . append ( '--env' ) bot_args . append ( 'GTEST_SHARD_INDEX=%s' % shard_index ) bot_args . append ( '--env' ) bot_args . append ( 'GTEST_TOTAL_SHARDS=%s' % total_shards ) if self . _bot_configs : for key , val in sorted ( self . _bot_configs [ bot_index ] . items ( ) ) : bot_args . append ( '--dimension' ) bot_args . append ( key ) bot_args . append ( val ) if '--' in all_args : dash_ind = all_args . index ( '--' ) additional_args = all_args [ : dash_ind ] + bot_args + all_args [ dash_ind : ] else : additional_args = all_args + bot_args additional_args = self . append_additional_args ( additional_args , shard_index ) logging . info ( 'DEBUG: Before adding shardmap args: %s' , additional_args ) if shard_map : shard_map_str = json . dumps ( shard_map , separators = ( ',' , ':' ) ) shard_map_args = [ '--use-dynamic-shards' ] shard_map_args . append ( '--dynamic-shardmap=%s' % shard_map_str ) additional_args += shard_map_args return additional_args
Modifies the given argument list.
Modifies the given argument list .
"""Modifies the given argument list.

    Specifically, it does the following:
      * Adds a --dump_json argument, to read in the results of the
        individual trigger command.
      * Adds the dimensions associated with the bot config at the given index.
      * If the number of shards is greater than one, adds --env
        arguments to set the GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS
        environment variables to _shard_index_ and _total_shards_,
        respectively.

    The arguments are structured like this:
    <args to swarming trigger> -- <args to bot running isolate>
    This means we have to add arguments to specific locations in the argument
    list, to either affect the trigger command, or what the bot runs.

    """ # crbug/1140389: debug print outs
self
all_args
bot_index
shard_index
total_shards
temp_file
shard_map