Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: dashboard/dashboard/pinpoint/models/quest/run_test_test.py

Issue 3010873003: [pinpoint] Limit executions to one test run each + device sharding. (Closed)
Patch Set: Ready! Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dashboard/dashboard/pinpoint/models/quest/run_test_test.py
diff --git a/dashboard/dashboard/pinpoint/models/quest/run_test_test.py b/dashboard/dashboard/pinpoint/models/quest/run_test_test.py
index 55513d0708e8fe027350bbaf027a6b3161145d3c..41889dbc36bfe71bfbfe44724fe1def2f842cf11 100644
--- a/dashboard/dashboard/pinpoint/models/quest/run_test_test.py
+++ b/dashboard/dashboard/pinpoint/models/quest/run_test_test.py
@@ -73,7 +73,7 @@ class RunTestFullTest(_RunTestTest):
# Call RunTest.Start() to create an Execution.
quest = run_test.RunTest(_SWARMING_DIMENSIONS, _SWARMING_EXTRA_ARGS)
- execution = quest.Start('input isolate hash')
+ execution = quest.Start('change_1', 'input isolate hash')
swarming_task_result.assert_not_called()
swarming_tasks_new.assert_not_called()
@@ -83,7 +83,7 @@ class RunTestFullTest(_RunTestTest):
execution.Poll()
swarming_task_result.assert_not_called()
- swarming_tasks_new.assert_called_once()
+ self.assertEqual(swarming_tasks_new.call_count, 1)
self.assertNewTaskHasDimensions(swarming_tasks_new)
self.assertFalse(execution.completed)
self.assertFalse(execution.failed)
@@ -108,25 +108,30 @@ class RunTestFullTest(_RunTestTest):
self.assertFalse(execution.failed)
self.assertEqual(execution.result_values, (None,))
self.assertEqual(execution.result_arguments,
- {'isolate_hashes': ('output isolate hash',)})
+ {'isolate_hash': 'output isolate hash'})
self.assertEqual(
{
- 'bot_ids': ['bot id'],
+ 'bot_id': 'bot id',
'input_isolate_hash': 'input isolate hash',
- 'task_ids': ['task id'],
- 'result_arguments': {'isolate_hashes': ('output isolate hash',)},
+ 'task_id': 'task id',
+ 'result_arguments': {'isolate_hash': 'output isolate hash'},
'result_values': (None,),
},
execution.AsDict())
-
- # Start a second Execution to check bot_id handling. We get a bot_id from
- # Swarming from the first Execution and reuse it in subsequent Executions.
- execution = quest.Start('input isolate hash')
+ # Start a second Execution on another Change. It should use the bot_id
+ # from the first execution.
+ execution = quest.Start('change_2', 'input isolate hash')
execution.Poll()
self.assertNewTaskHasBotId(swarming_tasks_new)
+ # Start an Execution on the same Change. It should use a new bot_id.
+ execution = quest.Start('change_2', 'input isolate hash')
+ execution.Poll()
+
+ self.assertNewTaskHasDimensions(swarming_tasks_new)
+
@mock.patch('dashboard.services.swarming_service.Tasks.New')
@mock.patch('dashboard.services.swarming_service.Task.Result')
@@ -137,7 +142,7 @@ class SwarmingTaskStatusTest(_RunTestTest):
swarming_tasks_new.return_value = {'task_id': 'task id'}
quest = run_test.RunTest(_SWARMING_DIMENSIONS, _SWARMING_EXTRA_ARGS)
- execution = quest.Start('input isolate hash')
+ execution = quest.Start(None, 'input isolate hash')
execution.Poll()
execution.Poll()
@@ -158,7 +163,7 @@ class SwarmingTaskStatusTest(_RunTestTest):
swarming_tasks_new.return_value = {'task_id': 'task id'}
quest = run_test.RunTest(_SWARMING_DIMENSIONS, _SWARMING_EXTRA_ARGS)
- execution = quest.Start('isolate_hash')
+ execution = quest.Start(None, 'isolate_hash')
execution.Poll()
execution.Poll()
@@ -184,7 +189,7 @@ class BotIdHandlingTest(_RunTestTest):
swarming_task_result.return_value = {'state': 'EXPIRED'}
quest = run_test.RunTest(_SWARMING_DIMENSIONS, _SWARMING_EXTRA_ARGS)
- execution = quest.Start('input isolate hash')
+ execution = quest.Start('change_1', 'input isolate hash')
execution.Poll()
execution.Poll()
@@ -195,7 +200,7 @@ class BotIdHandlingTest(_RunTestTest):
'outputs_ref': {'isolated': 'output isolate hash'},
'state': 'COMPLETED',
}
- execution = quest.Start('input isolate hash')
+ execution = quest.Start('change_2', 'input isolate hash')
execution.Poll()
self.assertTrue(execution.completed)
@@ -210,8 +215,8 @@ class BotIdHandlingTest(_RunTestTest):
# Executions after the first must wait for the first execution to get a bot
# ID. To preserve device affinity, they must use the same bot.
quest = run_test.RunTest(_SWARMING_DIMENSIONS, _SWARMING_EXTRA_ARGS)
- execution_1 = quest.Start('input isolate hash')
- execution_2 = quest.Start('input isolate hash')
+ execution_1 = quest.Start('change_1', 'input isolate hash')
+ execution_2 = quest.Start('change_2', 'input isolate hash')
swarming_tasks_new.return_value = {'task_id': 'task id'}
swarming_task_result.return_value = {'state': 'PENDING'}

Powered by Google App Engine
This is Rietveld 408576698