'Builds the fully tagged testname and subdirectory for job.run_test.
:param testname: The base name of the test
:param dargs: The ** arguments passed to run_test. And arguments
consumed by this method will be removed from the
dictionary.
:returns: A 3-tuple of the full name of the test, the subdirectory it
should be stored in, and the full tag of the subdir.'

def _build_tagged_test_name(self, testname, dargs):

    tag_parts = []
    master_testpath = dargs.get('master_testpath', '')
    base_tag = dargs.pop('tag', None)
    if base_tag:
        tag_parts.append(str(base_tag))
    if self.use_sequence_number:
        tag_parts.append(('_%02d_' % self._sequence_number))
        self._sequence_number += 1
    if self.automatic_test_tag:
        tag_parts.append(self.automatic_test_tag)
    full_testname = '.'.join(([testname] + tag_parts))
    subdir_tag = dargs.pop('subdir_tag', None)
    if subdir_tag:
        tag_parts.append(subdir_tag)
    subdir = '.'.join(([testname] + tag_parts))
    subdir = os.path.join(master_testpath, subdir)
    tag = '.'.join(tag_parts)
    return (full_testname, subdir, tag)
