Skip to content

Commit 1ec1431

Browse files
committed
Bug 1830984 - Make it easier to use fast builds like the non-shippable artifact build r=sparky,perftest-reviewers DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D202846
1 parent 6fb1555 commit 1ec1431

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

tools/tryselect/selectors/perf.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ class PerfParser(CompareParser):
336336
"help": "Use PerfCompare Beta instead of CompareView.",
337337
},
338338
],
339+
[
340+
["--non-pgo"],
341+
{
342+
"action": "store_true",
343+
"default": False,
344+
"help": "Use opt/non-pgo builds instead of shippable/pgo builds. "
345+
"Setting this flag will result in faster try runs.",
346+
},
347+
],
339348
]
340349

341350
def get_tasks(base_cmd, queries, query_arg=None, candidate_tasks=None):
@@ -715,7 +724,7 @@ def _add_variant_queries(
715724
PerfParser.variants[variant.value]["query"]
716725
)
717726

718-
def _build_categories(category, category_info, category_matrix):
727+
def _build_categories(category, category_info, category_matrix, **kwargs):
719728
"""Builds the categories to display."""
720729
categories = {}
721730

@@ -745,6 +754,16 @@ def _build_categories(category, category_info, category_matrix):
745754
for suite in category_info["suites"]
746755
}
747756

757+
if kwargs.get("non_pgo"):
758+
for key, query_list in platform_queries.items():
759+
updated_query_list = []
760+
for query in query_list:
761+
updated_query = query.replace(
762+
"'shippable", "!shippable !nightlyasrelease"
763+
)
764+
updated_query_list.append(updated_query)
765+
platform_queries[key] = updated_query_list
766+
748767
platform_category_name = f"{category} {platform.value}"
749768
platform_category_info = {
750769
"queries": platform_queries,
@@ -931,7 +950,7 @@ def get_categories(**kwargs):
931950
for category, category_matrix in category_decision_matrix.items():
932951
categories.update(
933952
PerfParser._build_categories(
934-
category, PerfParser.categories[category], category_matrix
953+
category, PerfParser.categories[category], category_matrix, **kwargs
935954
)
936955
)
937956

tools/tryselect/test/test_perf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,34 @@ def test_category_expansion(
814814
assert cat_query == expanded_cats[cat_name]["queries"]
815815

816816

817+
@pytest.mark.parametrize(
818+
"category_options, call_counts",
819+
[
820+
(
821+
{},
822+
0,
823+
),
824+
(
825+
{"non_pgo": True},
826+
58,
827+
),
828+
],
829+
)
830+
def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
831+
PerfParser.categories = TEST_CATEGORIES
832+
PerfParser.variants = TEST_VARIANTS
833+
834+
expanded_cats = PerfParser.get_categories(**category_options)
835+
836+
non_shippable_count = 0
837+
for cat_name in expanded_cats:
838+
queries = str(expanded_cats[cat_name].get("queries", None))
839+
if "!shippable !nightlyasrelease" in queries and "'shippable" not in queries:
840+
non_shippable_count += 1
841+
842+
assert non_shippable_count == call_counts
843+
844+
817845
@pytest.mark.parametrize(
818846
"options, call_counts, log_ind, expected_log_message",
819847
[

0 commit comments

Comments
 (0)