Bug 1960465 - Set HG_TO_GIT_MIGRATION_COMPLETE to True, and make sure all unit tests pass. r=perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D248427
This commit is contained in:
committed by
aglavic@mozilla.com
parent
1f6c58fbc3
commit
afb221d015
@@ -69,7 +69,7 @@ TREEHERDER_ALERT_TASKS_URL = (
|
||||
)
|
||||
|
||||
# Our ./mach try perf changes should only take effect after we have migrated to github
|
||||
HG_TO_GIT_MIGRATION_COMPLETE = False
|
||||
HG_TO_GIT_MIGRATION_COMPLETE = True
|
||||
ON_GIT = get_repository_object(build.topsrcdir).name == "git"
|
||||
|
||||
# Prevent users from running more than 300 tests at once. It's possible, but
|
||||
@@ -1324,7 +1324,7 @@ class PerfParser(CompareParser):
|
||||
dry_run=dry_run,
|
||||
closed_tree=False,
|
||||
allow_log_capture=True,
|
||||
push_to_vcs=True,
|
||||
push_to_vcs=not ON_GIT,
|
||||
)
|
||||
|
||||
PerfParser.push_info.base_revision = log_processor.revision
|
||||
@@ -1364,7 +1364,7 @@ class PerfParser(CompareParser):
|
||||
dry_run=dry_run,
|
||||
closed_tree=False,
|
||||
allow_log_capture=True,
|
||||
push_to_vcs=True,
|
||||
push_to_vcs=not ON_GIT,
|
||||
)
|
||||
|
||||
PerfParser.push_info.new_revision = log_processor.revision
|
||||
@@ -1655,7 +1655,7 @@ def run(**kwargs):
|
||||
PERFHERDER_BASE_URL % PerfParser.push_info.get_perfcompare_settings()
|
||||
)
|
||||
compareview_url_print = f" The old comparison tool is still available at this URL:\n {compareview_url}\n"
|
||||
if HG_TO_GIT_MIGRATION_COMPLETE:
|
||||
if HG_TO_GIT_MIGRATION_COMPLETE and ON_GIT:
|
||||
perfcompare_url = (
|
||||
PERFCOMPARE_BASE_URL_GIT
|
||||
% PerfParser.push_info.get_perfcompare_settings_git()
|
||||
|
||||
@@ -929,11 +929,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=13\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -943,11 +941,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=13\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -957,12 +953,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=cached_base_revision&newRev=revision&"
|
||||
"baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=cached_base_revision&newProject=try&newRevision=revision&framework=13\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash=cached_base_revision&newHash={hash('mocked100')}&baseHashDate=2024-04-04&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -981,11 +974,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=1\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -995,11 +986,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=1\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -1018,11 +1007,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=13\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -1032,11 +1019,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=13\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=13\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -1046,11 +1031,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=1\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
),
|
||||
),
|
||||
(
|
||||
@@ -1060,11 +1043,9 @@ def test_category_expansion_with_non_pgo_flag(category_options, call_counts):
|
||||
(
|
||||
"\n!!!NOTE!!!\n You'll be able to find a performance comparison "
|
||||
"here once the tests are complete (ensure you select the right framework):\n"
|
||||
" https://perf.compare/compare-results?"
|
||||
"baseRev=revision&newRev=revision&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
" The old comparison tool is still available at this URL:\n"
|
||||
" https://treeherder.mozilla.org/perfherder/compare?originalProject=try&original"
|
||||
"Revision=revision&newProject=try&newRevision=revision&framework=1\n"
|
||||
" https://perf.compare/compare-hash-results?"
|
||||
f"baseHash={hash('mockedmocked')}&newHash={hash('mocked100')}&baseHashDate=2025-01-01&newHashDate=2025-01-01"
|
||||
f"&baseRepo=try&newRepo=try&framework=1\n\n"
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -1089,7 +1070,17 @@ def test_full_run(options, call_counts, log_ind, expected_log_message):
|
||||
"tryselect.selectors.perf.PerfParser.set_categories_for_test"
|
||||
) as tests_mock, mock.patch(
|
||||
"tryselect.selectors.perf.requests"
|
||||
) as requests_mock:
|
||||
) as requests_mock, mock.patch(
|
||||
"tryselect.selectors.perf.datetime"
|
||||
) as mock_datetime, mock.patch(
|
||||
"tryselect.selectors.perf.HG_TO_GIT_MIGRATION_COMPLETE", return_value=True
|
||||
), mock.patch(
|
||||
"tryselect.selectors.perf.ON_GIT", return_value=True
|
||||
), mock.patch(
|
||||
"tryselect.selectors.perf.time.time", return_value=100
|
||||
), mock.patch(
|
||||
"tryselect.selectors.perf.subprocess.getoutput", return_value="mocked"
|
||||
):
|
||||
|
||||
def test_mock_func(*args, **kwargs):
|
||||
"""Used for testing any --test functionality."""
|
||||
@@ -1155,6 +1146,7 @@ def test_full_run(options, call_counts, log_ind, expected_log_message):
|
||||
|
||||
fzf.side_effect = fzf_side_effects
|
||||
ccr.return_value = options.get("cached_revision", (None, None))
|
||||
mock_datetime.today.return_value = datetime(2025, 1, 1)
|
||||
|
||||
with category_reset():
|
||||
run(**options)
|
||||
|
||||
Reference in New Issue
Block a user