Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 from datetime import datetime | 6 from datetime import datetime |
| 7 import logging | 7 import logging |
| 8 import time | 8 import time |
| 9 | 9 |
| 10 from google.appengine.ext import ndb | 10 from google.appengine.ext import ndb |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 ] | 47 ] |
| 48 new_request.extra_args.append('--gtest_filter=%s' % ':'.join(tests)) | 48 new_request.extra_args.append('--gtest_filter=%s' % ':'.join(tests)) |
| 49 | 49 |
| 50 # Remove the env setting for sharding. | 50 # Remove the env setting for sharding. |
| 51 sharding_settings = ['GTEST_SHARD_INDEX', 'GTEST_TOTAL_SHARDS'] | 51 sharding_settings = ['GTEST_SHARD_INDEX', 'GTEST_TOTAL_SHARDS'] |
| 52 new_request.env = [ | 52 new_request.env = [ |
| 53 e for e in new_request.env if e['key'] not in sharding_settings | 53 e for e in new_request.env if e['key'] not in sharding_settings |
| 54 ] | 54 ] |
| 55 | 55 |
| 56 # Reset tags for searching and monitoring. | 56 # Reset tags for searching and monitoring. |
| 57 ref_name = swarming_util.GetTagValue(new_request.tags, 'name') or step_name | |
|
stgao
2016/03/10 23:50:28
Should get from the `ref_request` instead, right?
stgao
2016/03/10 23:50:28
And should not default to the step_name.
stgao
2016/03/10 23:50:28
I'm wondering why don't we get the name from the c
chanli
2016/03/11 00:49:41
No, this is the referred task, the tag is 'name',
chanli
2016/03/11 00:49:41
Done.
chanli
2016/03/11 00:49:41
If we get the name when we list swarming tasks in
stgao
2016/03/11 01:03:20
My thought is that ref_request is the original dat
chanli
2016/03/11 03:47:00
But before you clear new_request.tags, the tags in
stgao
2016/03/11 06:42:58
Using either new_request.tags or ref_request.tags
| |
| 57 new_request.tags = [] | 58 new_request.tags = [] |
| 58 new_request.tags.append('purpose:deflake') | 59 new_request.tags.append('purpose:deflake') |
| 59 new_request.tags.append('ref_master:%s' % master_name) | 60 new_request.tags.append('ref_master:%s' % master_name) |
| 60 new_request.tags.append('ref_buildername:%s' % builder_name) | 61 new_request.tags.append('ref_buildername:%s' % builder_name) |
| 61 new_request.tags.append('ref_buildnumber:%s' % build_number) | 62 new_request.tags.append('ref_buildnumber:%s' % build_number) |
| 62 new_request.tags.append('ref_stepname:%s' % step_name) | 63 new_request.tags.append('ref_stepname:%s' % step_name) |
| 63 new_request.tags.append('ref_task_id:%s' % ref_task_id) | 64 new_request.tags.append('ref_task_id:%s' % ref_task_id) |
| 65 new_request.tags.append('ref_name:%s' % ref_name) | |
| 64 | 66 |
| 65 return new_request | 67 return new_request |
| 66 | 68 |
| 67 | 69 |
| 68 @ndb.transactional | 70 @ndb.transactional |
| 69 def _NeedANewSwarmingTask(master_name, builder_name, build_number, step_name): | 71 def _NeedANewSwarmingTask(master_name, builder_name, build_number, step_name): |
| 70 swarming_task = WfSwarmingTask.Get( | 72 swarming_task = WfSwarmingTask.Get( |
| 71 master_name, builder_name, build_number, step_name) | 73 master_name, builder_name, build_number, step_name) |
| 72 | 74 |
| 73 if not swarming_task: | 75 if not swarming_task: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 # Save the task id. | 155 # Save the task id. |
| 154 swarming_task = WfSwarmingTask.Get( | 156 swarming_task = WfSwarmingTask.Get( |
| 155 master_name, builder_name, build_number, step_name) | 157 master_name, builder_name, build_number, step_name) |
| 156 swarming_task.task_id = task_id | 158 swarming_task.task_id = task_id |
| 157 swarming_task.parameters['tests'] = tests | 159 swarming_task.parameters['tests'] = tests |
| 158 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun | 160 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun |
| 159 swarming_task.put() | 161 swarming_task.put() |
| 160 | 162 |
| 161 logging.info('A Swarming task was triggered:%s', task_id) | 163 logging.info('A Swarming task was triggered:%s', task_id) |
| 162 return task_id | 164 return task_id |
| OLD | NEW |