Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / tools / tryselect / test / test_presets.py
blob89cc810808c23f8ee40561b22414f7f21aca10d1
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 import mozunit
6 import pytest
8 TASKS = [
10 "kind": "build",
11 "label": "build-windows",
12 "attributes": {
13 "build_platform": "windows",
17 "kind": "test",
18 "label": "test-windows-mochitest-e10s",
19 "attributes": {
20 "unittest_suite": "mochitest",
21 "unittest_flavor": "browser-chrome",
22 "mochitest_try_name": "mochitest",
28 @pytest.fixture(autouse=True)
29 def skip_taskgraph_generation(monkeypatch, tg):
30 def fake_generate_tasks(*args, **kwargs):
31 return tg
33 from tryselect import tasks
35 monkeypatch.setattr(tasks, "generate_tasks", fake_generate_tasks)
38 @pytest.mark.xfail(
39 strict=False, reason="Bug 1635204: " "test_shared_presets[sample-suites] is flaky"
41 def test_shared_presets(run_mach, shared_name, shared_preset):
42 """This test makes sure that we don't break any of the in-tree presets when
43 renaming/removing variables in any of the selectors.
44 """
45 assert "description" in shared_preset
46 assert "selector" in shared_preset
48 selector = shared_preset["selector"]
49 if selector == "fuzzy":
50 assert "query" in shared_preset
51 assert isinstance(shared_preset["query"], list)
53 # Run the preset and assert there were no exceptions.
54 assert run_mach(["try", "--no-push", "--preset", shared_name]) == 0
57 if __name__ == "__main__":
58 mozunit.main()