Bug 1534375 - Fix intermittent failure in tools/tryselect/test/test_presets.py, r=gbrown
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 13 Mar 2019 14:53:26 +0000
changeset 524877 59cde22537a465d319e7ad210aa77fffbfd56925
parent 524876 e6c8edad26bfacf16e9141b1566e80acd28f87cd
child 524878 482fe5ca8245bdc67c2e61a0e369342583b32bfc
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1534375
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534375 - Fix intermittent failure in tools/tryselect/test/test_presets.py, r=gbrown This makes sure this test doesn't actually generate tasks. Differential Revision: https://phabricator.services.mozilla.com/D23132
tools/tryselect/test/test_presets.py
--- a/tools/tryselect/test/test_presets.py
+++ b/tools/tryselect/test/test_presets.py
@@ -1,15 +1,46 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import mozunit
+import pytest
+
+
+TASKS = [
+    {
+        'kind': 'build',
+        'label': 'build-windows',
+        'attributes': {
+            'build_platform': 'windows',
+        },
+    },
+    {
+        'kind': 'test',
+        'label': 'test-windows-mochitest-e10s',
+        'attributes': {
+            'unittest_suite': 'mochitest',
+            'unittest_flavor': 'browser-chrome',
+            'mochitest_try_name': 'mochitest',
+        },
+    },
+]
+
+
+@pytest.fixture(autouse=True)
+def skip_taskgraph_generation(monkeypatch, tg):
+
+    def fake_generate_tasks(*args, **kwargs):
+        return tg
+
+    from tryselect import tasks
+    monkeypatch.setattr(tasks, 'generate_tasks', fake_generate_tasks)
 
 
 def test_shared_presets(run_mach, shared_name, shared_preset):
     """This test makes sure that we don't break any of the in-tree presets when
     renaming/removing variables in any of the selectors.
     """
     assert 'description' in shared_preset
     assert 'selector' in shared_preset