зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1740381 - Port bug 1736565 (Infer artifact build candidate tree based on version) for comm- trees. r=nalexander
This is the same configuration as for mozilla- trees as added in https://hg.mozilla.org/mozilla-central/rev/93e421a84361 except Thunderbird doesn't use comm-release. Differential Revision: https://phabricator.services.mozilla.com/D130817
This commit is contained in:
Родитель
620bd78775
Коммит
c40e648417
|
@ -762,9 +762,16 @@ class ThunderbirdMixin(object):
|
|||
product = "thunderbird"
|
||||
try_tree = "try-comm-central"
|
||||
|
||||
@property
|
||||
def candidate_trees(self):
|
||||
return ["comm-central"]
|
||||
nightly_candidate_trees = [
|
||||
"comm-central",
|
||||
]
|
||||
beta_candidate_trees = [
|
||||
"releases/comm-beta",
|
||||
]
|
||||
# The list below list should be updated when we have new ESRs.
|
||||
esr_candidate_trees = [
|
||||
"releases/comm-esr91",
|
||||
]
|
||||
|
||||
|
||||
class LinuxThunderbirdArtifactJob(ThunderbirdMixin, LinuxArtifactJob):
|
||||
|
|
|
@ -70,9 +70,41 @@ class FakeThunderbirdJob(ThunderbirdMixin, FakeArtifactJob):
|
|||
|
||||
|
||||
class TestThunderbirdMixin(TestCase):
|
||||
def test_candidate_trees(self):
|
||||
def _assert_candidate_trees(self, version_display, expected_trees):
|
||||
buildconfig.substs["MOZ_APP_VERSION_DISPLAY"] = version_display
|
||||
|
||||
job = FakeThunderbirdJob()
|
||||
self.assertEqual(job.candidate_trees, ["comm-central"])
|
||||
self.assertGreater(len(job.candidate_trees), 0)
|
||||
self.assertEqual(job.candidate_trees, expected_trees)
|
||||
|
||||
def test_candidate_trees_with_beta_version(self):
|
||||
self._assert_candidate_trees(
|
||||
version_display="92.1b2",
|
||||
expected_trees=ThunderbirdMixin.beta_candidate_trees,
|
||||
)
|
||||
|
||||
def test_candidate_trees_with_esr_version(self):
|
||||
self._assert_candidate_trees(
|
||||
version_display="91.3.0esr",
|
||||
expected_trees=ThunderbirdMixin.esr_candidate_trees,
|
||||
)
|
||||
|
||||
def test_candidate_trees_with_nightly_version(self):
|
||||
self._assert_candidate_trees(
|
||||
version_display="95.0a1",
|
||||
expected_trees=ThunderbirdMixin.nightly_candidate_trees,
|
||||
)
|
||||
|
||||
def test_property_is_cached(self):
|
||||
job = FakeThunderbirdJob()
|
||||
expected_trees = ThunderbirdMixin.esr_candidate_trees
|
||||
|
||||
buildconfig.substs["MOZ_APP_VERSION_DISPLAY"] = "91.3.0.esr"
|
||||
self.assertEqual(job.candidate_trees, expected_trees)
|
||||
# Because the property is cached, changing the
|
||||
# `MOZ_APP_VERSION_DISPLAY` won't have any impact.
|
||||
buildconfig.substs["MOZ_APP_VERSION_DISPLAY"] = ""
|
||||
self.assertEqual(job.candidate_trees, expected_trees)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Загрузка…
Ссылка в новой задаче